Only skip corner-touching hot pixels for edges without intersections

The previous change, which stopped wagyu from snapping an edge to a hot
pixel whose corner it only touches, made two of upstream wagyu's 3320
geometry fixtures produce spikes. When an intersection lies exactly on a
pixel corner, it is rounded to that pixel, and the edges that intersect
there must be snapped to it; and once an edge has been snapped to one hot
pixel, its new segments may pass through the interior of another hot pixel
whose corner the original edge only touched.

So now the inward rounding of the hot pixel range only applies to an edge
that intersects no other edge (which is recorded while the hot pixels are
built), and never to a hot pixel that is the rounded location of an
intersection (which are now kept in a separate sorted list). Edges that are
part of intersections are snapped exactly as before. With this, upstream
wagyu's unit tests and all 3320 of its geometry fixtures pass, and the
narrow diagonal Census block in Dane County is still preserved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CQ6vQUJtmGZnqz7RmVYQaJ
This commit is contained in:
Claude
2026-11-30 22:27:53 +00:00
parent 1b17becfa3
commit 5b35e5dacf
11 changed files with 102 additions and 43 deletions
+8 -6
View File
@@ -22,12 +22,14 @@
part with open space on its far side, like a coastal strip, is still kept.
Since strips are only needed for edges that are already known to be narrow,
the shared edges are only looked up for those, not for every vertex.
* Fix Wagyu's snap rounding so that an edge that only touches the corner of
a pixel containing a vertex is no longer treated as passing through that
pixel. Previously, two parallel 45-degree edges one tile unit apart were
each snapped to the other's vertices, so a perfectly valid diagonal polygon
one unit wide collapsed to nothing during cleaning, leaving gaps between
the features on either side of it.
* Fix Wagyu's snap rounding so that an edge that intersects no other edge
is no longer snapped to a hot pixel whose corner it only touches, unless
that hot pixel is the rounded location of an intersection. Previously, two
parallel 45-degree edges one tile unit apart were each snapped to the
other's vertices, so a perfectly valid diagonal polygon one unit wide
collapsed to nothing during cleaning, leaving gaps between the features on
either side of it. Edges that do intersect others are snapped as before,
which is needed to keep the result free of spikes.
# 2.82.0