Skip to content

Preserve shared boundaries when smooth-meshing multi-colour layers #40

Description

@vycdev

Problem

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.

Reported during PR #38: #38 (comment)

Expected behaviour

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:

  1. Build one shared boundary and vertex field from the full labelled colour grid.
  2. Reuse the same boundary vertices at interfaces between colour groups.
  3. Assign faces/materials to their colour group without moving each side of an interface independently.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions