public final class EmbeddedTreePlaneSubset extends Object
RegionBSPTree2D
.
This class can represent convex, non-convex, finite, infinite, and empty regions.
This class is mutable and not thread safe.
PlaneSubset.Embedded
Constructor and Description |
---|
EmbeddedTreePlaneSubset(EmbeddingPlane plane)
Construct a new, empty plane subset for the given plane.
|
EmbeddedTreePlaneSubset(EmbeddingPlane plane,
boolean full)
Construct a new subset for the given plane.
|
EmbeddedTreePlaneSubset(EmbeddingPlane plane,
RegionBSPTree2D region)
Construct a new instance from its defining plane and subspace region.
|
Modifier and Type | Method and Description |
---|---|
void |
add(EmbeddedTreePlaneSubset subset)
Add a plane subset to this instance.
|
void |
add(PlaneConvexSubset subset)
Add a plane convex subset to this instance.
|
RegionLocation |
classify(Vector3D pt) |
Vector3D |
closest(Vector3D pt) |
Bounds3D |
getBounds()
Get a
Bounds3D object defining an axis-aligned bounding box containing all
vertices for this subset. |
protected Bounds3D |
getBoundsFromSubspace(BoundarySource2D src)
Compute 3D bounds from a subspace boundary source.
|
Vector3D |
getCentroid() |
PlaneSubset.Embedded |
getEmbedded()
Return an object containing the plane subset as an embedded 2D subspace region.
|
EmbeddingPlane |
getHyperplane() |
EmbeddingPlane |
getPlane()
Get the plane embedding the subspace region.
|
double |
getSize() |
RegionBSPTree2D |
getSubspaceRegion() |
Vector3D |
intersection(Line3D line)
Get the unique intersection of this plane subset with the given line.
|
Vector3D |
intersection(LineConvexSubset3D lineSubset)
Get the unique intersection of this plane subset with the given line subset.
|
boolean |
isEmpty() |
boolean |
isFull() |
Split<EmbeddedTreePlaneSubset> |
split(Hyperplane<Vector3D> splitter) |
List<PlaneConvexSubset> |
toConvex() |
Vector3D |
toSpace(Vector2D pt) |
String |
toString() |
Vector2D |
toSubspace(Vector3D pt) |
List<Triangle3D> |
toTriangles()
Return a list of triangles representing the same subset region as this instance.
|
EmbeddedTreePlaneSubset |
transform(Transform<Vector3D> transform) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
toSpace, toSubspace
contains
isFinite, isInfinite
public EmbeddedTreePlaneSubset(EmbeddingPlane plane)
plane
- plane containing the subsetpublic EmbeddedTreePlaneSubset(EmbeddingPlane plane, boolean full)
full
is true, then the subset will cover the entire plane; otherwise,
it will be empty.plane
- plane containing the subsetfull
- if true, the subset will cover the entire space;
otherwise it will be emptypublic EmbeddedTreePlaneSubset(EmbeddingPlane plane, RegionBSPTree2D region)
plane
- plane containing the subsetregion
- subspace region for the plane subsetpublic PlaneSubset.Embedded getEmbedded()
public RegionBSPTree2D getSubspaceRegion()
public List<PlaneConvexSubset> toConvex()
public List<Triangle3D> toTriangles()
IllegalStateException
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.public Bounds3D getBounds()
Bounds3D
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.public Split<EmbeddedTreePlaneSubset> split(Hyperplane<Vector3D> splitter)
In all cases, the current instance is not modified. However, In order to avoid
unnecessary copying, this method will use the current instance as the split value when
the instance lies entirely on the plus or minus side of the splitter. For example, if
this instance lies entirely on the minus side of the splitter, the plane subset
returned by Split.getMinus()
will be this instance. Similarly, Split.getPlus()
will return the current instance if it lies entirely on the plus side. Callers need to make
special note of this, since this class is mutable.
public EmbeddedTreePlaneSubset transform(Transform<Vector3D> transform)
public void add(PlaneConvexSubset subset)
subset
- plane convex subset to addIllegalArgumentException
- if the given plane subset is not from
a plane equivalent to this instancepublic void add(EmbeddedTreePlaneSubset subset)
subset
- plane subset to addIllegalArgumentException
- if the given plane subset is not from
a plane equivalent to this instancepublic EmbeddingPlane getPlane()
getPlane
in interface PlaneSubset
getPlane
in interface PlaneSubset.Embedded
PlaneSubset.getHyperplane()
public EmbeddingPlane getHyperplane()
getHyperplane
in interface HyperplaneSubset<Vector3D>
getHyperplane
in interface PlaneSubset
public boolean isFull()
isFull
in interface HyperplaneSubset<Vector3D>
public boolean isEmpty()
isEmpty
in interface HyperplaneSubset<Vector3D>
public Vector3D getCentroid()
getCentroid
in interface HyperplaneSubset<Vector3D>
public Vector2D toSubspace(Vector3D pt)
toSubspace
in interface Embedding<Vector3D,Vector2D>
public RegionLocation classify(Vector3D pt)
classify
in interface HyperplaneSubset<Vector3D>
public Vector3D closest(Vector3D pt)
closest
in interface HyperplaneSubset<Vector3D>
protected Bounds3D getBoundsFromSubspace(BoundarySource2D src)
src
- subspace boundary sourcepublic Vector3D intersection(Line3D line)
intersection
in interface PlaneSubset
line
- line to intersect with this plane subsetPlane.intersection(Line3D)
public Vector3D intersection(LineConvexSubset3D lineSubset)
intersection
in interface PlaneSubset
lineSubset
- line subset to intersect withPlane.intersection(Line3D)
Copyright © 2016–2021 The Apache Software Foundation. All rights reserved.