intersection_line_triangle

compas.geometry.intersection_line_triangle(line, triangle, tol=1e-06)[source]

Computes the intersection point of a line (ray) and a triangle based on the Moeller Trumbore intersection algorithm

Parameters
  • line ([point, point] | compas.geometry.Line) – Two points defining the line.

  • triangle ([point, point, point]) – XYZ coordinates of the triangle corners.

  • tol (float, optional) – A tolerance for membership verification.

Returns

[float, float, float] | None – The intersection point between the line and the triangle, or None if the line and the plane are parallel.