55. plugins.polygon
— Polygonal facets.¶

class
plugins.polygon.
Polygon
(border, normal=2, holes=[])[source]¶ A Polygon is a flat surface bounded by a closed PolyLine.
The border is specified as a Coords object with shape (nvertex,3) specifying the vertex coordinates in order. While the Coords are 3d, only the first 2 components are used.

nelems
()[source]¶ Return the number of elements in the Geometry.
Returns: int – The number of elements in the Geometry. This is an abstract method that should be reimplemented by the derived class.

externalAngles
()[source]¶ Return the angles between subsequent line segments.
The returned angles are the change in direction between the segment ending at the vertex and the segment leaving. The angles are given in degrees, in the range ]180,180]. The sum of the external angles is always (a multiple of) 360. A convex polygon has all angles of the same sign.

isConvex
()[source]¶ Check if the polygon is convex and turning anticlockwise.
Returns:
 +1 if the Polygon is convex and turning anticlockwise,
 1 if the Polygon is convex, but turning clockwise,
 0 if the Polygon is not convex.

internalAngles
()[source]¶ Return the internal angles.
The returned angles are those between the two line segments at each vertex. The angles are given in degrees, in the range ]180,180]. These angles are the complement of the
