Expand description
Post-quantization cleanup of the shared arcs. Snapping arc vertices to a coarse grid (especially i16, ~611 m cells) collapses nearby vertices and folds thin features onto themselves, leaving consecutive duplicates, zero-area spurs where the path reverses over itself (“spikes”), and rings whose area vanishes entirely. Left in, the spurs self-overlap and flip the runtime’s even-odd PIP parity inside the fold.
Every fix runs on the shared arcs (or drops whole rings), never on one polygon in isolation, so neighbouring zones stay stitched by construction; cleaning a border cleans it identically for both owners.
Structs§
Functions§
- clean_
arc - Removes quantization artifacts from one quantized arc, in place.
- drop_
degenerate_ rings - Drops rings that quantization collapsed to zero area: a degenerate hole
vanishes alone, and a degenerate exterior takes its holes with it. Arcs
that no surviving ring references are removed, and their ids are
compacted. Returns the
filtered
(ring_refs, structure, arcs)mirroringTopology’s fields. Dropping a zero-area ring can’t open a crack with a neighbour: there was no area to disagree about. - ring_
coords_ q - Assembles one ring’s quantized coords from its signed arc refs, the
integer twin of
Topology::reconstruct()’s ring assembly. - ring_
degenerate - Reports whether the ring collapsed under quantization: fewer than 3 vertices remain, or the shoelace area is exactly 0 with no proper self-crossing. The crossing exemption matters: a bowtie with equal opposite lobes has signed area 0 yet still covers both lobes under the runtime’s even-odd rule. Dropping it would lose real coverage. The computation is exact in i128 for all qbits.
Type Aliases§
- Cleaned
Topo - The
(ring_refs, structure, arcs)triple mirroringTopology’s fields, with arcs quantized to integer coordinates.