normal_polygon

compas.geometry.normal_polygon(polygon, unitized=True)[source]

Compute the normal of a polygon defined by a sequence of points.

Parameters
  • polygon (sequence[point] | Polygon) – A list of polygon point coordinates.

  • unitized (bool, optional) – If True, unitize the normal vector.

Returns

[float, float, float] – The normal vector.

Raises

AssertionError – If less than three points are provided.

Notes

The points in the list should be unique. For example, the first and last point in the list should not be the same.