Interface BoundarySource3D
-
- All Superinterfaces:
BoundarySource<PlaneConvexSubset>
,Linecastable3D
- All Known Subinterfaces:
Mesh<F>
,TriangleMesh
- All Known Implementing Classes:
BoundaryList3D
,ConvexVolume
,Parallelepiped
,RegionBSPTree3D
,SimpleTriangleMesh
public interface BoundarySource3D extends BoundarySource<PlaneConvexSubset>, Linecastable3D
Extension of theBoundarySource
interface for Euclidean 3D space.
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default Bounds3D
getBounds()
Get aBounds3D
object defining the axis-aligned box containing all vertices in the boundaries for this instance.default java.util.List<LinecastPoint3D>
linecast(LineConvexSubset3D subset)
Intersect the given line convex subset against the boundaries in this instance, returning a list of all intersections in order of increasing distance along the line.default LinecastPoint3D
linecastFirst(LineConvexSubset3D subset)
Intersect the given line convex subset against the boundaries in this instance, returning the first intersection found when traveling in the direction of the line subset from its start point.static BoundarySource3D
of(java.util.Collection<PlaneConvexSubset> boundaries)
Return aBoundarySource3D
instance containing the given boundaries.static BoundarySource3D
of(PlaneConvexSubset... boundaries)
Return aBoundarySource3D
instance containing the given boundaries.default BoundaryList3D
toList()
Return aBoundaryList3D
containing the boundaries in this instance.default RegionBSPTree3D
toTree()
Return a BSP tree constructed from the boundaries contained in this instance.default TriangleMesh
toTriangleMesh(org.apache.commons.numbers.core.Precision.DoubleEquivalence precision)
Construct a triangle mesh from the boundaries in this instance.default java.util.stream.Stream<Triangle3D>
triangleStream()
Return the boundaries of this instance as a stream ofTriangle3D
instances.-
Methods inherited from interface org.apache.commons.geometry.core.partitioning.BoundarySource
boundaryStream
-
Methods inherited from interface org.apache.commons.geometry.euclidean.threed.line.Linecastable3D
linecast, linecastFirst
-
-
-
-
Method Detail
-
toList
default BoundaryList3D toList()
Return aBoundaryList3D
containing the boundaries in this instance.- Returns:
- a
BoundaryList3D
containing the boundaries in this instance
-
toTree
default RegionBSPTree3D toTree()
Return a BSP tree constructed from the boundaries contained in this instance. This is a convenience method for quickly constructing BSP trees and may produce unbalanced trees with unacceptable performance characteristics when used with large numbers of boundaries. In these cases, alternate tree construction approaches should be used, such asRegionBSPTree3D.PartitionedRegionBuilder3D
.- Returns:
- a BSP tree constructed from the boundaries in this instance
- See Also:
RegionBSPTree3D.partitionedRegionBuilder()
-
toTriangleMesh
default TriangleMesh toTriangleMesh(org.apache.commons.numbers.core.Precision.DoubleEquivalence precision)
Construct a triangle mesh from the boundaries in this instance.- Parameters:
precision
- precision context used in boundaries generated by the resulting mesh- Returns:
- a triangle mesh representing the boundaries in this instance
- Throws:
java.lang.IllegalStateException
- if any boundary in this boundary source is infinite
-
triangleStream
default java.util.stream.Stream<Triangle3D> triangleStream()
Return the boundaries of this instance as a stream ofTriangle3D
instances. AnIllegalStateException
exception is thrown while reading from the stream if any boundary cannot be converted to a triangle (i.e. if it has infinite size).- Returns:
- a stream of triangles representing the instance boundaries
- See Also:
PlaneSubset.toTriangles()
-
linecast
default java.util.List<LinecastPoint3D> linecast(LineConvexSubset3D subset)
Intersect the given line convex subset against the boundaries in this instance, returning a list of all intersections in order of increasing distance along the line. An empty list is returned if no intersections are discovered.- Specified by:
linecast
in interfaceLinecastable3D
- Parameters:
subset
- line subset to intersect- Returns:
- a list of computed intersections in order of increasing distance along the line
-
linecastFirst
default LinecastPoint3D linecastFirst(LineConvexSubset3D subset)
Intersect the given line convex subset against the boundaries in this instance, returning the first intersection found when traveling in the direction of the line subset from its start point.- Specified by:
linecastFirst
in interfaceLinecastable3D
- Parameters:
subset
- line subset to intersect- Returns:
- the first intersection found or null if no intersection is found
-
getBounds
default Bounds3D getBounds()
Get aBounds3D
object defining the axis-aligned box containing all vertices in the boundaries for this instance. Null is returned if any boundary is infinite or no vertices are found.- Returns:
- the bounding box for this instance or null if no valid bounds could be determined
-
of
static BoundarySource3D of(PlaneConvexSubset... boundaries)
Return aBoundarySource3D
instance containing the given boundaries.- Parameters:
boundaries
- boundaries to include in the boundary source- Returns:
- a boundary source containing the given boundaries
-
of
static BoundarySource3D of(java.util.Collection<PlaneConvexSubset> boundaries)
Return aBoundarySource3D
instance containing the given boundaries. The given collection is used directly as the source of the boundaries; no copy is made.- Parameters:
boundaries
- boundaries to include in the boundary source- Returns:
- a boundary source containing the given boundaries
-
-