| Modifier and Type | Field and Description |
|---|---|
| private transient Segment[] | lineSegments
Line segments of the hull. |
| private static final long | serialVersionUID
Serializable UID. |
| private final double | tolerance
Tolerance threshold used during creation of the hull vertices. |
| private final Vector2D[] | vertices
Vertices of the hull. |
| Access | Constructor and Description |
|---|---|
| public | ConvexHull2D(final Vector2D[]
the vertices of the convex hull, must be ordered vertices, final double tolerance below which points are considered identical tolerance)Simple constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public Region | createRegion()
Implements org. Returns a new region that is enclosed by the convex hull. |
| public Segment[] | Returns: the line segments of the convex hullGet the line segments of the convex hull, ordered. |
| public Vector2D[] | getVertices()
Implements org. Get the vertices of the convex hull. |
| private boolean | |
| private Segment[] | Returns: the array of line segmentsRetrieve the line segments from the cached array or create them if needed. |
| lineSegments | back to summary |
|---|---|
| private transient Segment[] lineSegments Line segments of the hull. The array is not serialized and will be created from the vertices on first access. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serializable UID. | |
| tolerance | back to summary |
|---|---|
| private final double tolerance Tolerance threshold used during creation of the hull vertices. | |
| vertices | back to summary |
|---|---|
| private final Vector2D[] vertices Vertices of the hull. | |
| ConvexHull2D | back to summary |
|---|---|
| public ConvexHull2D(final Vector2D[] vertices, final double tolerance) throws MathIllegalArgumentException Simple constructor.
| |
| createRegion | back to summary |
|---|---|
| public Region Implements org. Doc from org. Returns a new region that is enclosed by the convex hull.
| |
| getLineSegments | back to summary |
|---|---|
| public Segment[] getLineSegments() Get the line segments of the convex hull, ordered.
| |
| getVertices | back to summary |
|---|---|
| public Vector2D[] getVertices() Implements org. Doc from org. Get the vertices of the convex hull.
| |
| isConvex | back to summary |
|---|---|
| private boolean isConvex(final Vector2D[] hullVertices) Checks whether the given hull vertices form a convex hull.
| |
| retrieveLineSegments | back to summary |
|---|---|
| private Segment[] retrieveLineSegments() Retrieve the line segments from the cached array or create them if needed.
| |