FA-70583 / GIS polygon topology / Member archive
Grid snapping with ring collapse handling: hole collapse policy · case 03
A polygon disappears because one tiny hole collapsed.
Case contract
Input [rings, g]: polygon rings (exterior first), closed, numeric coordinates; grid size g > 0 anchored at 0. Each coordinate snaps to floor(v/g + 0.5)*g (halves round toward +infinity). Consecutive identical snapped positions are merged. A ring left with fewer than 4 positions has collapsed: if it is the exterior return None, otherwise drop that hole. Return the snapped rings.
Why this case matters
Precision reduction for storage, tiling and topology cleaning snaps vertices to a grid; collapse rules decide whether tiny holes vanish or the polygon is discarded.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression #6 | null | [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]]] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗