Class EmbeddedAreaPlaneConvexSubset
- java.lang.Object
-
- org.apache.commons.geometry.euclidean.threed.AbstractPlaneSubset
-
- org.apache.commons.geometry.euclidean.threed.AbstractEmbeddedRegionPlaneSubset
-
- org.apache.commons.geometry.euclidean.threed.EmbeddedAreaPlaneConvexSubset
-
- All Implemented Interfaces:
Embedding<Vector3D,Vector2D>
,HyperplaneConvexSubset<Vector3D>
,HyperplaneSubset<Vector3D>
,Splittable<Vector3D,HyperplaneSubset<Vector3D>>
,RegionEmbedding<Vector3D,Vector2D>
,Sized
,PlaneConvexSubset
,PlaneConvexSubset.Embedded
,PlaneSubset
,PlaneSubset.Embedded
final class EmbeddedAreaPlaneConvexSubset extends AbstractEmbeddedRegionPlaneSubset implements PlaneConvexSubset, PlaneConvexSubset.Embedded
Internal implementation ofPlaneConvexSubset
that uses an embeddedConvexArea
to represent the subspace region. This class is capable of representing regions of infinite size.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.commons.geometry.euclidean.threed.PlaneConvexSubset
PlaneConvexSubset.Embedded
-
Nested classes/interfaces inherited from interface org.apache.commons.geometry.euclidean.threed.PlaneSubset
PlaneSubset.Embedded
-
-
Field Summary
Fields Modifier and Type Field Description private ConvexArea
area
The embedded 2D area.
-
Constructor Summary
Constructors Constructor Description EmbeddedAreaPlaneConvexSubset(EmbeddingPlane plane, ConvexArea area)
Create a new instance from its component parts.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bounds3D
getBounds()
Get aBounds3D
object defining an axis-aligned bounding box containing all vertices for this subset.PlaneConvexSubset.Embedded
getEmbedded()
Return an object containing the plane subset as an embedded 2D subspace region.ConvexArea
getSubspaceRegion()
Get the embedded subspace region.java.util.List<Vector3D>
getVertices()
Get the vertices for the convex subset in a counter-clockwise order as viewed looking down the plane normal.EmbeddedAreaPlaneConvexSubset
reverse()
Reverse the orientation of the hyperplane for this instance, returning the result as a new instance.Split<PlaneConvexSubset>
split(Hyperplane<Vector3D> splitter)
Split this instance with the given hyperplane.java.util.List<Triangle3D>
toTriangles()
Return a list of triangles representing the same subset region as this instance.EmbeddedAreaPlaneConvexSubset
transform(Transform<Vector3D> transform)
Return a new hyperplane subset resulting from the application of the given transform.-
Methods inherited from class org.apache.commons.geometry.euclidean.threed.AbstractEmbeddedRegionPlaneSubset
classify, closest, getBoundsFromSubspace, getCentroid, getHyperplane, getPlane, getSize, isEmpty, isFull, toSpace, toString, toSubspace
-
Methods inherited from class org.apache.commons.geometry.euclidean.threed.AbstractPlaneSubset
intersection, intersection
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.commons.geometry.core.Embedding
toSpace, toSpace, toSubspace, toSubspace
-
Methods inherited from interface org.apache.commons.geometry.core.partitioning.HyperplaneSubset
classify, closest, contains, getCentroid, isEmpty, isFull
-
Methods inherited from interface org.apache.commons.geometry.euclidean.threed.PlaneConvexSubset
toConvex
-
Methods inherited from interface org.apache.commons.geometry.euclidean.threed.PlaneSubset
getHyperplane, getPlane, intersection, intersection
-
Methods inherited from interface org.apache.commons.geometry.euclidean.threed.PlaneSubset.Embedded
getPlane
-
Methods inherited from interface org.apache.commons.geometry.core.Sized
getSize, isFinite, isInfinite
-
-
-
-
Field Detail
-
area
private final ConvexArea area
The embedded 2D area.
-
-
Constructor Detail
-
EmbeddedAreaPlaneConvexSubset
EmbeddedAreaPlaneConvexSubset(EmbeddingPlane plane, ConvexArea area)
Create a new instance from its component parts.- Parameters:
plane
- plane the the convex area is embedded inarea
- the embedded convex area
-
-
Method Detail
-
getEmbedded
public PlaneConvexSubset.Embedded getEmbedded()
Return an object containing the plane subset as an embedded 2D subspace region.- Specified by:
getEmbedded
in interfacePlaneConvexSubset
- Specified by:
getEmbedded
in interfacePlaneSubset
- Returns:
- an object containing the plane subset as an embedded 2D subspace region
-
getSubspaceRegion
public ConvexArea getSubspaceRegion()
Get the embedded subspace region.- Specified by:
getSubspaceRegion
in interfacePlaneConvexSubset.Embedded
- Specified by:
getSubspaceRegion
in interfacePlaneSubset.Embedded
- Specified by:
getSubspaceRegion
in interfaceRegionEmbedding<Vector3D,Vector2D>
- Returns:
- the embedded subspace region
-
getVertices
public java.util.List<Vector3D> getVertices()
Get the vertices for the convex subset in a counter-clockwise order as viewed looking down the plane normal. Each vertex in the returned list is unique. If the boundary of the subset is closed, the start vertex is not repeated at the end of the list.It is important to note that, in general, the list of vertices returned by this method is not sufficient to completely characterize the subset. For example, a simple triangle has 3 vertices, but an infinite area constructed from two parallel lines and two lines that intersect between them will also have 3 vertices. It is also possible for non-empty subsets to contain no vertices at all. For example, a subset with no boundaries (representing the full plane), a subset with a single boundary (ie, a half-plane), or a subset with two parallel boundaries will not contain any vertices.
- Specified by:
getVertices
in interfacePlaneConvexSubset
- Returns:
- the list of vertices for the plane convex subset in a counter-clockwise order as viewed looking down the plane normal
-
getBounds
public Bounds3D getBounds()
Get aBounds3D
object defining an axis-aligned bounding box containing all vertices for this subset. Null is returned if the subset is infinite or does not contain any vertices.- Specified by:
getBounds
in interfacePlaneSubset
- Returns:
- the bounding box for this instance or null if no valid bounds could be determined
-
toTriangles
public java.util.List<Triangle3D> toTriangles()
Return a list of triangles representing the same subset region as this instance. AnIllegalStateException
is thrown if the subset has infinite size and therefore cannot be converted to triangles. If the subset has zero size (is empty), an empty list is returned.- Specified by:
toTriangles
in interfacePlaneSubset
- Returns:
- a list of triangles representing the same subset region as this instance
-
transform
public EmbeddedAreaPlaneConvexSubset transform(Transform<Vector3D> transform)
Return a new hyperplane subset resulting from the application of the given transform. The current instance is not modified.- Specified by:
transform
in interfaceHyperplaneConvexSubset<Vector3D>
- Specified by:
transform
in interfaceHyperplaneSubset<Vector3D>
- Specified by:
transform
in interfacePlaneConvexSubset
- Parameters:
transform
- the transform instance to apply- Returns:
- new transformed hyperplane subset
-
reverse
public EmbeddedAreaPlaneConvexSubset reverse()
Reverse the orientation of the hyperplane for this instance, returning the result as a new instance. The returned subset contains the same points but has a reversed orientation.- Specified by:
reverse
in interfaceHyperplaneConvexSubset<Vector3D>
- Specified by:
reverse
in interfacePlaneConvexSubset
- Returns:
- a hyperplane convex subset representing the same region but with the opposite orientation.
-
split
public Split<PlaneConvexSubset> split(Hyperplane<Vector3D> splitter)
Split this instance with the given hyperplane.- Specified by:
split
in interfaceHyperplaneConvexSubset<Vector3D>
- Specified by:
split
in interfacePlaneConvexSubset
- Specified by:
split
in interfaceSplittable<Vector3D,HyperplaneSubset<Vector3D>>
- Parameters:
splitter
- the hyperplane to split this object with.- Returns:
- result of the split operation
-
-