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 SummaryModifier and TypeMethodDescriptionclosestPointTo(Vector3d point) Returns the point on this Segment that is closest to the given point.booleanReturns true if the given point lies on this Segment, otherwise returns false.static Segment3dCreates an instance.doubleReturns the minimum distance between this Segment and the given point.doubleReturns the minimum distance between this Segment and the given Segment.doubledistanceSquared(Vector3d point) Returns the square of the minimum distance between this Segment and the given point.doubledistanceSquared(Segment3d other) Returns the square of the minimum distance between this Segment and the given Segment.default booleanequalsWithTolerance(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 doubleReturns the length of this Segment.default doubleReturns 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.booleanintersects(Plane plane) Returns true if this segment intersects the given plane.default booleanintersects(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- 
getStartPointVector3d getStartPoint()Returns the starting point of this Segment.- Returns:
- the starting point of this Segment
- Since:
- 9.10.2
 
- 
getEndPointVector3d getEndPoint()Returns the ending point of this Segment.- Returns:
- the ending point of this Segment
- Since:
- 9.10.2
 
- 
getLengthSquareddefault double getLengthSquared()Returns the square of the length of this Segment.- Returns:
- the square of the length of this Segment
- Since:
- 9.10.2
 
- 
getLengthdefault double getLength()Returns the length of this Segment.- Returns:
- the length of this Segment
- Since:
- 9.10.2
 
- 
distanceSquaredReturns 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
 
- 
distanceReturns 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
 
- 
closestPointToReturns 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
 
- 
distanceSquaredReturns 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
 
- 
distanceReturns 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
 
- 
intersectsReturns 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
 
- 
intersectReturns 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
 
- 
intersectsReturns 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
 
- 
intersectReturns 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
 
- 
containsReturns 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
 
- 
sampleSamples 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
 
- 
equalsWithToleranceReturns 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 Segment
- tolerance- 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
 
- 
shortestSegmentBetweenReturns 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
 
- 
lengthComparatorReturns 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
 
- 
createCreates an instance.- Parameters:
- startPoint- the start point
- endPoint- the end point
- Returns:
- the newly created instance
- Since:
- 9.10.2
 
 
-