mirror of
https://github.com/felt/tippecanoe.git
synced 2026-12-05 06:41:41 +01:00
With consistent snapping, edges are snapped to every hot pixel they touch, including those whose corners they only touch. But with closed pixels, an edge passing diagonally through a lattice point touches the corners of the two pixels beside it as well, and is snapped into a zigzag through all four. Two edges from different polygons that cross at a pixel corner zigzag through the same pixels in different orders, and the zigzags cross each other. (In Dane County tile 10/258/376, this left a quarter-pixel gap and a quarter-pixel overlap between two blocks on either side of a sliver.) Hobby's snap rounding, whose guarantee that snapped edges don't cross is what makes snapping to a common set of hot pixels work, uses half-open pixels, [x - 0.5, x + 0.5) by [y - 0.5, y + 0.5), consistent with rounding halves up, which is how wagyu rounds intersection points. So when snapping to a common set of hot pixels, find the range of pixels an edge passes through in each row that way, so that a point on a pixel boundary belongs to only one pixel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CQ6vQUJtmGZnqz7RmVYQaJ