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 (sequence[point] | compas.geometry.Polygon) – 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, optional) – Are points allowed to be colinear?

Returns

bool – True if the polygon is convex. False otherwise.