openGrid: add Stack_Output so the interface layers can be exported separately - #137
Open
TheFou wants to merge 1 commit into
Open
openGrid: add Stack_Output so the interface layers can be exported separately#137TheFou wants to merge 1 commit into
TheFou wants to merge 1 commit into
Conversation
…parately Interface Separation defaults to 0.1, which leaves the plates and the interface layers as separate bodies. Setting it to 0 - which is what you want when the interface is meant to be printed directly onto the plate - makes their faces coplanar, so OpenSCAD's implicit top-level union welds the whole stack into a single solid. color() is preview-only and does not survive that, so the slicer receives one body and there is nothing left to assign a second filament to. Stack_Output lets the two groups be generated separately (Plates Only / Interface Layers Only) and loaded together in the slicer as one object with several parts. It defaults to All, and the output is then byte-for-byte identical to before for every board type and stack count. This matters most on the MakerWorld customizer, which cannot pass OpenSCAD command-line flags: a 3MF generated there contains a single object with a single part on extruder 1 and no colour data in the mesh, so generating twice is the only route. On desktop OpenSCAD, exporting 3MF with lazy-union enabled already yields two objects and Stack_Output can stay on All. Also documents the whole workflow in the file header, including the slicer-side "interface shells" setting needed to get solid layers at the material boundary. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Interface_Separationdefaults to 0.1, which leaves the plates and the interface layers as separate bodies in the export. Setting it to 0 — which is what you want when the interface is meant to be printed directly onto the plate, with no dead layer in between — makes their faces coplanar, so OpenSCAD's implicit top-level union welds the whole stack into a single solid.color()is preview-only and does not survive that. The slicer then receives one body, and there is nothing left to assign a second filament to.Measured on Full,
Stack_Count = 3, STL export:Interface_SeparationStack_OutputStack_Outputlets the two groups be generated separately and loaded back together in the slicer as one object with several parts, which preserves their absolute Z positions.Why not just rely on lazy-union
On desktop OpenSCAD, exporting 3MF with
lazy-unionenabled already gives two objects (all the plates, and all the interface layers) even at separation 0, andStack_Outputcan stay onAll. That is documented in the header note as the preferred desktop route.But it is not available everywhere, and in particular not on the MakerWorld customizer, which cannot pass OpenSCAD command-line flags. I checked a 3MF actually generated by the site for this model (Full,
Stack_Count2,Interface_Separation0,Interface_Thickness0.4):extruder = 1#FF0000FFSo PMM does carry the red of
color("red")into the slicing profile palette, but the geometry still comes out as a single part on extruder 1 — the palette follows, the assignment does not. Generating twice is the only route there.Backwards compatibility
Stack_Outputdefaults toAll, and with that default the output is byte-for-byte identical tomainfor all three board types atStack_Count2 and 3. It also has no effect atStack_Count = 1.Also in this change
A header note documenting the whole workflow, including the slicer-side setting people otherwise get stuck on: because the parts touch, the slicer sees no free surface between them and keeps extruding infill straight through the boundary. Enabling interface shells (Print Settings → Multimaterial → Advanced in OrcaSlicer 2.3+) forces solid shells between adjacent materials.
Repro
On
mainthis is a single connected body. With this change andStack_Output="Plates Only"/"Interface Layers Only"it is 3 and 2 bodies respectively.Validation
mainfor Full, Lite and Heavy atStack_Count2 and 3, and no effect atStack_Count = 1.--backend=Manifoldand--backend=CGALagree on body count, z ranges and volume for everyStack_Outputvalue.Stack_Outputvalues × separation 0 and 0.1, plus Ironing mode, a 1×1 board, and Fill Space) all render without errors and produce non-empty geometry.Note on merge order
This touches the same
if (Stacking_Method == "Interface Layer")lines as #136, so whichever merges second will need a trivial conflict resolution on those few lines. The two changes are otherwise independent and either can be taken alone.🤖 Generated with Claude Code