mymesh.rays.SegmentSegmentIntersection#

mymesh.rays.SegmentSegmentIntersection(s1, s2, return_intersection=False, endpt_inclusive=True, eps=0)[source]#

Detect intersections between two line segments.

Parameters:
  • s1 (array_like) – Coordinates of the two points of the first line segment (shape=(2,3))

  • s2 (array_like) – Coordinates of the two points of the second line segment (shape=(2,3))

  • return_intersection (bool, optional) – If True, return the coordinates of the intersection point. If no intersection, np.empty((0,3)) is returned. By default False

  • endpt_inclusive (bool, optional) – If True, one end point lying exactly on the other segment will be considered an intersection, by default True

  • eps (int, optional) – Small tolerance parameter, by default 0

Returns:

  • Intersection (bool) – Specifies whether the two line segments intersect

  • pt (np.ndarray, optional) – Point where the two lines intersect, returned if return_intersection=True. If the two lines don’t intersect, np.empty((0,3)) is returned.