Class Planes.PlaneRegionExtruder
java.lang.Object
org.apache.commons.geometry.euclidean.threed.Planes.PlaneRegionExtruder
- Enclosing class:
Planes
Class designed to create 3D regions by taking a 2D region and extruding from a base plane
through an extrusion vector. The ends ("top" and "bottom") of the extruded 3D region are flat
while the sides follow the boundaries of the original 2D region.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EmbeddingPlane
Base plane to extrude from.private final boolean
True if the extrusion vector points to the plus side of the base plane.private final Vector3D
Vector to extrude along; the extruded plane is translated from the base plane by this amount.private final org.apache.commons.numbers.core.Precision.DoubleEquivalence
Precision context used to create boundaries. -
Constructor Summary
ConstructorsConstructorDescriptionPlaneRegionExtruder
(EmbeddingPlane basePlane, Vector3D extrusionVector, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Construct a new instance that performs extrusions frombasePlane
alongextrusionVector
. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addEnds
(RegionBSPTree2D subspaceRegion, List<? super PlaneConvexSubset> result) Add the end ("top" and "bottom") of the extruded subspace region to the result list.private void
addSides
(RegionBSPTree2D subspaceRegion, List<? super PlaneConvexSubset> result) Add the side boundaries of the extruded region to the result list.extrude
(RegionBSPTree2D subspaceRegion) Extrude the given 2D BSP tree using the configured base plane and extrusion vector.private ConvexPolygon3D
extrudeSideFinite
(Vector3D startPt, Vector3D endPt) Extrude a single, finite boundary forming one of the sides of the extruded region.private PlaneConvexSubset
extrudeSideInfinite
(LineConvexSubset lineSubset) Extrude a single, infinite boundary forming one of the sides of the extruded region.
-
Field Details
-
basePlane
Base plane to extrude from. -
extrusionVector
Vector to extrude along; the extruded plane is translated from the base plane by this amount. -
extrudingOnPlusSide
private final boolean extrudingOnPlusSideTrue if the extrusion vector points to the plus side of the base plane. -
precision
private final org.apache.commons.numbers.core.Precision.DoubleEquivalence precisionPrecision context used to create boundaries.
-
-
Constructor Details
-
PlaneRegionExtruder
PlaneRegionExtruder(EmbeddingPlane basePlane, Vector3D extrusionVector, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Construct a new instance that performs extrusions frombasePlane
alongextrusionVector
.- Parameters:
basePlane
- base plane to extrude fromextrusionVector
- vector to extrude alongprecision
- precision context used to construct boundaries- Throws:
IllegalArgumentException
- if the given extrusion vector and plane produce regions of zero size
-
-
Method Details
-
extrude
Extrude the given 2D BSP tree using the configured base plane and extrusion vector.- Parameters:
subspaceRegion
- region to extrude- Returns:
- the boundaries of the extruded region
-
addEnds
Add the end ("top" and "bottom") of the extruded subspace region to the result list.- Parameters:
subspaceRegion
- subspace region being extruded.result
- list to add the boundary results to
-
addSides
Add the side boundaries of the extruded region to the result list.- Parameters:
subspaceRegion
- subspace region being extruded.result
- list to add the boundary results to
-
extrudeSideFinite
Extrude a single, finite boundary forming one of the sides of the extruded region.- Parameters:
startPt
- start point of the boundaryendPt
- end point of the boundary- Returns:
- the extruded region side boundary
-
extrudeSideInfinite
Extrude a single, infinite boundary forming one of the sides of the extruded region.- Parameters:
lineSubset
- line subset to extrude- Returns:
- the extruded region side boundary
-