mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-25 02:07:09 -06:00
After linesweeper 0.5 (#1028 on main), uniting the faces of a grid of lines could split the merged strip again even with their corners shared exactly: a sweep over seven or more faces moved shared vertices by about 1e-6 (within its eps) and the edges between faces no longer cancelled. Faces cut by open paths now merge like closed shapes' faces already do (FaceMerger::exact): in the planar map itself. build() is split into map() (the graph and its faces) and build(); Map::merge traces the boundary of the picked faces along the map's own edges, dropping the edges between two picked faces and the loose ends inside them, so no sweep runs on the result. FaceMerger finds each face again by a point inside it, checks the area, and keeps the boolean union as a fallback. Tests: the regression test merges through FaceMerger; a grid test covers a ring with its hole, cells touching at a corner, a loose end, and that the map path (not the fallback) produced the result. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>