Skip to main content

Module validate

Module validate 

Source
Expand description

Ring-geometry validation, which finds where assembled rings self-cross, overlap themselves collinearly, self-touch, or collapse entirely. It is shared by the utz_dev_cli quant-clean report and the viewer’s live problems panel (wasm.rs), so both agree on what “problematic geometry” means.

Structs§

Bad
Loc
One located defect, in quantized grid units (see Bad::locs).
Problem
A surviving defect of one feature’s geometry, in degrees. This is what the viewer’s problems panel lists.

Enums§

Kind

Functions§

find_problems
Runs the encoder’s quantize, clean, and drop-degenerate pipeline on already-simplified arcs at qbits, then locates every surviving crossing/overlap. A spot on a shared border is reported once per owning ring (dedupe by coordinates for display).
measure
Sweeps every ring and tallies the problems: self-crossings, collinear overlaps, self-touches, and degenerate rings.
ring_bad
Counts the non-adjacent segment pairs of one ring that intersect, split by kind. The sweep runs over min-x-sorted segments in O(n log n + pairs-in-x-overlap), which is fine at report scale. Crossing/overlap spots land in bad.locs.