intersection_line_box_xy

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

Compute the intersection between a line and a box in the XY plane.

Parameters
  • line ([point, point] | compas.geometry.Line) – A line defined by two points, with at least XY coordinates.

  • box ([point, point, point, point]) – A box defined by 4 points, with at least XY coordinates.

  • tol (float, optional) – A tolerance value for point comparison.

Returns

tuple[[float, float, 0.0], [float, float, 0.0]] | [float, float, 0.0] | None – Two points if the line goes through the box. One point if the line goes through one of the box vertices only. None otherwise.