Skip to content

Add overlap-aware preprocessingAutoJoin to union multi-mesh models before slicing#194

Draft
jgphilpott with Copilot wants to merge 5 commits into
mainfrom
copilot/fix-overlapping-meshes
Draft

Add overlap-aware preprocessingAutoJoin to union multi-mesh models before slicing#194
jgphilpott with Copilot wants to merge 5 commits into
mainfrom
copilot/fix-overlapping-meshes

Conversation

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Slicing multi-mesh designs (e.g. overlapping STL parts) was treating each mesh independently, producing interior wall paths through the model. This change adds an optional preprocessing join step that unions overlapping meshes into one printable solid before layer generation.

  • Configuration surface

    • Added preprocessingAutoJoin (default false) to Polyslice options.
    • Added accessor wiring:
      • getPreprocessingAutoJoin()
      • setPreprocessingAutoJoin(enabled)
  • Preprocessing pipeline

    • Added extractMeshes(scene) to collect all mesh nodes from scene/group hierarchies.
    • Added hasOverlappingMeshes(meshes) using world-space bounding-box intersection checks.
    • Added autoJoinOverlappingMeshes(meshes):
      • unions overlapping meshes synchronously via Polytree.unite(..., false)
      • preserves current behavior when no overlap is detected
      • safely falls back to the first mesh if union fails
  • Slice integration

    • Updated slice entry flow to use extractMeshes(...).
    • When preprocessingAutoJoin is enabled, slicing now attempts overlap-aware union before existing mesh preprocessing and layer slicing.
  • Docs and benchmark usage

    • Updated API/preprocessing docs to describe preprocessingAutoJoin.
    • Updated piggy benchmark script to enable auto-join for overlapping-source models.
const slicer = new Polyslice({
  // existing options...
  preprocessingAutoJoin: true
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants