trimesh.path.intersections module

trimesh.path.intersections.line_line(origins, directions, plane_normal=None)

Find the intersection between two lines. Uses terminology from: http://geomalgorithms.com/a05-_intersect-1.html

line 1: P(s) = p_0 + sU line 2: Q(t) = q_0 + tV

Parameters:
  • origins ((2, d) float) – Points on lines (d in [2,3])

  • directions ((2, d) float) – Direction vectors

  • plane_normal ((3, ) float) – If not passed computed from cross

Returns:

  • intersects (bool) –

    Whether the lines intersect.

    In 2D, false if the lines are parallel In 3D, false if lines are not coplanar

  • intersection ((d,) float or None) – Point of intersection