Class LinecastPoint3D
java.lang.Object
org.apache.commons.geometry.euclidean.AbstractLinecastPoint<Vector3D,Vector3D.Unit,Line3D>
org.apache.commons.geometry.euclidean.threed.line.LinecastPoint3D
Class representing intersections resulting from linecast operations in Euclidean
3D space. This class contains the intersection point along with the boundary normal
of the target at the point of intersection.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator
<LinecastPoint3D> Comparator that sorts intersection instances by increasing abscissa order. -
Constructor Summary
ConstructorsConstructorDescriptionLinecastPoint3D
(Vector3D point, Vector3D normal, Line3D line) Construct a new instance from its components. -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
containsEq
(LinecastPoint3D pt, List<? extends LinecastPoint3D> list) Return true if the given linecast point is equivalent to any of those in the given list.boolean
eq
(LinecastPoint3D other, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Return true if this instance should be considered equivalent to the argument, using the given precision context for comparison.static void
sortAndFilter
(List<LinecastPoint3D> pts) Sort the given list of linecast points by increasing abscissa value and filter to remove duplicate entries (as determined by theeq(LinecastPoint3D, Precision.DoubleEquivalence)
method).Methods inherited from class org.apache.commons.geometry.euclidean.AbstractLinecastPoint
equals, getAbscissa, getLine, getNormal, getPoint, hashCode, toString
-
Field Details
-
ABSCISSA_ORDER
Comparator that sorts intersection instances by increasing abscissa order. If two abscissa values are equal, the comparison usesVector3D.COORDINATE_ASCENDING_ORDER
with the intersection normals.
-
-
Constructor Details
-
LinecastPoint3D
Construct a new instance from its components.- Parameters:
point
- intersection pointnormal
- normal of the target boundary at the intersection pointline
- intersecting line
-
-
Method Details
-
eq
public boolean eq(LinecastPoint3D other, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Return true if this instance should be considered equivalent to the argument, using the given precision context for comparison. Instances are considered equivalent if they have equivalent points, normals, and lines.- Parameters:
other
- other point to compare withprecision
- context to use for the comparison- Returns:
- true if this instance should be considered equivalent to the argument
-
sortAndFilter
Sort the given list of linecast points by increasing abscissa value and filter to remove duplicate entries (as determined by theeq(LinecastPoint3D, Precision.DoubleEquivalence)
method). The argument is modified.- Parameters:
pts
- list of points to sort and filter
-
containsEq
Return true if the given linecast point is equivalent to any of those in the given list.- Parameters:
pt
- point to testlist
- list to test against- Returns:
- true if the given linecast point is equivalent to any of those in the given list
-