is_intersection_segment_segment_xy

compas.geometry.is_intersection_segment_segment_xy(ab, cd)[source]

Determines if two segments, ab and cd, intersect.

Parameters
  • ab ([point, point] | compas.geometry.Line) – Two points representing the start and end points of a segment. Z coordinates will be ignored.

  • cd ([point, point] | compas.geometry.Line) – Two points representing the start and end points of a segment. Z coordinates will be ignored.

Returns

bool – True if the segments intersect. False otherwise.

Notes

The segments intersect if both of the following conditions are true:

  • c is on the left of ab, and d is on the right, or vice versa.

  • d is on the left of ac, and on the right of bc, or vice versa.