Expand description
Generic 2-D polygon area, containment and triangulation — no topology
or rendering dependency, so it
lives here rather than in geop-core-rasterize: geop-core-topology’s
own edit code (splice_edge_into_face’s loop-orientation check) needs
it too, and topology sits below rasterize in the dependency order.
Structs§
- Convex
- A convex polygon, as the half-planes it is the intersection of: each an
outward normal
nand an offsetc, the polygon lying wheren · p ≤ c. What a box drawn on screen covers of a plane it looks at.
Functions§
- ear_
clip - Ear-clip a (possibly non-convex) simple polygon into triangles, as
index triples into
poly:n - 2of them forn >= 3corners, none for fewer. Plain numbers, for rendering: a corner that rounding leaves no ear at is cut off all the same. - polygon_
signed_ area - Signed area of
poly(positive for CCW, negative for CW). - polygons_
contain - Whether
plies inside the closed polylinesloops, outer boundaries and holes alike: an odd number of crossings of a ray frompalong+x. Only crossings that definitely happen count, so apwhose ray could graze a corner is decided as if it did not.