| Modifier and Type | Field and Description |
|---|---|
| private List | loops
Boundary defined as an array of closed loops start vertices. |
| Access | Constructor and Description |
|---|---|
| public | SphericalPolygonsSet(final double
below which points are consider to be identical tolerance)Build a polygons set representing the whole real 2-sphere. |
| public | SphericalPolygonsSet(final Vector3D
pole of the hemisphere (the pole is in the inside half) pole, final double below which points are consider to be identical tolerance)Build a polygons set representing a hemisphere. |
| public | SphericalPolygonsSet(final Vector3D
center of the polygon (the center is in the inside half) center, final Vector3D point defining the reference meridian for first polygon vertex meridian, final double distance of the vertices to the center outsideRadius, final int number of sides of the polygon n, final double below which points are consider to be identical tolerance)Build a polygons set representing a regular polygon. |
| public | SphericalPolygonsSet(final BSPTree<Sphere2D>
inside/outside BSP tree representing the region tree, final double below which points are consider to be identical tolerance)Build a polygons set from a BSP tree. |
| public | SphericalPolygonsSet(final Collection<SubHyperplane<Sphere2D>>
collection of boundary elements, as a
collection of boundary, final double SubHyperplane objectsbelow which points are consider to be identical tolerance)Build a polygons set from a Boundary REPresentation (B-rep). |
| public | SphericalPolygonsSet(final double
tolerance below which points are considered to
belong to the hyperplane (which is therefore more a slab) hyperplaneThickness, final S2Point... vertices of the simple loop boundary vertices)Build a polygon from a simple list of vertices. |
| Modifier and Type | Method and Description |
|---|---|
| public SphericalPolygonsSet | buildNew(final BSPTree<Sphere2D>
inside/outside BSP tree representing the new region tree)Implements abstract org. Implements org. Build a region using the instance as a prototype. |
| protected void | computeGeometricalProperties()
Implements abstract org. Compute some geometrical properties. |
| private static S2Point[] | Returns: vertices arraycenter of the polygon (the center is in the inside half) center, final Vector3D point defining the reference meridian for first polygon vertex meridian, final double distance of the vertices to the center outsideRadius, final int number of sides of the polygon n)Build the vertices representing a regular polygon. |
| public List | Returns: boundary of the polygon, organized as an unmodifiable list of loops start vertices.Get the boundary loops of the polygon. |
| public EnclosingBall | Returns: a spherical cap enclosing the polygonGet a spherical cap enclosing the polygon. |
| private List | Returns: list of points known to be strictly in all inside convex cellsGather some inside points. |
| private List | Returns: list of points known to be strictly in all outside convex cellsGather some outside points. |
| private static void | insertEdges(final double
tolerance below which points are considered to
belong to the hyperplane (which is therefore more a slab) hyperplaneThickness, final BSPTree<Sphere2D> current tree node (it is a leaf node at the beginning
of the call) node, final List<Edge> list of edges to insert in the cell defined by this node
(excluding edges not belonging to the cell defined by this node) edges)Recursively build a tree by inserting cut sub-hyperplanes. |
| private static BSPTree | Returns: the BSP tree of the input verticestolerance below which points are consider to
belong to the hyperplane (which is therefore more a slab) hyperplaneThickness, final S2Point... vertices of the simple loop boundary vertices)Build the BSP tree of a polygons set from a simple list of vertices. |
| loops | back to summary |
|---|---|
| private List<Vertex> loops Boundary defined as an array of closed loops start vertices. | |
| SphericalPolygonsSet | back to summary |
|---|---|
| public SphericalPolygonsSet(final double tolerance) Build a polygons set representing the whole real 2-sphere.
| |
| SphericalPolygonsSet | back to summary |
|---|---|
| public SphericalPolygonsSet(final Vector3D pole, final double tolerance) Build a polygons set representing a hemisphere.
| |
| SphericalPolygonsSet | back to summary |
|---|---|
| public SphericalPolygonsSet(final Vector3D center, final Vector3D meridian, final double outsideRadius, final int n, final double tolerance) Build a polygons set representing a regular polygon.
| |
| SphericalPolygonsSet | back to summary |
|---|---|
| public SphericalPolygonsSet(final BSPTree<Sphere2D> tree, final double tolerance) Build a polygons set from a BSP tree. The leaf nodes of the BSP tree must have a
| |
| SphericalPolygonsSet | back to summary |
|---|---|
| public SphericalPolygonsSet(final Collection<SubHyperplane<Sphere2D>> boundary, final double tolerance) Build a polygons set from a Boundary REPresentation (B-rep). The boundary is provided as a collection of The boundary elements can be in any order, and can form
several non-connected sets (like for example polygons with holes
or a set of disjoint polygons considered as a whole). In
fact, the elements do not even need to be connected together
(their topological connections are not used here). However, if the
boundary does not really separate an inside open from an outside
open (open having here its topological meaning), then subsequent
calls to the If the boundary is empty, the region will represent the whole space.
| |
| SphericalPolygonsSet | back to summary |
|---|---|
| public SphericalPolygonsSet(final double hyperplaneThickness, final S2Point... vertices) Build a polygon from a simple list of vertices. The boundary is provided as a list of points considering to represent the vertices of a simple loop. The interior part of the region is on the left side of this path and the exterior is on its right side. This constructor does not handle polygons with a boundary forming several disconnected paths (such as polygons with holes). For cases where this simple constructor applies, it is expected to
be numerically more robust than the If the list is empty, the region will represent the whole space.
Polygons with thin pikes or dents are inherently difficult to handle because
they involve circles with almost opposite directions at some vertices. Polygons
whose vertices come from some physical measurement with noise are also
difficult because an edge that should be straight may be broken in lots of
different pieces with almost equal directions. In both cases, computing the
circles intersections is not numerically robust due to the almost 0 or almost
π angle. Such cases need to carefully adjust the
| |
| buildNew | back to summary |
|---|---|
| public SphericalPolygonsSet buildNew(final BSPTree<Sphere2D> tree) Implements abstract org. Implements org. Doc from org. Build a region using the instance as a prototype. This method allow to create new instances without knowing exactly the type of the region. It is an application of the prototype design pattern. The leaf nodes of the BSP tree must have a
| |
| computeGeometricalProperties | back to summary |
|---|---|
| protected void computeGeometricalProperties() throws MathIllegalStateException Implements abstract org. Doc from org. Compute some geometrical properties. The properties to compute are the barycenter and the size.
| |
| createRegularPolygonVertices | back to summary |
|---|---|
| private static S2Point[] createRegularPolygonVertices(final Vector3D center, final Vector3D meridian, final double outsideRadius, final int n) Build the vertices representing a regular polygon. | |
| getBoundaryLoops | back to summary |
|---|---|
| public List Get the boundary loops of the polygon. The polygon boundary can be represented as a list of closed loops, each loop being given by exactly one of its vertices. From each loop start vertex, one can follow the loop by finding the outgoing edge, then the end vertex, then the next outgoing edge ... until the start vertex of the loop (exactly the same instance) is found again once the full loop has been visited. If the polygon has no boundary at all, a zero length loop array will be returned. If the polygon is a simple one-piece polygon, then the returned array will contain a single vertex. All edges in the various loops have the inside of the region on their left side (i.e. toward their pole) and the outside on their right side (i.e. away from their pole) when moving in the underlying circle direction. This means that the closed loops obey the direct trigonometric orientation.
| |
| getEnclosingCap | back to summary |
|---|---|
| public EnclosingBall Get a spherical cap enclosing the polygon.
This method is intended as a first test to quickly identify points
that are guaranteed to be outside of the region, hence performing a full
// compute region, plus an enclosing spherical cap SphericalPolygonsSet complexShape = ...; EnclosingBall
In the special cases of empty or whole sphere polygons, special
spherical caps are returned, with angular radius set to negative
or positive infinity so the This method is not guaranteed to return the smallest enclosing cap.
| |
| getInsidePoints | back to summary |
|---|---|
| private List Gather some inside points. | |
| getOutsidePoints | back to summary |
|---|---|
| private List Gather some outside points. | |
| insertEdges | back to summary |
|---|---|
| private static void insertEdges(final double hyperplaneThickness, final BSPTree<Sphere2D> node, final List<Edge> edges) Recursively build a tree by inserting cut sub-hyperplanes.
| |
| verticesToTree | back to summary |
|---|---|
| private static BSPTree Build the BSP tree of a polygons set from a simple list of vertices. The boundary is provided as a list of points considering to represent the vertices of a simple loop. The interior part of the region is on the left side of this path and the exterior is on its right side. This constructor does not handle polygons with a boundary forming several disconnected paths (such as polygons with holes). This constructor handles only polygons with edges strictly shorter than \( \pi \). If longer edges are needed, they need to be broken up in smaller sub-edges so this constraint holds. For cases where this simple constructor applies, it is expected to
be numerically more robust than the | |