Class BoundarySourceLinecaster3D
java.lang.Object
org.apache.commons.geometry.euclidean.threed.BoundarySourceLinecaster3D
- All Implemented Interfaces:
Linecastable3D
Class that performs linecast operations against arbitrary
BoundarySource3D
instances. This class performs a brute-force computation of the intersections of the
line or line convex subset against all boundaries. Some data structures may support more
efficient algorithms and should therefore prefer those instead.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BoundarySource3D
The boundary source instance providing boundaries for the linecast operation. -
Constructor Summary
ConstructorsConstructorDescriptionBoundarySourceLinecaster3D
(BoundarySource3D boundarySrc) Construct a new instance for linecasting against the given boundary source. -
Method Summary
Modifier and TypeMethodDescriptionprivate LinecastPoint3D
computeIntersection
(PlaneConvexSubset planeSubset, LineConvexSubset3D lineSubset) Compute the intersection between a boundary plane subset and line subset.private Stream
<LinecastPoint3D> Return a stream containing intersections between the boundary source and the given line convex subset.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.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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.commons.geometry.euclidean.threed.line.Linecastable3D
linecast, linecastFirst
-
Field Details
-
boundarySrc
The boundary source instance providing boundaries for the linecast operation.
-
-
Constructor Details
-
BoundarySourceLinecaster3D
BoundarySourceLinecaster3D(BoundarySource3D boundarySrc) Construct a new instance for linecasting against the given boundary source.- Parameters:
boundarySrc
- boundary source to linecast against.
-
-
Method Details
-
linecast
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
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
-
getIntersectionStream
Return a stream containing intersections between the boundary source and the given line convex subset.- Parameters:
subset
- line subset to intersect- Returns:
- a stream containing linecast intersections
-
computeIntersection
private LinecastPoint3D computeIntersection(PlaneConvexSubset planeSubset, LineConvexSubset3D lineSubset) Compute the intersection between a boundary plane subset and line subset. Null is returned if no intersection is discovered.- Parameters:
planeSubset
- plane subset from the boundary sourcelineSubset
- line subset to intersect with- Returns:
- the linecast intersection between the two arguments or null if there is no such intersection
-