Files
photocraft/crates/engine
kayrockscreenprintingandClaude Opus 5.5 64db46f5ab Puppet Warp: an expansion that empties the mesh is refused, not a panic (#951) (#1410)
With at least one pin, a density or expansion that remeshed to no vertices
panicked in PuppetSolver:🆕 `locate` falls back to vertex 0 when nothing
is closer, and the union-find over an empty mesh indexed it ("index out of
bounds: the len is 0 but the index is 0"). The UI reached it through the
control channel and the options bar's Expansion field (its -50 minimum
empties a 20 px tall bar), and edit.puppetWarp reached it through
puppet_warp, where the dispatch guard caught the panic.

- algo: PuppetSolver::new binds no pins when the mesh has no vertices, and
  puppet_warp returns the source when there are no triangles. With only the
  first change the command erased the layer, since rendering keeps only
  pixels inside the mesh.
- ui-egui: a remesh that leaves no triangles is refused, as `begin` refuses
  a layer without opaque pixels. The previous density, expansion and mesh
  come back. The control channel returns the error; the options bar's
  fields snap back.

Tests in algo, engine and ui-egui follow the issue's fixture and failed with
that panic before the fix.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-10-08 18:28:36 -04:00
..