public interface Segment3d
Modifier and Type | Method and Description |
---|---|
MVector3d |
closestPointTo(Vector3d point)
Returns the point on this Segment that is closest to the given point.
|
boolean |
contains(Vector3d point)
Returns true if the given point lies on this Segment, otherwise returns
false.
|
static Segment3d |
create(Vector3d startPoint,
Vector3d endPoint)
Creates an instance.
|
double |
distance(Segment3d other)
Returns the minimum distance between this Segment and the given Segment.
|
double |
distance(Vector3d point)
Returns the minimum distance between this Segment and the given point.
|
double |
distanceSquared(Segment3d other)
Returns the square of the minimum distance between this Segment and the
given Segment.
|
double |
distanceSquared(Vector3d point)
Returns the square of the minimum distance between this Segment and the
given point.
|
default boolean |
equalsWithTolerance(Segment3d other,
double tolerance)
Returns true if the ends of this Segment match the ends of Segment other
within tolerance.
|
Vector3d |
getEndPoint()
Returns the ending point of this Segment.
|
default double |
getLength()
Returns the length of this Segment.
|
default double |
getLengthSquared()
Returns the square of the length of this Segment.
|
Vector3d |
getStartPoint()
Returns the starting point of this Segment.
|
Optional<MVector3d> |
intersect(Plane plane)
Returns the point of intersection between this Segment and the given plane.
|
Optional<MVector3d> |
intersect(Segment3d other)
Returns the intersection point of this and other Segment.
|
boolean |
intersects(Plane plane)
Returns true if this segment intersects the given plane.
|
default boolean |
intersects(Segment3d other)
Returns true if this Segment intersects the given Segment, otherwise
returns false.
|
static Comparator<Segment3d> |
lengthComparator()
Returns a comparator that compares non-null Segments by their length.
|
default List<MVector3d> |
sample(int amount)
Samples the given amount of points from the segment.
|
MSegment3d |
shortestSegmentBetween(Segment3d otherSegment)
Returns the shortest segment from this Segment to Segment b.
|
Vector3d getStartPoint()
Vector3d getEndPoint()
default double getLengthSquared()
default double getLength()
double distanceSquared(Vector3d point)
point
- the point for which the square of the distance to this
Segment is computeddouble distance(Vector3d point)
point
- the point for which the distance to this Segment is computedMVector3d closestPointTo(Vector3d point)
point
- the point for which closest point on this Segment is
computed.double distanceSquared(Segment3d other)
other
- the Segment for which the square of the distance to this
Segment is computeddouble distance(Segment3d other)
other
- the Segment for which the distance to this Segment is
computeddefault boolean intersects(Segment3d other)
other
- the Segment with which intersection is checkedOptional<MVector3d> intersect(Segment3d other)
intersects
method can be used to check if this Segment intersects
another Segment.other
- the Segment with which intersection point is computedboolean intersects(Plane plane)
plane
- the plane with which the intersection is checkedOptional<MVector3d> intersect(Plane plane)
plane
- the plane with which the intersection is computedboolean contains(Vector3d point)
point
- the point for which the check is performeddefault List<MVector3d> sample(int amount)
amount
- the amount of samplesdefault boolean equalsWithTolerance(Segment3d other, double tolerance)
other
- the Segment that is checked for matching with this Segmenttolerance
- the tolerance used in checkingMSegment3d shortestSegmentBetween(Segment3d otherSegment)
otherSegment
- the target segment for the returned Segmentstatic Comparator<Segment3d> lengthComparator()
Copyright © 2019 Solibri, Inc.. All rights reserved.