trimesh.path.intersections

Functions

line_line(origins, directions[, plane_normal])

Find the intersection between two lines.

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 (boolean, whether the lines intersect.) – In 2D, false if the lines are parallel In 3D, false if lines are not coplanar

  • intersection (if intersects: (d) length point of intersection) – else: None