Module polygon

Source
Expand description

Simple-polygon triangulation by ear clipping, with hole support.

Orientation is decided by the certified orient2d predicate rather than a raw sign test, so a near-degenerate vertex cannot silently flip a triangle.

Functionsยง

ring_orientation
Orientation of a ring, or None when it encloses no certifiable area.
signed_area2
Twice the signed area of a closed ring. Positive means counter-clockwise.
triangulate_simple
Triangulate a simple CCW polygon by ear clipping.