mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-30 17:05:35 -05:00
2c91bfe0d3be767fc965185fffdbcf2c4530e73e
890
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
557feba649 |
feat: introduce plugin APIs for mutable presets (#16518)
* feat: introduce plugin APIs for mutable presets * fix: tests * fix: tests * doc: HLSD for preset plugin APIs * feat: preset APIs * fix: remove async behavior and clang-tidy * fix: update demo plugins |
||
|
|
f92f75e0fa |
Feat: Add multiple and 3D bed exclusion volumes (#13777)
# Description This PR adds opt-in, height-aware exclusion volumes to OrcaSlicer, including multi-nozzle handling, object and generated-geometry validation, final G-code collision checking, and travel rerouting. It grew from the original object-placement prototype into a collision-aware slicing pipeline with documented limitations. The central compatibility decision is that Orca's existing `bed_exclude_area` keeps its historical meaning, while the new `bed_exclude_volumes` setting explicitly enables the stronger collision-aware behavior. <img width="935" height="707" alt="Travel paths routed around exclusion volumes" src="https://github.com/user-attachments/assets/22925e5c-a3b1-4c26-be1a-8a89d9970cb5" /> Related issues: #5922, #10579, #10638 and #12774. ## Why this is useful The existing 2D exclusion area prevents object placement in areas such as the filament-cutter corner on Bambu printers. It cannot describe low bed clips, raised tool docks, camera arms, flying-gantry hardware, or other obstacles that occupy only part of the printer's Z range. Treating every existing area as a physical motion obstacle would also be unsafe for compatibility: some printers deliberately move into their excluded material area. This PR therefore separates the two concepts rather than changing the meaning of existing profiles. | Setting | Purpose | Existing motion affected? | | --- | --- | --- | | `bed_exclude_area` | Existing bed-fixed material/placement keep-out | No G-code checking or travel rerouting | | `bed_exclude_volumes` | Shared 3D collision volumes | Object/generated-material checks, G-code validation and travel rerouting | | `extruder_bed_exclude_volumes` | Per-extruder 3D collision volumes | Same collision behavior, resolved for the active physical nozzle | Bed areas and collision volumes are additive. A printer can retain an existing cutter/material keep-out while adding separate physical collision volumes. Belt printers retain the existing projection of bed areas onto the tilted belt surface; collision volumes remain in model coordinates. ## Configuration and syntax `bed_exclude_volumes` accepts one or more polygonal prisms: ```text XxY,XxY,... ``` defines a full-height collision volume. ```text REGION|REGION|REGION ``` defines multiple independent volumes. ```text ZMIN..ZMAX;XxY,XxY,... ``` defines a volume active only across that Z range. Either Z bound may be omitted: ```text ..10;20x20,40x20,40x40,20x40 30..;20x20,40x20,40x40,20x40 ``` For example: ```text 20x0,45x0,45x18,20x18|8..22;115x20,145x20,145x48,115x48 ``` defines one full-height volume and one volume active from Z=8 mm to Z=22 mm. Z ranges are validated and clamped against the configured printable height, and decimal parsing is locale-independent. The CLI exposes the same distinction: ```text --bed-exclude-area --bed-exclude-volumes ``` Existing scripts using `--bed-exclude-area` retain the original polygon format and behavior. ## Backward compatibility and migration - Existing profiles and projects using only `bed_exclude_area` keep its material/placement keep-out meaning; they do not implicitly enable collision-volume checking or travel rerouting. - Stock printer motion is not checked or rerouted against bed areas. This is important for machines that deliberately enter an excluded material area during cutting or loading. - The new syntax is stored under separate config keys, so an older Orca build does not try to deserialize a volumetric string as the existing point-list option. - In **Printer settings → Basic information → Printable space**, **Excluded bed area** remains a normal editable field with Orca's standard reset controls. **Toolhead collision volumes** is a separate field directly below it. There is no Convert/Copy button and neither setting clears the other. - A bed-area polygon can be manually copied into the collision-volume field to describe a full-height physical obstacle. Pasting volume syntax into the bed-area field instead prompts for confirmation before adding it to the appropriate volume definitions. The saved bed area, existing volumes and selected nozzle mode are preserved; cancelling leaves them unchanged. - If a user does not configure the new volume keys, the new G-code checker, rerouter, support trimming and nozzle-specific brim behavior remain inactive. This gives existing profiles a stable compatibility boundary while allowing users and maintainers to migrate deliberately to full collision checking over time. ## Multi-nozzle behavior For multi-nozzle printers, the collision-volume mode selects one of three behaviours. In individual mode, each extruder's definition is edited on its own Extruder settings page. These modes apply only to collision volumes; the excluded bed area stays shared and bed-fixed. Collision volumes support three modes: <img width="549" height="441" alt="Exclusion volume behavior selector" src="https://github.com/user-attachments/assets/6ca8c2e2-d00e-4b32-9b12-bfbff0928966" /> ### Shared Every physical nozzle uses the same collision-volume definition. <img width="2353" height="1633" alt="Shared exclusion volumes" src="https://github.com/user-attachments/assets/96fe938b-07b4-4cd9-b587-e31f2ebba5f8" /> ### Toolhead-relative (nozzle offsets) The shared definition is treated as relative to the toolhead. Orca derives the other nozzles' collision regions using their configured XY offset from the reference nozzle. This is useful where the same physical carriage must avoid an obstacle but its position changes when a different offset nozzle prints at the same model coordinate. <img width="1084" height="803" alt="Toolhead-relative exclusion volumes" src="https://github.com/user-attachments/assets/e0790ee4-68b5-444f-90ac-22a5eba05eec" /> ### Individual per extruder Each physical extruder/nozzle has its own independent volume definition. This supports machines whose valid region differs by tool and cannot be derived from a simple nozzle offset. <img width="1123" height="761" alt="Independent exclusion volumes for three extruders" src="https://github.com/user-attachments/assets/c6404ceb-9958-4df8-93ed-5ff2ac7dc658" /> Object validation resolves logical filament assignments to the physical nozzle or nozzles that may print the object, including automatic Bambu mapping. If an object may use several nozzles through painting, feature-level assignments, modifiers, support or interface material, the complete object is conservatively checked against every relevant nozzle's volumes. ## Object validation and 3D preview Object collision detection uses a cheap XY/Z broad phase followed by an exact mesh-versus-prism test. The exact test: - Avoids rejecting an object whose XY shadow overlaps a raised volume while its real mesh remains clear. - Detects normal surface crossings. - Detects a volume completely enclosed inside a solid model. - Respects object-instance and model-volume transforms. - Separates the collision decision from optional preview-mesh generation. When a collision is found, Orca reports the relevant extruder where possible and renders the intersecting model surface in red. The bed preview shows a neutral grey footprint, a thin nozzle-colored ownership border where appropriate, and a translucent 3D prism when a nearby object makes the volume relevant. Raised volumes keep their ownership outline on the bed rather than floating at their starting Z. <img width="578" height="534" alt="Red model and exclusion-volume intersection preview" src="https://github.com/user-attachments/assets/d409f574-1790-48e5-b4a3-703273439954" /> Single-nozzle/shared geometry remains visually neutral; nozzle colors are used when they convey distinct tool ownership. The default automatic preview limits the translucent 3D geometry to nearby object height to avoid obscuring the workspace. **View → Show all collision volumes** displays the complete configured Z ranges, including on an empty bed. Its default shortcut is **Ctrl+Shift+V** (**Command+Shift+V** on macOS), and it can be changed in the shortcut settings. Orca remembers this application-level display preference independently of printer presets; it does not change collision checks or slicing. ## Arrange and Fill Bed Arrange and Fill Bed receive Z-aware, nozzle-aware obstacles, so an object may occupy a footprint belonging only to another nozzle or pass below a raised volume when its height permits it. - Existing objects remain obstacles when Fill Bed creates new copies. - Convex volume footprints are passed through accurately. - Orca's current libnest2d path supports convex NFP obstacles only, so non-convex volumes use a documented conservative bounding box until convex decomposition is implemented. - Orca's existing final alignment and normal unplaced-item behavior are retained. <img width="1097" height="846" alt="Fill Bed with multiple tools and exclusion volumes" src="https://github.com/user-attachments/assets/8c0ee5cf-624b-42a6-b57a-13c73400ac5c" /> ## Brim and support generation When collision volumes are enabled, object and support brims are clipped against the relevant first-layer volume footprints before their final extrusion paths are generated. Brim ownership is retained so touching object and support brims cannot be merged and silently reassigned to a nozzle whose volume they intersect. Established bed-edge and bed-area brim clipping remains unchanged when collision volumes are not configured. <img width="1139" height="770" alt="Object and support brims clipped around nozzle-specific volumes" src="https://github.com/user-attachments/assets/2913ff31-53e4-4e43-8b27-1afba7e3bafb" /> Normal support and raft polygon categories are trimmed against the relevant volumes over each support layer's actual vertical slab. Support-material resolution accounts for explicit support/interface tools, “current filament” behavior, alternating material layers, automatic physical-nozzle mapping, support brims, and shared support geometry. TreeSupport3D receives active exclusion geometry during branch planning so its existing avoidance machinery can steer branches around obstacles rather than merely cutting finished paths. ## Final G-code collision validation The final emitted G-code is checked as a safety backstop after slicing. The checker tracks: - The active physical nozzle and its XY offset. - Absolute and relative XY/Z motion. - Travel, extrusion and other parsed motion types. - Tool selection and physical/nozzle mapping. - Explicit motion in start, filament-change and tool-change G-code. - Coordinate resets and common `G28` forms, including bare, spaced, compact and parameterized axis selections. Material keep-outs from `bed_exclude_area` are deliberately ignored by the motion checker. Only explicit collision volumes constrain motion. If Z is genuinely unknown, the check is conservative across all relevant heights and the warning identifies that fact and includes the relevant G-code line. The artificial first segment that the preview draws from `(0,0)` is not treated as a real machine move. ## Travel rerouting Generated travel moves are rerouted around active collision volumes when a valid route exists. Routing is: - Aware of the travel's actual Z slab and planned lift/Z-hop. - Resolved for the active physical nozzle. - Constrained so any detour vertices added by Orca remain inside the printable bed. - Able to accept firmware-established start/end points on or beyond the nominal bed edge. - Revalidated before the replacement path is emitted. The implementation covers ordinary generated travels, the first generated move after start G-code, and moves following physical or same-nozzle filament changes. Explicit movement commands in custom start/tool-change G-code update the tracked position so the next generated travel begins from the correct point without defeating Orca's post-toolchange Z restoration. Obstacle geometry is cached by extruder and active Z-region set, with bounding-box rejection before expensive polygon work. Clear travels therefore avoid repeatedly unioning and offsetting the same obstacles. If no safe route can be found, Orca leaves the original move for the final checker to report rather than emitting an assumed-safe detour. Extrusion paths are validated but never rerouted. <img width="1286" height="706" alt="Travel rerouting from start G-code across multiple Z-aware volumes" src="https://github.com/user-attachments/assets/a68cd98f-5576-4f78-af43-697e9f687a9b" /> And here is an example of independent nozzle travel rerouting: <img width="2532" height="876" alt="image" src="https://github.com/user-attachments/assets/28b0c26e-59d6-42b9-a64f-4c2205c4ea3f" /> ## Testing and review status Targeted Catch2 coverage now includes: - Bed-area/volume parsing, validation, confirmed paste handling, additive behavior and CLI options. - Belt-surface projection of bed areas through both static and dynamic region resolution, including the reported cube positions, with collision volumes left unprojected. - Shared, toolhead-relative and individual per-extruder resolution. - Physical-nozzle and filament mapping. - Exact object intersection, including fully enclosed prisms and transformed instances. - 3MF persistence. - Arrange behavior for convex and non-convex obstacles. - Brim bed-boundary and volume clipping regressions. - Support and interface-material masks across support polygon categories. - G-code motion classification, coordinate tracking, homing forms and tool selection. - Safe travel rerouting, Z-aware activation, nozzle selection, off-bed firmware endpoints and failure cases. The reviewed `929beaee15` revision passed the CI checks, and review testing confirmed that the unit tests and earlier arrange, tool-change Z restoration, support, brim and brim-ownership regressions still pass. Stock-output comparisons covered 12 printers × 3 jobs plus 17 project files and produced G-code identical to `main` when the new feature was not configured. The belt projection correction and its regression coverage are included in the latest update. Please use the checks below for the current head's build and test status; earlier successful runs do not substitute for validation of a new revision. Review also compared CLI output against `main` across stock printers and multi-filament projects. The compatibility regressions found during that review—including stock Bambu cutter motion, preset dirty state, unintended bed-area brim/support changes, tool-change Z restoration, stale post-change origins, arrange rejection, router cost, locale parsing and bed-edge brim clipping—have been addressed. ## Known limitations and follow-up work The implementation deliberately favors conservative safety. A false positive or some unused build volume is preferable to emitting a movement that may collide with the machine. Collision warnings are not an automatic repair or a guarantee of safe output. - Skirts and draft shields are not regenerated or detoured around collision volumes. The final checker can report an intersection, but producing a valid closed loop around internal obstacles while remaining inside the bed needs a dedicated solution. - Extrusion paths are checked but not rerouted. - Spiral Z-hop's circular XY sweep is generated after the primary travel route has been planned. That sweep is not currently rerouted; the final G-code checker can report a collision, but does not repair it. - Orca cannot infer movement hidden inside an opaque firmware macro. A deterministic macro endpoint should be exposed with explicit `G90`/`G91` and `G0`/`G1` motion in Orca's custom G-code so the following travel can be routed from a known position. Movements inside custom G-code are checked, but only the generated travel after them is rerouted. - Negative model parts are not applied to the raw object-intersection mesh, so geometry removed only by a negative part can produce a conservative false positive. - Multi-nozzle object validation applies every relevant nozzle's volume to the complete object rather than only its visibly painted surface. - Support shared by several instances uses a conservative union of relevant plate-space exclusions. - Support avoidance trims or steers generated geometry but does not perform structural support re-planning. Support above a raised volume may resume over a void; native tree-support paths not using TreeSupport3D are not yet volume-aware. - Raised-only collision volumes are not yet fully represented in prime/wipe-tower placement validation; the final G-code checker remains the safety backstop. - Existing cross-object support-to-support overlap behavior is outside this PR. - “No tool selected” carriage-only exclusions are not represented by Orca's current backend and remain a possible future extension. ## Origin This work began with the [Muon3D M1](https://www.youtube.com/watch?v=jBatFQpTM6g), whose notched glass bed leaves usable print volume above a low obstruction. Upstreaming the capability lets other printers describe low clips, raised docks, toolchanger hardware and per-tool clearance limits without requiring a permanent fork. Thank you to everyone who tested the implementation, reviewed the architecture, identified regressions and helped improve the test coverage—especially the multi-tool and macOS testers. Further real-hardware feedback remains welcome, but the current implementation and compatibility behavior are ready to merge. Harry Loud Muon3D |
||
|
|
9f6a344162 | Make the adaptive infill settings pattern-neutral (#16654) | ||
|
|
c5cfe40a1f | Update translations: fill empty entries in all languages and fix color picker strings (#16652) | ||
|
|
c67a46a277 | Merge branch 'main' into feat-3D-Exclusion-Volumes | ||
|
|
252bbbf9f5 |
Make the exclude-object outline tolerance a user setting (#16503)
* Make the exclude-object outline tolerance configurable Signed-off-by: Sergei Rozhkov <zmod@zmod.link> * fix(config): move exclude_object_tolerance to developer mode Signed-off-by: Sergei Rozhkov <zmod@zmod.link> * fix(config): move exclude_object_tolerance to expert mode Signed-off-by: Sergei Rozhkov <zmod@zmod.link> * feat(ui): hide exclude_object_tolerance for non-Klipper firmwares mend Signed-off-by: Sergei Rozhkov <zmod@zmod.link> * Test that a larger exclude object tolerance writes fewer outline points Signed-off-by: Sergei Rozhkov <zmod@zmod.link> --------- Signed-off-by: Sergei Rozhkov <zmod@zmod.link> |
||
|
|
9bbb7ff2c4 | Preserve additive bed areas across preview arrange and cutter paths | ||
|
|
247e903cbe | Merge upstream/main and resolve exclusion volume integration conflicts | ||
|
|
dc9d499434 | Simplify collision volume settings layout | ||
|
|
6e7d5b0a9b |
Ask about clumping detection whenever the prime tower is disabled
The prompt that clumping detection needs a prime tower was nested inside the smooth timelapse check, so disabling the tower with clumping detection on and traditional timelapse gave no prompt; the problem only surfaced as a warning after slicing. The prompt now appears whenever clumping detection is on. The smooth timelapse prompt is unchanged, and answering it with No still skips the clumping one. |
||
|
|
721ec56f22 |
Link the printable area and compatibility conditions to their wiki sections
extruder_printable_area linked to the Extruder offset Position section, which describes a different setting; the wiki now has an Extruder printable area section. The two compatibility conditions linked to their parent sections instead of the Printer Condition and Process Condition sub-sections that describe them. |
||
|
|
7d6e1f85c8 |
Link the new wiki sections from the settings tabs
The wiki now has sections for options that were linked to a page top or not linked at all: the polyhole sub-options, accel to decel, extrusion rate smoothing on external features, max bridge length, the tree support brim, seven prime tower options, Flush into this object and clumping detection. Point each link at its section, and follow the corrected spelling of the wall transitioning threshold angle heading. |
||
|
|
5bce937d07 |
Fix wiki links in the process settings tab (#16451)
- Slicing pipeline plugin linked to others_settings_plugin_picker, a page that doesn't exist. It now opens the Slicing Pipeline section of the plugin types page. - Infill shift step linked to the Cross Hatch pattern, which doesn't use it. It only applies to Cross Zag and Locked Zag, so it now opens Cross Zag. - Fuzzy skin and Fuzzy skin generator mode were crossed: the generator mode opened the section that documents Fuzzy skin's values. Each now opens its own section. - The process Change extrusion role G-code had no wiki link; it now has one, like the printer and filament versions. - The hidden Frequent page linked Wall loops to the top of the walls page instead of its section, which made the wiki sync write its metadata twice. |
||
|
|
e821665e4b |
Add orca-translations Claude skill and PO tool (#16436)
* Add orca-translations Claude skill and PO tool
Add a .claude skill that guides translation passes over the localization/i18n gettext catalogs. It covers the workflow: run gettext, settle new glossary terms, translate in batches, verify, and report.
Includes translation-rules.md, which condenses the placeholder, line-break and glossary rules plus the guidance on review notes.
Also adds scripts/po_tool.py (standard library only). It lists pending entries with glossary hints, validates and applies translations, adding '# AI Translated' and '# Needs human review' comments, and rewrites only the entries it changes. It can also check catalogs, look up existing translations, suggest glossary candidates and update the wiki glossary TSV.
* Let po_tool apply translations by entry id
pending now gives each entry a short id, so a translation file can name
entries by id instead of repeating the English msgid. apply accepts either.
A "review": "" item clears an earlier review note when overwriting an
entry, and check gives each msgfmt run its own temporary output file so
parallel checks do not collide.
* Fill all empty translations
Regenerate the template with run_gettext --full and translate every empty
entry in the 22 catalogs (7,089 entries) with the orca-translations skill,
following the localization glossary, including the new belt printer,
IDEX/IQEX and plugin terms. Every new entry is marked "# AI Translated";
122 also carry "# Needs human review" with what to check.
* Show entry ids in po_tool lookup and search translations
lookup now prints each entry's id, so an entry found there can be
rewritten with apply --overwrite without repeating the English, and
--msgstr searches the translations instead of the msgids, which finds
every entry that still uses a term being changed.
SKILL.md describes how to change an established term: check the
catalog's usage first, update the glossary cell, then rewrite only the
entries where the term has that meaning.
* Fix mistranslated terms and align catalogs with the glossary
Correct labels that the glossary had copied, and the entries that used
them:
- ca: Raft was rendered as the Brim term; it is now "Rai". Exhaust fan,
Monotonic line, Unretract, Slice, Lateral Honeycomb and PA Tower
labels fixed.
- cs: Lightning infill is "Blesk", not "Osvětlení" (illumination).
- sv: Retraction is "Retraktion", not "Reduktion"; Unretract,
Lagerhöjd, Delkylningsfläkt, Utsugsfläkt, Aligned Rectilinear and the
Preset label fixed.
- de: Brim is "Rand" and Skirt is "Umrandung", as most entries already
had them.
- lt: brim entries used the Skirt word "apvadas"; they now use "kraštas".
- es: Sparse infill is "relleno de baja densidad", the catalog majority.
- eu: nozzle wipe is "garbiketa", not purge.
- th: the project plate is "เพลต", distinct from the bed.
- uk: Quarter Cubic, Latin "PA" in PA Tower, and Belt purge tower.
- pl: Cross Hatch, Tri-hexagon, Volumetric speed and Raft labels.
- zh_TW: Brim stays "Brim", as the existing labels have it.
- tr: "Prime Tower" read "Prime Minister Tower".
- ko: the plugin "Capabilities" label read "performance".
- Build Volume labels fixed in tr, de, cs and eu.
All 242 rewritten entries are marked "# AI Translated".
* Make more UI text translatable and fix pluralization and context
Audit the sources for text that translators could not translate
correctly and fix it.
Mark text that reached users in English only: IDEX/IQEX role names,
plugin permission prompts and errors, 3MF/preset loading errors, G-code
placeholder parser errors, calibration and device messages, notification
texts, file dialog filters, and the config validation messages.
Replace sentences built from translated fragments, such as the prime
tower warnings, "left"/"right" nozzle names, and "Filament " + number,
with single msgids that have placeholders, so translators can reorder
and inflect them.
Use plural forms for texts with a count ("%1% mixed filaments",
"%d objects", "%1% triangles") instead of "(s)" and mismatched verbs.
Fix the swapped singular/plural pair in "The following presets inherit
this preset".
Add translation contexts where one English word has several meanings
(Subscribed/Local, Standard, Pause, View, Step, Model, Camera, Flow,
Filter, Others, Prepare, the Design tools). Show "Size" instead of
"Build Volume" in the Cut tool, which displays the object size.
Fix code that compared translated text with English (the Edit G-code
dialog group, the plugin registration failure check), and add the
bundled web pages' missing string-table entries. Use the single
character for degrees Celsius, say "G-code", and describe the head
filament map without internal jargon.
Install the libslic3r translate callback before the presets load, so
their load errors are translated, and list the 28 source files that had
marked strings but were never extracted into localization/i18n/list.txt.
* Suggest earlier translations and list fuzzy entries in po_tool pending
pending now attaches the closest earlier translation of a similar
English text (from obsolete or translated entries), so a reworded or
split string keeps its wording, and it lists fuzzy entries by default,
since users never see them. A fuzzy entry also carries its stale
translation as previous_translation.
* Fix wording of the non-boolean operands error
The logical operation error said "operators" where it means the
operands the operation was applied to.
* Translate the newly translatable strings in all languages
Regenerate the template after the translatability changes and fill every
new or changed entry in the 22 catalogs (about 12,800 entries): the
strings that became translatable, the plural forms, the entries split by
context, and the previously fuzzy singular entries that became plurals.
Every new entry is marked "# AI Translated", and about 360 also carry a
"# Needs human review" note saying what to check. Terms follow the
localization glossary. Earlier translations of reworded strings were
reused where the meaning was unchanged. Existing entries were not
changed, and obsolete entries are kept.
* Document the source translatability audit in the orca-translations skill
Add a reference describing how strings reach translators, what to look
for (untranslated text, spliced sentences, missing plurals, ambiguous
words), what not to translate, where a context cannot be carried, and
what to do after the edits, plus a scanner that lists untranslated
user-facing string literals.
* Document how to write translatable strings in AGENTS.md
Tell developers to keep each message complete in one msgid: use
placeholders instead of concatenating translated fragments, plural forms
for counts, and contexts for ambiguous words, and to list new source
files in localization/i18n/list.txt. Add a matching code review item.
* Translate the strings added since the rebase
Regenerate the template against the current main and translate the 26
new entries per language: the Fix Model commands and messages, and the
texture displacement image adjustment panel. Each new entry is marked
"# AI Translated"; existing entries are unchanged.
* tidy
|
||
|
|
f0e9cdc470 |
raft expansion (#16416)
Update ConfigManipulation.cpp Co-authored-by: Accelerator <22743445+acceleratorlastorder@users.noreply.github.com> Co-authored-by: Ian Bassi <12130714+ianalexis@users.noreply.github.com> |
||
|
|
bd125d32da | Support searching the Speed Dial by English names in any UI language (#16369) | ||
|
|
00cfb5b259 | Refresh translation catalogs and fix xgettext warnings (#16346) | ||
|
|
aa14598e32 |
iXex: Parallel Printing Support for IDEX and IQEX Printers (#13086)
## Summary This PR adds first-class parallel printing support to OrcaSlicer for printers with multiple independent X-axis carriages — the **IDEX** and **IQEX** hardware families. The feature is named **IMEX** (independent multi-extruder) internally, which captures the supported topology space more accurately than either acronym alone, and is exposed in the UI under the user-facing label **IDEX/IQEX Configuration**. It is designed to be printer-agnostic and firmware-flexible, with Klipper, RepRapFirmware, and Marlin all supported for per-tool Pressure Advance and per-layer temperature management. MMU/AFC setups where multiple logical filament slots share one physical extruder are supported via a `physical_extruder_map` profile option. Printers whose firmware handles copy/mirror placement internally — RepRapFirmware IDEX duplication mode on Flashforge Creator Pro 2 / Creator 3 Pro is the canonical example — are supported through a firmware-managed-zones flag that emits a centered single-half slice for the firmware to fan out. The implementation spans printer configuration, process settings UI, bed visualization, per-plate mode selection, ghost-object rendering with per-plate filament overrides, placement validation, pre-slice conflict warnings, G-code generation (with per-tool PA, per-layer temperature management, and optional center-origin slice frame), and layer preview animation. It supports five distinct topology paradigms: - **1 gantry × 2–4 tools** — classic IDEX with 2 tools (BCN3D Sigma, Snapmaker J1, Tenlog Hands-2 style — two independent X carriages on a shared Y gantry); multi-extruder on a shared rail when extended to 3 or 4. - **2 gantries × 1 tool each** — two fully-independent XY systems sharing a bed (Vivedino Xplorer style). Both Y rails independent — effectively "half an IQEX." - **2×2 grid, independent quadrants** — IQEX running four separate prints in parallel. - **2×2 grid, paired-gantry multicolor** — IQEX where cross-gantry tools share color responsibilities via the **Span** tile state. - **Firmware-managed center-origin** — slicer emits a centered single-half slice; firmware decides where to physically fan it out. Overlays on any of the above hardware topologies; canonical example is Flashforge IDEX with RepRapFirmware. --- ## Feature Walkthrough ### Printer Configuration Printer preset options that declare IMEX capability and geometry: | Option | Type | Description | |--------|------|-------------| | `is_imex` | bool | Marks this printer as IMEX-capable | | `imex_firmware_managed_zones` | bool | Emit centered single-half slice; firmware handles copy/mirror placement (default `false`) | | `imex_gantry_count` | int | Number of independent Y-axis gantries (rows) | | `imex_tools_per_gantry` | int (1–4) | Toolheads per gantry along X (columns) | | `imex_nozzle_clearance_x` / `imex_nozzle_clearance_y` | float | Nozzle-to-collision-edge distance in mm (literal, not halved) | | `imex_tool_layout` | string | Physical orientation: front-left / front-right / rear-left / rear-right | | `imex_mode_names` | string[] | Names of user-defined parallel modes; first entry is the reserved `primary` sentinel | | `imex_mode_active_tools` | string[] | Tool role assignments per mode (e.g. `0:P,1:C,2:M,3:M`, or `0:P,1:S,2:M,3:M` with Span) | | `imex_mode_gcodes` | string[] | Firmware macro to activate per mode | | `physical_extruder_map` | string[] | 0-indexed map from logical filament slots to physical extruders (for MMU/AFC — see below) | Tool roles per mode: **Primary** (P), **Copy** (C), **Mirror** (M), **Span** (S), **Inactive**. ### Parallel Mode Editor [Kooha-2026-05-14-13-45-35.webm](https://github.com/user-attachments/assets/af7650e6-d636-478b-9398-3f02ec662f03) The **IDEX/IQEX Configuration** and **IDEX/IQEX Parallel Modes** sections live in the printer preset's **Multimaterial** page (visible only when `is_imex = true`). The mode editor is a visual grid: - Each row defines one named parallel mode. The first row is a reserved, non-deletable **Primary** row stored as the sentinel `primary` in `imex_mode_names`. - The Primary tool is always T0; **Tool 0 Position** chooses which physical corner it occupies, and its tile is read-only. The other tool buttons cycle Inactive → Copy → Mirror → Span → Inactive, color-coded, with Span offered only where it applies. - **Span** is only offered when `imex_gantry_count >= 2` AND the tile is on the primary's gantry row — it declares "this tool is the multi-color partner of Primary on the same gantry," distinct from a Copy/Mirror role on a non-primary gantry. - A G-code field per mode holds the firmware macro to activate that mode (e.g. `IMEX_COPY` for Klipper). A placeholder-browser button per row opens the `EditGCodeDialog` for quick insertion. - Modes can be added and removed (removed via a dedicated `imex_remove.svg` ScalableButton). - Deleting the active mode resets affected plates to Primary. - Tool assignments are preserved across `imex_gantry_count` changes: going from IQEX (4 carriages) → IDEX (2 carriages) → IQEX restores all previously assigned roles, and the visible grid anchors to the gantry row containing the Primary assignment. <!-- TODO: replace this placeholder with a re-recorded parallel-mode-editor video showing the Span tile state, the remove button, and the placeholder-browser button. Old URL (out of date): https://github.com/user-attachments/assets/cabf1f70-206d-4f84-9c2e-594b38b83951 --> ### Span Tile State — Paired-Gantry Multicolor <img width="2833" height="1300" alt="2026-05-14-135412_grim" src="https://github.com/user-attachments/assets/52203133-7380-459a-973f-0502a1edc3c2" /> For IQEX printers (`imex_gantry_count >= 2`), the **Span (S)** tile role enables paired-gantry multicolor mirror mode. The same active-tools string `0:P,1:C,2:M,3:M` is ambiguous between two distinct hardware jobs — four independent quadrants vs. paired-gantry multicolor mirror — so the topology has to be declared explicitly rather than inferred. Span on the primary's gantry row is the declaration. Behavior driven by Span presence: - **Multicolor block rule**: requires Span on primary's gantry to allow multi-color slicing in a parallel mode. Without Span, multi-color slicing in a parallel mode is blocked with an actionable error message. - **Ghost aggregation**: one aggregated ghost per non-primary gantry when Span is present, using the column-paired representative tool. Mixed-role gantries fall back to per-tool. - **Zone aggregation**: one row-strip zone per non-primary gantry when Span is present (cell at primary's column collapses col-sep; `make_boxes` expands to full-X strip). - **Aggregated mirror drag**: ghost translates 1:1 with primary in X (copy-style), with X-flip baked into the mesh-local frame so geometry still reads as mirrored. Gantries don't share an X rail, so reflecting motion serves no collision purpose. - **Carriage collision strip audit**: X-boundary checks require `zr == pri_row_k` (matching the existing Y-boundary `c == pri_col` constraint). Prevents spurious strips on primary's right edge in paired-gantry mc-mirror, where T3 sits diagonally and can't actually collide with primary's carriage. Single source of truth: `IMEXHelpers::group_imex_active_tools_by_gantry(active_tools_str, tools_per_gantry)`. Ghost factory and zone calculator both consume it, so pairing logic lives in one place. ### Per-Plate Mode Selection Each build plate has an IMEX mode icon in its toolbar (normal, hover, dark, and dark-hover SVG variants). The mode can be set independently per plate: - **Left-click** cycles through all non-sentinel modes in order. - **Right-click** opens a popup menu listing all modes as radio items for direct selection. - Mode changes are recorded in the undo/redo snapshot system. - The selected mode is persisted in the 3MF project file per plate (`imex_parallel_mode` key). https://github.com/user-attachments/assets/5ab497e3-9c2f-476a-ac67-ef34a592395b When a parallel mode is active alongside multi-material objects on the same plate, a warning badge (`obj_warning.svg`) overlays the plate icon — see **Pre-Slice Warning System** below. ### Bed Visualization + Auto-Arrange Constraints When an IMEX mode is active, the build plate renders the carriage grid: <img width="2761" height="1447" alt="IMEX bed visualization with active primary zone and dimmed secondary zones" src="https://github.com/user-attachments/assets/3ee64b7b-a3ed-40aa-ad07-fa2f1cb74edf" /> - The **active (primary) zone** is full brightness. - **Inactive zones** are dimmed with a color-coded overlay (blue for copy, orange for mirror). - **Zone dividers** are rendered as lines across the bed. - The grid is a full 2D layout: `imex_tools_per_gantry` columns × `imex_gantry_count` rows. Zone sizing is based on the **active** tool count only — inactive tools donate their bed share to active neighbors. - Span-present configs render as a single row-strip zone per non-primary gantry rather than per-tool quadrants, reflecting that the firmware will paint the multi-color across the entire strip. - Colors are drawn from the Okabe-Ito palette for colorblind accessibility, with a deuteranopia/protanopia-safe alternate theme. - **Auto-arrange** is constrained to the primary zone when a parallel mode is active — `ArrangeJob::process()` replaces full-bed `bedpts` with the primary zone corners via `PartPlate::imex_primary_zone()`. Collision strips are additionally registered as hard obstacles through `m_unselected` (the working NFP placer input, not the dead `excluded_regions` field), so placement cannot drop parts into the danger strips. ### Placement Validation https://github.com/user-attachments/assets/5cb5a94a-981e-4fe9-898e-7e2f891b4f40 Objects placed outside the primary zone block slicing: - `has_imex_placement_violations()` in `PartPlate` checks each object's convex hull against the primary zone boundaries and collision strips. - Violations inject into the existing `update_background_process` validation pathway — the Slice button is disabled and an error notification is shown. - Mirror tools additionally generate X-axis collision strips (copy tools move in the same direction and cannot collide). Y-direction strips are scoped to same-column tools to avoid false positives from diagonal mirror pairs. - Strip width is taken **literally** from `imex_nozzle_clearance_x` (the measurement is nozzle-to-collision-edge distance, not carriage half-width). - Multi-color block path: a pre-slice rule blocks multi-color slicing in parallel modes that can't physically support it (e.g. a "fake IMEX" mode where all tools sit on a single gantry without a Span partner). The rule is centralized in `imex_multicolor_block_reason()` with unit-test coverage of every gating case. ### Ghost Object Rendering + Per-Plate Filament Picker When a parallel mode is active, the slicer renders colored, transparent **ghost copies** of primary-head instances on the plate — one per secondary active head, transformed under its Copy/Mirror role (or aggregated per gantry when Span is present). - Ghosts track the primary through drag/rotate/scale/mirror and invalidate on mode, filament-map, or `physical_extruder_map` changes. - **Left-click** on a ghost opens the `IMEXFilamentPickerPopover` for that ghost's head — a compact `BitmapComboBox` that writes directly to the per-plate `imex_head_filament_map` (MMU lane override). - Mirror ghost geometry is a **true reflection about the zone-boundary plane** (`x = primary_zone_center.x + gantry_offset.x/2`), so the ghost stays anchored in the target zone as the primary moves and drag reflects correctly (primary +X → ghost −X, Y tracks 1:1). - Hover tooltip: `"Tn → filament N"` with a color swatch. When no filament resolves to a head, the tooltip surfaces an actionable message directing the user to extend the extruder count in the Machine tab. - Ghost rendering + picking are scoped to the active plate — non-active plates don't draw stale ghosts during arrange/preview transitions, and click-picking never falls through to a non-current plate's ghost geometry. - Per-plate `imex_head_filament_map` round-trips through the 3MF project file. ### Pre-Slice Warning System <img width="1786" height="911" alt="2026-05-14-135714_grim" src="https://github.com/user-attachments/assets/16532d47-2da5-4472-ab9c-4b8b00303bae" /> Before a plate slices, IMEX parallel-mode plates are checked for three classes of conflict: 1. **Multi-material on secondary tools** — when the mode has Copy/Mirror tools and the plate has multiple filaments active; plate icon gets a warning badge. 2. **Bed temperature mismatch** — any two carriages configured >5 °C apart. 3. **Filament type incompatibility** — filaments from different type families on active carriages. A dismissible Yes/No `RichMessageDialog` fires once per user action from both `on_action_slice_plate` and `on_action_slice_all`. The dialog has a **"Don't show again"** checkbox that persists to `app_config` as `imex_pre_slice_warnings=false`. A re-enable toggle lives in **Printer Settings → Multimaterial → IDEX/IQEX Configuration** so suppressed warnings can be restored. ### Firmware-Managed Zones — Center-Origin Slice <img width="701" height="197" alt="2026-05-14-135842_grim" src="https://github.com/user-attachments/assets/3e2dfaab-fb4f-42b1-bf9d-c88dc0c95110" /> The `imex_firmware_managed_zones` printer-config option (default `false`) supports IDEX/IQEX printers whose firmware applies its own copy/mirror offsets in non-primary modes. Canonical examples: **RepRapFirmware IDEX duplication mode** on **Flashforge Creator Pro 2 / Creator 3 Pro**. These printers expect a centered single-half slice at bed origin and fan toolheads out from there — the slicer-managed paradigm of placing toolpaths at zone-relative positions produces gcode the firmware can't reconcile, since it'd double-apply offsets. When the flag is on and the active mode is non-primary, the slicer subtracts the primary zone's plate-local center from the gcode emission frame: - **Writer offset** is augmented by the primary zone center so emitted gcode is centered at bed origin. - **Processor offset** stays at plate_origin only, so the gcode-preview visualizer renders the centered toolpath at bed center rather than at the prepare-view zone placement. The user sees what'll physically print after firmware fan-out. - **`translate_to_print_space()`** is augmented for frame coherence so `first_layer_print_min/max` placeholders consumed by user start_gcode (e.g. Flashforge's M118 "max delta from zero" header) reflect the centered frame. Slice-handoff runs per-slice: `PartPlate::refresh_imex_slice_offset()` is called from `Plater::priv::update_background_process` after `Print::apply()`, so reslicing with mode toggled but no plate change picks up the updated offset. When the flag is off, all related code paths reduce to no-ops byte-identical to standard slicer-managed behavior. The two stock-code touches at `Print.cpp:2553-2554` (gcode_offset composition) and `Print.cpp:2823-2829` (translate_to_print_space) are explicit additive shifts that collapse to identity when the offset is `Vec2d::Zero()`. ### G-code Injection The selected parallel mode's G-code is written into the output file immediately before `machine_start_gcode`: - Looks up the plate's active mode name in `imex_mode_names` and writes the corresponding `imex_mode_gcodes` entry. - Processed through `placeholder_parser_process()` first, so Klipper-style variable substitution works **and** any `{global}` declarations flow forward into `machine_start_gcode`. - Primary mode's G-code field is emitted too. - Guarded against headless CLI slicing — `ensure_imex_zones()` short-circuits when `m_plater` is null so the CLI path (used by upstream's regression-test CI step) doesn't segfault on `wxGetApp().preset_bundle` dereference. ### Placeholder Parser Integration <img width="535" height="393" alt="2026-05-14-140227_grim" src="https://github.com/user-attachments/assets/6d059c77-38f6-4418-bfe9-3bf963e8c836" /> Three placeholders register under **Slicing State** and are settable from anywhere downstream: | Placeholder | Type | Description | |---|---|---| | `imex_mode` | string | The active mode name | | `imex_mode_index` | int | Index into `imex_mode_names` | | `imex_mode_gcode` | string | The resolved mode G-code (post-parser) | ### Per-Tool Pressure Advance — Firmware-Agnostic `set_pressure_advance()` takes an optional tool index (default `-1`, preserving existing behavior for all non-IMEX call sites). Per firmware: - **Klipper**: `EXTRUDER=extruder[N]` when `tool >= 0`, bare command otherwise - **RepRapFirmware**: `M572 D<N>` when `tool >= 0`, `M572 D0` otherwise (preserves the pre-IMEX output; a bare `M572` applies to whatever tool is selected and errors when there is none) - **Marlin 2**: `M900 K<X> T<N>` when `tool >= 0`, bare `M900` otherwise - **Marlin Legacy / fallback**: `M900 K<X>` always - **Repetier**: `M233 X<X> Y<X>` (X is quadratic, Y is linear; same value applied to both) `m_imex_parallel_mode` is set once per export from the active plate mode. PA tool-qualification is gated on this being a **non-primary** parallel mode — primary-mode prints emit ordinary tool-change PA exactly like any non-IMEX printer. Secondary active tools in parallel modes receive explicit per-tool PA at print start since they never go through a tool-change sequence. ### Per-Layer Temperature Management In IMEX parallel modes, all active tools (primary + secondaries) get temperature commands in `layer_change_gcode`: - Layer 1 temperatures only emit on the first layer; subsequent layers use normal layer-change temperatures. - IMEX temperature handling is consolidated into the second-layer transition. - Layer-change temperature commands use `M104 T<N>` with `physical_extruder_map` translation when applicable. ### MMU / AFC Support via `physical_extruder_map` For printers where multiple logical filament slots share one physical extruder (MMU, AFC, toolchangers), the `physical_extruder_map` profile option translates tool slot indices to physical extruder qualifiers before G-code emission. - **Fallback**: on IMEX printers, `Print::apply()` uses the profile's map only when it has one entry per extruder (the `nozzle_diameter` count). Anything else, including the single-entry default, is replaced by the identity map `0..n-1`. - **Used by**: IMEX PA emission, layer-change temperature commands (`M104 T`, `EXTRUDER=`, `M572 D`), ghost color resolution, ghost cache key, tooltip lookup, click gate. - **Profile authoring example** for a 7-slot printer with a 4-lane MMU on extruder 0 and three independent direct drives on extruders 1/2/3: ```json "physical_extruder_map": ["0","0","0","0","1","2","3"] ``` Non-MMU printers need no action — the identity fallback handles them. - A centralized helper in `IMEXHelpers`, `effective_physical_extruder_map(explicit_pem, nozzle_count)` (with a `PresetBundle` overload that prefers the project's map over the printer's), routes all PA/temp/ghost-color lookups through a single code path. - **No UI for editing the map** in this PR — non-trivial MMU/AFC layouts require profile-authoring (hand-edit the printer JSON) or an updated printer profile shipped by a vendor. A future enhancement would expose a per-slot extruder picker in the Multimaterial section. ### Layer Preview Multi-Carriage Animation The sequential preview (scrubber) animates all active carriages simultaneously: - One toolhead marker (colored cube) per active carriage, in addition to the primary. - Secondary marker colors: cyan (T1), yellow (T2), magenta (T3). - **Copy** tools: marker placed at the same relative position within their bed zone as the primary is in the primary zone. - **Mirror** tools: reflect across the target zone's facing edge (left-of-copy reflects across copy zone's left edge; right-of-copy across the right edge). Y position is always zone-relative copy (all tools on a row share a physical Y rail). - Carriage footprint boxes use per-carriage `box_offset_x/y` so the nozzle marker sits at the physically correct edge of the footprint — zone-based X by default, collision-side edge for Mirror; gantry-behind Y for back-row primaries, flipped for front-row primaries with a back-row secondary. - The filament usage legend notes the active carriage count and mode name (e.g. `IMEX: ×2 (copy_mode)`). - **View menu toggle**: `View → Show IDEX/IQEX Toolhead` (visible only on the Preview tab, only when the active printer is IDEX/IQEX) hides/shows the per-carriage toolhead representation during preview playback. State persists to `app_config` as `show_imex_toolhead_boxes`. Useful when scrubbing through dense toolpaths and the boxes get in the way of seeing the underlying geometry: [Kooha-2026-05-14-14-04-09.webm](https://github.com/user-attachments/assets/9869cd4d-3b60-4a6b-8dca-7ee1fc573ac1) Copy mode: https://github.com/user-attachments/assets/0774d285-ba36-4b86-a594-fb6572c3aede Mirror mode: https://github.com/user-attachments/assets/51528926-94dc-4d90-9b1a-1b42d9044be7 --- ## Known Limitations **Per-layer G-code collision detection** The placement-time zone check catches gross violations (object placed in wrong zone) but does not verify that toolpaths on any given layer maintain adequate X separation between adjacent carriages. A per-layer check via `ConflictChecker` was designed but deferred. Without it, a print that passes placement validation could still crash carriages if the primary object's toolpaths reach too close to a zone boundary. **Brim avoidance of IMEX zones** Standard `bed_exclude_area` exclusion zones are already respected by brim generation. IMEX collision strips are not — the brim generator has no visibility into them. The correct fix (feeding computed strip polygons from `PartPlate` through the `Print` object to `Brim.cpp`) was designed but deferred. In practice, users should leave adequate clearance between printed objects and zone boundaries to account for brim width. **`extruder_printable_area` integration** IMEX zones are not clipped against per-extruder printable polygons, and there is no violation check for placing an object outside the intersection of its active extruder's printable area and the IMEX primary zone. Deferred pending clarification on the tool→extruder index mapping. **Ghost rendering in firmware-managed mode** When `imex_firmware_managed_zones` is on, ghost rendering is suppressed entirely. The existing `imex_head_transform` math is slicer-managed semantics (places ghosts at `primary_zone_center + gantry_offset`) and produces wrong positions when the toolpath is being emitted in a centered frame. Proper firmware-managed ghost rendering — showing where copies/mirrors will physically print after firmware fan-out — needs new transforms designed around firmware-frame positions rather than a coordinate-flip of the slicer-managed ones. Deferred to a follow-up. **Filament-accurate multi-region ghost color** For paired-gantry multicolor mirror (Span mode), the aggregated ghost currently uses the representative tool's filament color as a single solid swatch. A future enhancement would render the ghost split into per-source-tool regions, each colored by the secondary tool that mirrors it. Slicer-side correctness is already shipped — the G-code emits the right T-codes; the ghost is a visual aid only. **Ghost path overlays** Secondary carriage toolpaths are not rendered in the layer preview. The secondary markers animate correctly, but the paths they would trace are not drawn. Adding ghost path rendering would require duplicating and offsetting the toolpath geometry per secondary carriage, which is a significant addition to the libvgcode rendering pipeline. **No per-mode slicing** All carriages in a mode execute the same sliced toolpaths (transformed per zone). There is no support for slicing different objects for each carriage independently within one mode. **Global default IMEX mode** There is no job-level IMEX default mode. Each plate's mode must be set individually (default is always Primary). A future improvement would add a global default in the sidebar (following the same pattern as bed type and nozzle diameter), with per-plate overrides. **Dynamic GL-rendered mode icons** The per-plate icon currently uses static SVGs. A GL-rendered carriage-grid icon that visually represents the mode's tool layout would be a nicer UX but is deferred. **Slice-all thumbnail icon refresh** On the "Slice All" path, plates flagged as IMEX-violated do not refresh their toolbar icon. Root cause and fix identified, not yet applied. **Start-G-code filament placeholder** The resolved per-head filament map is not yet exposed as a `PlaceholderParser` vector. Exposing it would let MMU firmware macros pre-load lanes before print start. **No UI for `physical_extruder_map` authoring** The MMU/AFC slot-to-physical-extruder map is currently profile-only — there's no in-app dropdown or editor for it. Users with non-trivial MMU/AFC setups must hand-edit the printer-preset JSON (or rely on a vendor-supplied profile). A future enhancement would expose a per-slot extruder picker in the Multimaterial section so users can declare the mapping without touching JSON. **Bundled IQEX printer profile** A full IQEX printer profile with cover image, bed mesh, and matched process/filament profiles is not bundled with this PR. Users must currently author their own printer preset. Deferred to a follow-up profile-only PR. **Mode lifecycle gap** Per-plate mode is stored as a string (the mode name). If a mode is renamed or deleted from the printer preset after a project is saved, the plate's saved mode name will not resolve and will silently fall back to Primary on next load. A warning on load would be a useful addition. **Firmware-managed prepare→preview frame jump** In firmware-managed-zones mode, the prepare view shows the part at its placed-in-zone position while the preview view shows the centered slice. This is intentional — the views truthfully represent the prepare frame vs. the post-firmware-fan-out frame — but the visual jump can be confusing on first use. --- ## Firmware Assumptions - The implementation assumes the firmware handles all carriage synchronization and offset math. OrcaSlicer only injects the mode-activation macro before machine start and is entirely dependent on user configuration. - Per-tool Pressure Advance is firmware-aware (Klipper / RRF / Marlin 2 / Marlin Legacy / Repetier). Layer-change temperature commands use `M104 T<N>` with `physical_extruder_map` translation. - Tested against Klipper on a real IQEX printer. RepRapFirmware gcode emission is exercised via profile-driven slice tests (Flashforge Creator Pro 2 profile); Marlin and RRF paths have not been validated on real hardware print runs. - Mid-print mode switching is explicitly not supported. The mode is locked at print start. - Firmware-managed-zones mode requires the printer's firmware to translate centered slice coordinates into physical toolhead positions; the slicer does not attempt to model the firmware's offset logic. --- ## Files Changed (High-Level) | File | Change | |------|--------| | `src/libslic3r/PrintConfig.{cpp,hpp}` | IMEX config option definitions + declarations, `IMEXMode` enum, `physical_extruder_map`, `imex_head_filament_map` (plate option), `imex_firmware_managed_zones` | | `src/libslic3r/Preset.cpp` | IMEX keys registered in printer and process preset option lists | | `src/libslic3r/PrintApply.cpp` | `physical_extruder_map` identity fallback on IMEX printers | | `src/libslic3r/Print.{cpp,hpp}` | IMEX slice-offset field + accessors; `translate_to_print_space` augmentation for frame coherence | | `src/libslic3r/GCode.{cpp,hpp}` | Mode G-code injection, per-tool PA emission (firmware-agnostic), per-layer temperatures for all active tools, `m_imex_parallel_mode` state, `set_gcode_offset_with_imex_shift` writer/processor split | | `src/libslic3r/GCodeWriter.{cpp,hpp}` | `set_pressure_advance(tool_index = -1)` per-firmware implementation | | `src/libslic3r/IMEXHelpers.{cpp,hpp}` | `imex_head_transform` (Primary/Copy/Mirror), `parse_imex_active_tools`, `imex_primary_tool_for_mode`, `effective_physical_extruder_map`, per-head filament resolution, `group_imex_active_tools_by_gantry` (Span pairing), `compute_imex_slice_offset` (firmware-managed) | | `src/libslic3r/Format/bbs_3mf.cpp` | Per-plate IMEX mode and `imex_head_filament_map` serialization | | `src/slic3r/GUI/Tab.{cpp,hpp}` | `IMEXModesCtrl` in Multimaterial page, tool assignment persistence across gantry count changes, `primary` sentinel handling, Span tile state, firmware-managed-zones checkbox, null guard in `clear_pages()` | | `src/slic3r/GUI/PartPlate.{cpp,hpp}` | Zone visualization (Span row-strip aggregation), placement violation detection, per-plate mode icon, ghost volume rebuild on mode/map/object mutation, warning-badge overlay, pre-slice warning collection, `refresh_imex_slice_offset()`, ghost suppression in firmware-managed mode, headless-CLI guard | | `src/slic3r/GUI/Plater.cpp` | Validation pathway injection, per-plate mode popup, ghost click handling, pre-slice warning dialog with "Don't show again", IMEX multimaterial conflict routing, per-slice IMEX offset refresh in `update_background_process` | | `src/slic3r/GUI/GLCanvas3D.cpp` | Ghost rendering with per-head filament color and translucent blending, picking via volume composite id, active-plate scoping | | `src/slic3r/GUI/GCodeViewer.cpp` | Multi-carriage marker animation, Mirror math fix, carriage footprint box offsets, legend annotation | | `src/slic3r/GUI/IMEXFilamentPickerPopover.{cpp,hpp}` | Ghost-click filament picker | | `src/slic3r/GUI/Jobs/ArrangeJob.cpp` | Auto-arrange constrained to IMEX primary zone + collision strip exclusion via `m_unselected` | | `src/slic3r/GUI/OG_CustomCtrl.cpp` | Empty `option_set` guard for widget-only lines | | `resources/images/plate_imex_mode*.svg`, `imex_remove.svg` | Per-plate mode icons (light/dark/hover variants), remove button | | `tests/libslic3r/test_imex_helpers.cpp` | Coverage for IMEX head transforms, `effective_physical_extruder_map`, `imex_multicolor_block_reason` gating, `group_imex_active_tools_by_gantry` Span pairing, `compute_imex_slice_offset` | --- ## Testing Notes Validated on an IQEX printer (4 carriages, 2×2 grid, Klipper firmware) and against the Flashforge Creator Pro 2 profile (2-tool IDEX, RRF flavor, center-origin bed) with the following configurations: - **Primary only** — baseline, no regression vs. standard single-extruder workflow - **Copy mode** (T0 Primary, T1 Copy, same row) — carriage markers animate in sync offset by strip width; ghost tracks drag/rotate/scale - **Mirror mode** (T0 Primary, T1 Mirror, same row) — T1 marker reflects T0 across zone-boundary plane; ghost drag reflects X correctly while Y tracks 1:1 - **Cross-row copy + mirror** (T0 Primary row 0, T2 Copy row 1, T3 Mirror row 1) — T2 follows T0's zone-relative position; T3 mirrors T2's X; Y shared per row - **4-tool copy mode** (T0 Primary, T1/T2/T3 Copy) — zone sizing correct, all four markers + ghosts render in sync - **Paired-gantry multicolor (mc-mirror, Span)** — `0:P,1:S,2:M,3:M`: ghost aggregates to one per non-primary gantry, X-flipped, drag tracks 1:1 with primary; collision strip audit doesn't fire spurious strips on primary's right edge - **Firmware-managed copy mode** (Flashforge Creator Pro 2) — emitted gcode coordinates are centered at bed origin (X = −cube_half_width … +cube_half_width), `first_layer_print_min/max` placeholders evaluate symmetrically, M118 header produces correct "max delta from zero" values for Flashforge's existing template, ghosts suppressed - **Firmware-managed flag toggle** — flipping the checkbox off restores slicer-managed iMEX behavior (toolpath at zone position) byte-identically; flipping on restores center-origin slice - **Delete active mode** — no crash; plate resets to Primary - **Placement outside primary zone** — slicing blocked with error notification - **Multi-material conflict warning** — plate icon gets warning badge; Yes/No dialog fires on slice; "Don't show again" checkbox persists - **Multi-color block rule** — `0:P,1:C` on a single gantry blocks at slice time with actionable error message - **Ghost filament picker** — left-click on ghost opens picker; selection writes to `imex_head_filament_map` and round-trips through 3MF save/load - **Per-plate mode selection** — left-click cycles modes, right-click shows popup, undo/redo correctly reverts mode changes, mode persists through project save/load - **Gantry count change round-trip** — reducing from IQEX (4 carriages) to IDEX (2 carriages) and back restores all previously assigned tool roles - **MMU/AFC `physical_extruder_map`** — explicit map routes PA and temperature commands to correct physical extruder qualifiers; auto-derive fallback preserves 1:1 behavior for non-MMU printers - **Headless CLI slicing** — `orca-slicer --slice project.3mf` does not segfault on IMEX-enabled printers - **Dark mode** — all four plate-icon variants render correctly - **Pre-slice warnings suppress + restore** — `app_config` flag flips on checkbox; re-enable toggle in Multimaterial config restores dialog - **Stock non-IMEX printer regression check** — slicing a single-head Voron Trident 350 profile produces byte-identical gcode vs. baseline; the firmware-managed flag and Span tile state both no-op when not applicable - **Full unit test suite** — 247/247 passing, including Layer 1 coverage for `compute_imex_slice_offset`, `group_imex_active_tools_by_gantry` Span pairing, and `imex_multicolor_block_reason` gating |
||
|
|
0a9e7f33e1 | Link the IDEX/IQEX settings to their wiki sections | ||
|
|
8b5280098f |
Merge upstream main: center of mass markers, adaptive TPMS, texture bake color mixing, post-processing preview fix, GLEW/OpenCSG removal
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
c23ea82ad1 | revert extruder term on printer settings and optimize dynamic paddings | ||
|
|
bef49a330b | Keep extruder switch button padding after a DPI change | ||
|
|
2c0ce5c38b | Merge upstream/main and refine exclusion-volume configuration UI | ||
|
|
ebaff19754 | Merge branch 'main' into extruder-variants-ui-2 | ||
|
|
b5f5b50157 |
Adaptive TPMS (#16005)
Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com> |
||
|
|
96a1877447 | optimize dynamic padding for printer settings dialog | ||
|
|
f970a607ae |
Merge upstream main: belt printing, texture displacement color mixing, 3MF component cycle checks, undo blocked during background jobs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
81e523e8fb | fix m_variant_combo expands vertically | ||
|
|
86a6841a06 | optimize dynamic padding | ||
|
|
f2d3e14f2b | fix scaling of multi_extruder and extruder_sync icons on top sizer | ||
|
|
dafc8c5f92 |
Let the pre-slice warnings checkbox redraw when clicked
Its toggle handler did not call Skip(), so CheckBox's own handler, which redraws the tick, never ran. Each click still flipped and saved the setting, but the box kept showing it ticked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
7c2566488a |
Keep the IDEX/IQEX settings out of Simple mode
The Multimaterial page showed an IDEX/IQEX section in Simple mode on every FFF printer. The pre-slice warnings row's hand-built option definition left its mode at comSimple; it now uses comAdvanced, like the IMEX options around it. The parallel modes grid had a group of its own holding only a full-width widget line, which records no mode, so that group showed in every mode. The grid now sits in the configuration group, which follows its Advanced rows. That group shows or hides everything in it, so the grid keeps itself hidden on non-IMEX printers (IMEXModesCtrl::set_applicable). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
5072f6b614 | Merge branch 'main' into belt-printer | ||
|
|
d09850c528 | Merge branch 'main' into main | ||
|
|
bf59db1053 | Merge branch 'main' into extruder-variants-ui-2 | ||
|
|
7d44b60ae4 | H2D X2D Multi Nozzle Size Printing Support (#14125) | ||
|
|
6cd5feed79 |
Remove Duplicate Includes and the Dead GCodeSender Sources (#16249)
46 files include the same header twice at file scope, outside any #if, 66 times in all: Model.cpp included Model.hpp twice, Utils.hpp <algorithm> and <string_view> twice, seven GUI headers <wx/dataview.h> and <wx/artprov.h> twice. The second include of each is removed. GCodeSender.cpp and GCodeSender.hpp have been commented out of libslic3r/CMakeLists.txt since 2022 and their only two includes are commented out as well. Both files go, with the commented lines, and the CMake entry for SLA/SupportTreeIGL.cpp, a file that no longer exists. |
||
|
|
798ca8272e |
Printer settings: build plate tilt is read-only on a belt printer
update_fff() derives build_plate_tilt_x/y from the belt tilt on a belt printer, so a value typed into those fields was silently overwritten. Disable the two fields while belt_printer is on. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
e39d6cc089 | Merge branch 'main' into belt-printer | ||
|
|
27418cea0f |
Merge branch 'main' into extruder-variants-ui-2
# Conflicts: # src/slic3r/GUI/Tab.cpp |
||
|
|
7fdfea6efa | Merge branch 'main' into main | ||
|
|
b805f2ffd6 | Fill a new extruder's machine limits the same way as its other settings | ||
|
|
cc3769453f | Merge branch 'main' into pr/yw4z/16162 | ||
|
|
6639a32b0c |
Remove using namespace std from json_diff.hpp (#16222)
The directive sat at global scope in a header that DeviceManager.hpp includes, so most of the GUI compiled with all of std in the global namespace. 42 files had come to rely on it, mostly for string, vector and unordered_map, four of them for the ""sv and ""ms literals. Those sites are qualified. GCodeViewer.cpp spelled the type as std::vector<::string>, which only resolved through the directive. The files that use the ""sv and ""ms literals get a file-scope "using namespace std::string_view_literals;" or "using namespace std::chrono_literals;", as other sources already do. |
||
|
|
ef3c47135f |
Belt printer: retire the redundant and unused options (#16236)
Follow-up to #16195 and the review discussion on #14394 (yw4z's note about the third column on the *Belt tilt* row). Removes the belt options that are redundant or unused before the branch ships, so they never need compatibility handling after a release, and fixes supports under a leading overhang. Every removed key is on `handle_legacy()`'s ignore list, so existing profiles and 3MFs load silently. ## Removed - **`belt_slice_rotation_global`**, **`preslice_remap_global`**, **`belt_preslice_global`** (*Global mesh transforms*) and **`gcode_back_transform`** — the global mode and the back-transform are what belt printing is; they are presumed on wherever the flags were consulted (`PrintObjectSlice`, `BeltBackTransform`, `BeltGCode`, `Print::process`, `PrintApply`, `GCodeViewer`). The *Belt tilt* row is axis + angle only; the three `fdm_belt_common.json` drop the keys. - **`preslice_remap_x/y/z`** — no profile used the pre-slice axis remap; the belt tilt axis plus the G-code axis remap cover the machines that exist, and its implementation only agreed with itself for a plain swap. The forward transform is the rotation. - **`belt_support_z_offset_mode`** and **`belt_support_floor_mode`** — the first was never read by a generator; the second's only shipped value (*Generator only*) is now the behaviour. - **`first_layer_plane`**, **`first_layer_plane_offset`**, **`first_layer_plane_thickness`** and `FirstLayerPlane.{cpp,hpp}` — the first-layer band is measured from the belt surface and is one first layer height thick. - `belt_brim_instances_compatible()` and its validation warning: instances along the belt get their brim. ## Supports under a leading overhang (the clipping at the object's local Z = 0) The slicing frame of a belt object started at its lowest vertex, but the belt under the leading end of an overhang lies below that, so no generator could reach it: normal supports stopped at the object's lowest layer, and both tree generators carried extension hacks sized from the pre-rotation bbox and capped at global Z = 0 (right only for the trailing half of the belt). The frame now starts at the lowest belt-floor point under the footprint, less a 10 mm margin along the belt for the base of a support column, and the extensions are gone: - **Normal supports** run in the object frame and get the global belt Z offset shifted onto the result (as organic already did). With the offset on the object layers, a top contact at negative Z turned the intermediate-layer count negative and the generator allocated layers until the kernel killed it — any overhang in the leading half of the belt did this. The first-layer flange expansion is skipped on a belt (the first support layer is the leading tip, not a flange). - **Classic tree** nodes keep dropping until their whole circle is in the belt, so a branch tapers to a tip on the belt instead of stopping a radius above it. - **Organic**: the belt is no longer a support blocker. A blocker is a collision, and a branch descending onto one slides off it, down the belt and ahead of the part; the belt is where branches end, which the per-layer floor clipping already does. Regression test *Belt supports reach the belt under a leading overhang*: a cube with a fin whose underside is parallel to the layers, 20 mm ahead of the cube and up to 41 mm of slicing Z above the belt, for normal, organic and classic tree supports; the lowest support layer must sit on the belt beneath its own lines. The belt object height (the layer range) is now estimated from the box of the mesh as placed on the bed. `raw_bounding_box()` has the instance's Z offset removed, which was harmless for the old rotated-extent estimate but not for one anchored at the belt floor (a point's rotated z and the floor under it move in opposite directions under a Z shift): with the first version of this change every part came out as a wedge, sliced only up to its diagonal, in the GUI and CLI alike. Caught by a GUI test pass; the leading-overhang test now also checks that the whole part is sliced. ## Belt brim after the parallel support step `belt_brim_obstacles()` reads every object's layers and support layers, which another object's support step rebuilds (and now shifts) at the same time. The brim is generated sequentially once the parallel step is over (`PrintObject::generate_belt_brim()`). This is the race behind the Windows arm64 segfault in *Belt brim of each object precedes its perimeters on its own filament*. ## UI - *Belt tilt* is two rows: the angle (Advanced) and the axis (Developer; a profile-level kinematics choice). A shared line is shown by its first option's mode, so they cannot share one. - *Machine frame transforms* is five single-option rows (G-code remap X / Y / Z, Decouple machine-frame tilt, Machine-frame tilt angle — the angle row only appears when decoupled) instead of two multi-column lines; the remap fields got full labels since they stand alone now. - The gravity indicator on the bed is a plain line along the up direction (no cone, 60 % of the axes' length), per yw4z. - The *Show raw G-code (belt only)* legend/canvas toggle and its `B` shortcut are gone; the preview is the designed view. Also carries the two-line `phong.fs` fix from #16226 (merges as a no-op). ## Verification - `libslic3r_tests` 1116 passed (92 648 assertions); `fff_print_tests` 351 passed (561 696 assertions). - `scripts/clang_tidy_diff.py --base upstream/belt-printer`: no findings. - `scripts/orca_profile_tool.py check`: no profile references a removed key. - GUI target builds; a scripted GUI pass (xdotool) checked the settings groups in every mode, slicing, export, instances, the purge tower, calibration dialogs, the wizard, printer switching and 3MF round-trip. The wiki pages (OrcaSlicer/OrcaSlicer_WIKI#374) get a follow-up dropping the removed sections once this is in. |
||
|
|
ba5ecc5470 | Edit the selected extruder's machine limits on the Motion ability page | ||
|
|
82349e1ba4 | Give each extruder its own machine limits | ||
|
|
dda58b07cd |
Belt printer: supports reach the belt under a leading overhang
The slicing frame of a belt object started at its lowest vertex, but the belt under the leading end of an overhang lies below that, by the overhang's length times the tilt's shear. Every support generator works in layers at z >= 0, so none of them could reach it: normal supports stopped at the object's own lowest layer, and the two tree generators each carried a stack of hacks to extend themselves below it (a post-hoc copy of the lowest base area in TreeSupport, "virtual belt raft layers" in TreeSupport3D/TreeModelVolumes), sized from the pre-rotation bbox and capped at global z = 0, which is only right for the trailing half of the belt. Start the frame at the lowest belt-floor point under the footprint instead, less a 10 mm margin along the belt for the base of a support column (BeltSliceStrategy::apply_preslice_transforms and BeltTransformPipeline::compute_belt_height_and_floor agree on it). The layers between it and the first vertex come out empty, which belt slicing already tolerates, and the generators need no extension at all: - normal supports: the generator anchors its layer grid at the frame origin, so run it in the object frame and shift the global belt Z offset onto the result afterwards, as organic supports already did. With the offset on the object layers a top contact at negative z turned the intermediate-layer count negative and the generator allocated layers until the kernel killed it (any overhang in the leading half of the belt). Drop the first-layer flange expansion on a belt: the first support layer is the leading tip of the support, not a flange, and inflating it put lines in the air ahead of the belt. - classic tree: a node now keeps dropping until its whole circle is in the belt, so the branch tapers to a tip on the belt instead of stopping, a radius above it, when its centre crosses. - organic: the belt is no longer a support blocker. A blocker is a collision, and a branch descending onto one slides off it, down the tilted belt and ahead of the part; the belt is where branches end, which the per-layer m_belt_floor clipping already does. The belt brim is generated after the parallel support step instead of inside it: belt_brim_obstacles() reads every object's layers and support layers, which another object's support step rebuilds (and, now, shifts) at the same time. This is the race behind the Windows arm64 segfault in "Belt brim of each object precedes its perimeters on its own filament". Also: the belt tilt axis moves to Developer mode as its own row (a shared line is shown by its first option's mode), first_layer_plane band thickness, belt_support_floor_mode, belt_preslice_global and gcode_back_transform are retired and presumed on, the gravity arrow is a plain line along the up direction, and the "Show raw G-code (belt only)" preview toggle is gone. Regression test: "Belt supports reach the belt under a leading overhang" slices a cube with a fin whose underside is parallel to the layers, 20 mm ahead of the cube and up to 41 mm of slicing Z above the belt, for normal, organic and classic tree supports, and checks that the lowest support layer sits on the belt beneath its own lines. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
7f749ee02b | Merge branch 'main' into belt-printer | ||
|
|
8039d4d2ac |
Belt printer: retire the redundant and unused options
Removed, with the keys added to handle_legacy()'s ignore list so saved
profiles and 3MFs keep loading:
- belt_slice_rotation_global and preslice_remap_global. Both were only
consulted when belt_preslice_global ("Global mesh transforms") was off,
which no profile does; belt_preslice_global is now the single global
mode and is presumed on everywhere the old flags were ORed in
(PrintObjectSlice, BeltBackTransform, BeltGCode, Print::process,
PrintApply). The Belt tilt row is axis + angle only.
- preslice_remap_x/y/z. No profile used the pre-slice axis remap; the belt
tilt axis plus the G-code axis remap cover the machines that exist, and
its implementation only agreed with itself for a plain swap (matrix
columns vs remap_bbox rows). BeltTransformPipeline::build_preslice_remap,
remap_bbox and has_preslice_remap are gone, the forward transform is the
rotation, and the G-code header no longer carries the remap.
- belt_support_z_offset_mode. Saved and invalidated steps, but no support
generator read it.
- first_layer_plane and first_layer_plane_offset, with FirstLayerPlane.cpp.
On every shipped configuration the band is measured from the belt
surface (GCode::belt_height_above_floor) and the evaluator was only
reached for an explicit XY/YZ/XZ choice or a non-zero offset, which
nobody set. first_layer_plane_thickness stays as the band unit,
relabelled "First layer band thickness".
UI: the Machine frame transforms group is five single-option rows (G-code
remap X / Y / Z, Decouple machine-frame tilt, Machine-frame tilt angle;
the angle row is shown only when decoupled) instead of two multi-column
lines, and the remap fields carry full labels.
Also carries the phong.fs struct fix from #16226 so the worktree build
links its shaders.
libslic3r_tests and fff_print_tests pass; clang-tidy diff check clean;
orca_profile_tool.py check clean.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|