Package com.solibri.geometry.primitive3d
Interface Segment3d
- All Known Subinterfaces:
MSegment3d
public interface Segment3d
Read-only interface for handling segments in 3-dimensional space.
- Since:
- 9.10.2
-
Method Summary
Modifier and TypeMethodDescriptionclosestPointTo
(Vector3d point) Returns the point on this Segment that is closest to the given point.boolean
Returns true if the given point lies on this Segment, otherwise returns false.static Segment3d
Creates an instance.double
Returns the minimum distance between this Segment and the given point.double
Returns 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.double
distanceSquared
(Segment3d other) Returns the square of the minimum distance between this Segment and the given Segment.default boolean
equalsWithTolerance
(Segment3d other, double tolerance) Returns true if the ends of this Segment match the ends of Segment other within tolerance.Returns the ending point of this Segment.default double
Returns the length of this Segment.default double
Returns the square of the length of this Segment.Returns the starting point of this Segment.Returns the point of intersection between this Segment and the given plane.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>
Returns a comparator that compares non-null Segments by their length.sample
(int amount) Samples the given amount of points from the segment.shortestSegmentBetween
(Segment3d otherSegment) Returns the shortest segment from this Segment to Segment b.
-
Method Details
-
getStartPoint
Vector3d getStartPoint()Returns the starting point of this Segment.- Returns:
- the starting point of this Segment
- Since:
- 9.10.2
-
getEndPoint
Vector3d getEndPoint()Returns the ending point of this Segment.- Returns:
- the ending point of this Segment
- Since:
- 9.10.2
-
getLengthSquared
default double getLengthSquared()Returns the square of the length of this Segment.- Returns:
- the square of the length of this Segment
- Since:
- 9.10.2
-
getLength
default double getLength()Returns the length of this Segment.- Returns:
- the length of this Segment
- Since:
- 9.10.2
-
distanceSquared
Returns the square of the minimum distance between this Segment and the given point.- Parameters:
point
- the point for which the square of the distance to this Segment is computed- Returns:
- the square of the minimum distance between this Segment and the given point
- Since:
- 9.10.2
-
distance
Returns the minimum distance between this Segment and the given point.- Parameters:
point
- the point for which the distance to this Segment is computed- Returns:
- the minimum distance between this Segment and the given point
- Since:
- 9.10.2
-
closestPointTo
Returns the point on this Segment that is closest to the given point.- Parameters:
point
- the point for which closest point on this Segment is computed.- Returns:
- the point on this Segment that is closest to the given point
- Since:
- 9.10.2
-
distanceSquared
Returns the square of the minimum distance between this Segment and the given Segment.- Parameters:
other
- the Segment for which the square of the distance to this Segment is computed- Returns:
- the square of the minimum distance between this Segment and the given Segment
- Since:
- 9.10.2
-
distance
Returns the minimum distance between this Segment and the given Segment.- Parameters:
other
- the Segment for which the distance to this Segment is computed- Returns:
- the minimum distance between this Segment and the given Segment
- Since:
- 9.10.2
-
intersects
Returns true if this Segment intersects the given Segment, otherwise returns false.- Parameters:
other
- the Segment with which intersection is checked- Returns:
- true if this Segment intersects the given Segment, otherwise returns false
- Since:
- 9.10.2
-
intersect
Returns the intersection point of this and other Segment. If the two Segment instances do not intersect, then the return value is null. Theintersects(com.solibri.geometry.primitive3d.Segment3d)
method can be used to check if this Segment intersects another Segment.- Parameters:
other
- the Segment with which intersection point is computed- Returns:
- an optional that contains the intersection point of this and other Segment if it exists or empty if no intersection is found
- Since:
- 9.10.2
-
intersects
Returns true if this segment intersects the given plane.- Parameters:
plane
- the plane with which the intersection is checked- Returns:
- true if this segment intersects the given plane
- Since:
- 9.10.2
-
intersect
Returns the point of intersection between this Segment and the given plane. If this Segment does not intersect the plane, then returns empty.- Parameters:
plane
- the plane with which the intersection is computed- Returns:
- an optional that contains the point of intersection if it exists or an empty optional otherwise
- Since:
- 9.10.2
-
contains
Returns true if the given point lies on this Segment, otherwise returns false.- Parameters:
point
- the point for which the check is performed- Returns:
- true if the given point lies on this Segment, otherwise returns false
- Since:
- 9.10.2
-
sample
Samples the given amount of points from the segment. The start and end point are not included in the sample. If an amount of zero or less is given, an empty list is returned.- Parameters:
amount
- the amount of samples- Returns:
- the samples as a list from start point towards the end point
-
equalsWithTolerance
Returns true if the ends of this Segment match the ends of Segment other within tolerance. Otherwise returns false.- Parameters:
other
- the Segment that is checked for matching with this Segmenttolerance
- the tolerance used in checking- Returns:
- true if the ends of this Segment are within distance of tolerance to the ends of Segment other
- Since:
- 9.10.2
-
shortestSegmentBetween
Returns the shortest segment from this Segment to Segment b. The returned Segment is not unique if the given Segment instances are parallel. If the given segments intersect, then the start and end points of the returned Segment will be equal.- Parameters:
otherSegment
- the target segment for the returned Segment- Returns:
- the shortest segment between the given segments, such that the start point is on this Segment and the end point is on the Segment b
- Since:
- 9.10.2
-
lengthComparator
Returns a comparator that compares non-null Segments by their length. The longer segment is considered to be greater in the ordering defined by the comparator returned by this method. This can be used for sorting Segments by length.- Returns:
- comparator that compares segments by length
- Since:
- 9.10.2
-
create
Creates an instance.- Parameters:
startPoint
- the start pointendPoint
- the end point- Returns:
- the newly created instance
- Since:
- 9.10.2
-