You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Preserve shared boundaries when smooth-meshing multi-colour layers #40
When a multi-head layer contains multiple colour groups, Kromacut smooth-meshes each group independently. Each group treats a shared colour boundary as its outside edge and moves its boundary vertices inward, leaving visible gaps between adjacent colours. The gap is part of the generated mesh, so it affects exports as well as the 3D preview.
Adjacent colour regions in the same physical layer must meet exactly, with no gaps, overlap, duplicate boundary faces, or non-manifold edges. The outer silhouette should still benefit from smooth meshing.
Intended solution
Implement colour-aware smooth topology for a whole layer:
Build one shared boundary and vertex field from the full labelled colour grid.
Reuse the same boundary vertices at interfaces between colour groups.
Assign faces/materials to their colour group without moving each side of an interface independently.
Add topology and regression tests for side-by-side and corner-contacting multi-colour regions.
Scope
This should be a proper shared-topology solution. Do not solve it by silently falling back to greedy meshing for multi-colour layers.
The solution described here shipped in Kromacut 4.2.0 for Flat Paint (#88). Flat Paint is currently the only place main builds layers that hold several colors side by side.
createFlatPaintMesher in src/lib/flatPaintMeshing.ts builds one shared boundary and vertex field from the full labelled color grid. Neighboring colors and the carrier reuse the same boundary vertices instead of each side moving independently.
Diagonal corner contacts get a small shared join, so regions neither gap nor overlap.
tests/flatPaintMeshing.test.ts checks closed topology for every smoothing strength, side-by-side and corner-contacting regions, multi-color junctions, and vertex precision at slicer coordinates.
The original report came from the multi-head work in #38. When #38 is brought up to date with develop, its mixed-color layers should go through this mesher rather than smoothing each color group separately.
Closing as completed. If multi-head layers still show gaps after switching to the shared mesher, please reopen with a repro.
Activity
vycdev commentedon Oct 19, 2026
The solution described here shipped in Kromacut 4.2.0 for Flat Paint (#88). Flat Paint is currently the only place
mainbuilds layers that hold several colors side by side.createFlatPaintMesherinsrc/lib/flatPaintMeshing.tsbuilds one shared boundary and vertex field from the full labelled color grid. Neighboring colors and the carrier reuse the same boundary vertices instead of each side moving independently.tests/flatPaintMeshing.test.tschecks closed topology for every smoothing strength, side-by-side and corner-contacting regions, multi-color junctions, and vertex precision at slicer coordinates.The original report came from the multi-head work in #38. When #38 is brought up to date with
develop, its mixed-color layers should go through this mesher rather than smoothing each color group separately.Closing as completed. If multi-head layers still show gaps after switching to the shared mesher, please reopen with a repro.
Claude Opus 5.5 answering on behalf of vycdev.
Generated by Claude Code