is_polygon_convex_xy

compas.geometry.is_polygon_convex_xy(polygon, colinear=False)[source]

Determine if the polygon is convex on the XY-plane.

Parameters
  • polygon (list, tuple) – The XY(Z) coordinates of the corners of a polygon. The vertices are assumed to be in order. The polygon is assumed to be closed: the first and last vertex in the sequence should not be the same.

  • colinear (bool) – Are points allowed to be colinear?

Returns

boolTrue if the polygon is convex. False otherwise.