|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math3.geometry.partitioning.AbstractRegion<Euclidean3D,Euclidean2D>
org.apache.commons.math3.geometry.euclidean.threed.PolyhedronsSet
public class PolyhedronsSet
This class represents a 3D region: a set of polyhedrons.
Nested Class Summary | |
---|---|
private class |
PolyhedronsSet.FacetsContributionVisitor
Visitor computing geometrical properties. |
private static class |
PolyhedronsSet.RotationTransform
3D rotation as a Transform. |
private static class |
PolyhedronsSet.TranslationTransform
3D translation as a transform. |
Nested classes/interfaces inherited from interface org.apache.commons.math3.geometry.partitioning.Region |
---|
Region.Location |
Constructor Summary | |
---|---|
PolyhedronsSet()
Build a polyhedrons set representing the whole real line. |
|
PolyhedronsSet(BSPTree<Euclidean3D> tree)
Build a polyhedrons set from a BSP tree. |
|
PolyhedronsSet(java.util.Collection<SubHyperplane<Euclidean3D>> boundary)
Build a polyhedrons set from a Boundary REPresentation (B-rep). |
|
PolyhedronsSet(double xMin,
double xMax,
double yMin,
double yMax,
double zMin,
double zMax)
Build a parallellepipedic box. |
Method Summary | |
---|---|
private SubHyperplane<Euclidean3D> |
boundaryFacet(Vector3D point,
BSPTree<Euclidean3D> node)
Check if a point belongs to the boundary part of a node. |
private static BSPTree<Euclidean3D> |
buildBoundary(double xMin,
double xMax,
double yMin,
double yMax,
double zMin,
double zMax)
Build a parallellepipedic box boundary. |
PolyhedronsSet |
buildNew(BSPTree<Euclidean3D> tree)
Build a region using the instance as a prototype. |
protected void |
computeGeometricalProperties()
Compute some geometrical properties. |
SubHyperplane<Euclidean3D> |
firstIntersection(Vector3D point,
Line line)
Get the first sub-hyperplane crossed by a semi-infinite line. |
private SubHyperplane<Euclidean3D> |
recurseFirstIntersection(BSPTree<Euclidean3D> node,
Vector3D point,
Line line)
Get the first sub-hyperplane crossed by a semi-infinite line. |
PolyhedronsSet |
rotate(Vector3D center,
Rotation rotation)
Rotate the region around the specified point. |
PolyhedronsSet |
translate(Vector3D translation)
Translate the region by the specified amount. |
Methods inherited from class org.apache.commons.math3.geometry.partitioning.AbstractRegion |
---|
applyTransform, checkPoint, checkPoint, contains, copySelf, getBarycenter, getBoundarySize, getSize, getTree, intersection, isEmpty, isEmpty, setBarycenter, setSize, side |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PolyhedronsSet()
public PolyhedronsSet(BSPTree<Euclidean3D> tree)
The leaf nodes of the BSP tree must have a
Boolean
attribute representing the inside status of
the corresponding cell (true for inside cells, false for outside
cells). In order to avoid building too many small objects, it is
recommended to use the predefined constants
Boolean.TRUE
and Boolean.FALSE
tree
- inside/outside BSP tree representing the regionpublic PolyhedronsSet(java.util.Collection<SubHyperplane<Euclidean3D>> boundary)
The boundary is provided as a collection of sub-hyperplanes
. Each sub-hyperplane has the
interior part of the region on its minus side and the exterior on
its plus side.
The boundary elements can be in any order, and can form
several non-connected sets (like for example polyhedrons with holes
or a set of disjoint polyhedrons 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 checkPoint
method will
not be meaningful anymore.
If the boundary is empty, the region will represent the whole space.
boundary
- collection of boundary elements, as a
collection of SubHyperplane
objectspublic PolyhedronsSet(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax)
xMin
- low bound along the x directionxMax
- high bound along the x directionyMin
- low bound along the y directionyMax
- high bound along the y directionzMin
- low bound along the z directionzMax
- high bound along the z directionMethod Detail |
---|
private static BSPTree<Euclidean3D> buildBoundary(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax)
xMin
- low bound along the x directionxMax
- high bound along the x directionyMin
- low bound along the y directionyMax
- high bound along the y directionzMin
- low bound along the z directionzMax
- high bound along the z direction
public PolyhedronsSet buildNew(BSPTree<Euclidean3D> tree)
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
Boolean
attribute representing the inside status of
the corresponding cell (true for inside cells, false for outside
cells). In order to avoid building too many small objects, it is
recommended to use the predefined constants
Boolean.TRUE
and Boolean.FALSE
. The
tree also must have either null internal nodes or
internal nodes representing the boundary as specified in the
getTree
method).
buildNew
in interface Region<Euclidean3D>
buildNew
in class AbstractRegion<Euclidean3D,Euclidean2D>
tree
- inside/outside BSP tree representing the new region
protected void computeGeometricalProperties()
The properties to compute are the barycenter and the size.
computeGeometricalProperties
in class AbstractRegion<Euclidean3D,Euclidean2D>
public SubHyperplane<Euclidean3D> firstIntersection(Vector3D point, Line line)
point
- start point of the part of the line consideredline
- line to consider (contains point)
private SubHyperplane<Euclidean3D> recurseFirstIntersection(BSPTree<Euclidean3D> node, Vector3D point, Line line)
node
- current nodepoint
- start point of the part of the line consideredline
- line to consider (contains point)
private SubHyperplane<Euclidean3D> boundaryFacet(Vector3D point, BSPTree<Euclidean3D> node)
point
- point to checknode
- node containing the boundary facet to check
public PolyhedronsSet rotate(Vector3D center, Rotation rotation)
The instance is not modified, a new instance is created.
center
- rotation centerrotation
- vectorial rotation operator
public PolyhedronsSet translate(Vector3D translation)
The instance is not modified, a new instance is created.
translation
- translation to apply
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |