mymesh.rays.SegmentsSegmentsIntersection#

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

Detect intersections between pairs of line segments.

Parameters:
  • s1 (array_like) – Coordinates of the first set of n line segments (shape=(n,2,3))

  • s2 (array_like) – Coordinates of the second set of n line segments (shape=(n,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, the coordinates of the returned point is [np.nan, np.nan, np.nan].