Commit Graph
28927 Commits
Author SHA1 Message Date
Clifford GarwoodandClaude Opus 4.7 2b7f438887 fix(imex): translate physical→logical when marking is_extruder_used for IMEX active tools
is_extruder_used is a logical-filament-slot indexed bool array — start-gcode
templates use it as `is_extruder_used[N]` where N is a logical filament slot
(matches how the rest of the codebase consumes per-filament arrays like
filament_settings_id, nozzle_temperature_initial_layer, etc.).

`tool_ordering.all_extruders()` returns LOGICAL slots and was correctly
marking those. But the IMEX-secondary marking added in 5aa624b025 was
writing PHYSICAL extruder indices straight into the logical array, mixing
index spaces. On any printer with physical_extruder_map size > 1 (MMU/AFC),
this marks the wrong slots and misses the right ones.

Symptom on the user's Neo XP 0.6 (pem [0,0,0,0,1,2,3,3]) in copy mode
[0:P,1:C] with object on slot 2 (PLA):
  - tool_ordering marks slot 2 (correct: object's filament).
  - IMEX active = [0, 1] (physical T0, T1) → mistakenly marks logical
    slots 0 (ABS) and 1 (ASA), neither of which is used.
  - Slot 4 (PLA on physical T1, the actual filament that loads on the
    secondary in copy mode) is NOT marked.
  - Start-gcode template emits EXTRUDER=ABS_temp EXTRUDER1=ASA_temp
    EXTRUDER2=PLA_temp; no EXTRUDER4.
  - PRINT_START macro reads t4=0, skips heating extruder1 — T1 stays
    cold during the print.

Translate physical → logical via resolve_filament_for_head before marking
(per-plate imex_head_filament_map override consulted, with first-routed
fallback when no override is set). This matches what the firmware actually
loads on each carriage during the parallel-mode print, and what the rest
of the IMEX hot path (PA emission, layer-change temperature) already does.

Result on the user's setup post-fix:
  - is_extruder_used[2]=true (object), is_extruder_used[4]=true (T1 in copy).
  - Start-gcode emits 2 temps for the actually-used filaments.
  - extruder1 heats correctly to slot 4's temp before the print begins.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 05:07:34 -04:00
Clifford GarwoodandClaude Opus 4.7 c8e7c5678b fix(imex): primary's filament lookup must come from object assignment, not pem default
The pre-slice warning's primary-tool filament lookup (added in
fbc58d2a1d) used resolve_filament_for_head, which returns the FIRST
slot routed to the primary's physical extruder via pem. That's the
right rule for *secondaries* (no object owns them in copy/mirror mode;
filament comes from the per-plate imex_head_filament_map override) but
wrong for the *primary*: the primary prints the actual objects on the
plate, and the slot it uses is whatever the user assigned to those
objects — not whatever happens to be at the head of the AFC manifold.

Symptom on the user's Neo XP 0.6:
  - pem = [0,0,0,0,1,2,3,3] (slots 0-3 share AFC manifold on physical T0)
  - filaments: slot 0 ABS, slot 2 PLA, slots 4-6 PLA, etc.
  - object assigned to slot 2 (PLA), IMEX mode "copy" (T0 primary, T1 copy)
  - User picks slot 5 PLA for T1 via the IMEX ghost picker (writes a
    per-plate imex_head_filament_map).
  - Warning reads slot 0 (ABS) for primary because that's
    first_filament_for_physical_head(pem, 0). Fires "T0 ABS vs T1 PLA
    type mismatch" even though the actual print uses slot 2 (PLA) for
    the primary — slicer and warning disagree.

Split the lookup:
  logical_for_primary(physical_idx)
    Walks plate->get_extruders(true) (1-based slots used by objects on
    this plate), returns the first slot whose pem entry maps to
    physical_idx. Falls back to first_filament_for_physical_head if no
    object on the plate routes to this physical extruder (defensive).

  logical_for_secondary(physical_idx)
    Unchanged behavior: per-plate imex_head_filament_map override with
    first_filament_for_physical_head fallback.

The user-facing "T%d" labels still display the physical extruder index
(carriage identity); only the filament-info lookups change.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 05:07:34 -04:00
Clifford GarwoodandClaude Opus 4.7 0db99d21dd fix(imex): translate physical→logical when looking up filament info in pre-slice warnings
collect_imex_warnings parses imex_mode_active_tools to get the active tool
indices. Those are PHYSICAL extruder indices (one per carriage). It then
used those same indices to look up filament_presets[tool_idx] and
bed_temps[tool_idx] — but both arrays are indexed by LOGICAL filament slot.

For MMU/AFC layouts where multiple logical slots feed one physical
extruder (e.g. AFC manifold: 4 lanes on physical T0), the warning would
report the wrong filament: a secondary on physical T1 would be named with
filament_presets[1] (= AFC lane 2) instead of the actual filament on T1.

Symptom: in IMEX parallel mode on the user's IQEX-AFC printer (pem
[0,0,0,0,1,2,3]), the multi-extruder warning called the secondary tool
"T1" but reported the filament type for logical slot 1 (an AFC lane),
not the actual filament 4 routed to physical T1.

Translate physical → logical via effective_physical_extruder_map (with
per-plate imex_head_filament_map override) before indexing into
filament_presets and bed_temps. The displayed "T%d" still shows the
PHYSICAL extruder number — that's the carriage identity the user sees
on hardware. Only the filament-info lookup is changed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 05:07:34 -04:00
Clifford GarwoodandClaude Opus 4.7 6e176434d0 docs(imex): document physical-vs-logical index distinction
Three IMEX bugs of the same shape have surfaced over the lifetime of
this feature:
  - Inline pem lookup duplicated at two PA emission sites
  - Pre-slice warnings indexing filament_presets by physical index
  - Ghost color resolution with stale default pem handling

Each was a place where a per-filament array got indexed by what the call
site had on hand (a physical T-number) without translating through
physical_extruder_map. On non-MMU/non-AFC printers the indices coincide
and nothing breaks; on AFC layouts the slicer reads the wrong filament
preset for a carriage with no error or log line.

Add a header comment block to IMEXHelpers.hpp describing the two index
spaces, when each is used, how to translate, and a list of the bugs we
hit so future contributors can recognize the pattern.

The constant kImexPrimaryMode and the helper declarations follow this
block; readers searching for pem helpers will land on the guidance first.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 05:07:34 -04:00
Clifford GarwoodandClaude Opus 4.7 d329fce6b0 Merge branch 'tests/imex-coverage' into feedback
Brings in the IMEX test coverage (PA per-firmware, Temperature per-firmware,
[Variant] expansion, 3MF round-trip, imex_pem_tool_for helper + tests, and
the cherry-picked variant-truncation regression test).

Resolution notes:
- Two GCode.cpp call sites for set_pressure_advance had divergent edits:
    * tests/imex-coverage rewrote them to use the new imex_pem_tool_for
      helper (commit c2492ccc47), eliminating the inline parallel-mode
      check entirely.
    * feedback replaced the literal "primary" with kImexPrimaryMode in the
      same lines (commit 085f5ccec8).
  Resolution: keep the helper-call form. The kImex change is moot on lines
  the helper replaces, and imex_pem_tool_for in IMEXHelpers.cpp is also
  updated to use kImexPrimaryMode for consistency with the rest of the
  codebase.

- Test test_3mf.cpp updated for upstream's load_bbs_3mf signature change
  (PR adds is_orca_3mf out-parameter between is_bbl_3mf and file_version).
  All three call sites in the new IMEX 3MF round-trip tests pass &is_orca
  in addition to &is_bbl.

Full regression post-merge:
  libslic3r:    143 cases / 48,553 assertions  (+10 cases from new tests)
  fff_print:     24 cases /    245 assertions  (+10 cases from new tests)
  sla_print:     21 cases / 14,100 assertions
  libnest2d:     14 cases /    488 assertions
  slic3rutils:    3 cases /      3 assertions

All tests pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 01:17:27 -04:00
Clifford Garwood 357fcb374d Merge remote-tracking branch 'upstream/main' into feedback 2026-04-25 00:46:48 -04:00
Clifford GarwoodandClaude Opus 4.7 212f81446c refactor(imex): convert remaining "primary" literals in GCodeViewer
Follow-up to 085f5ccec8. Self-review of that commit's grep output missed
GCodeViewer.cpp. Three sites in the layer-preview multi-carriage marker
logic still compared against the bare "primary" literal:

  - GCodeViewer.cpp:1538 — process-preset mode default
  - GCodeViewer.cpp:1542 — per-plate mode override gate
  - GCodeViewer.cpp:1551 — secondary marker computation gate

All three now use kImexPrimaryMode. The file already includes
IMEXHelpers.hpp (line 13) so no new include needed.

Verified by grepping the full IMEX-touching set: only IMEXHelpers.hpp
itself (the constant definition) still references the literal string,
which is correct.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 00:42:51 -04:00
Clifford GarwoodandClaude Opus 4.7 7dcb74e504 docs(imex): document inputs of build_imex_cache_key
The IMEX zone cache key drives ghost rebuild and zone-overlay
invalidation. Adding a printer config option that affects zone geometry,
ghost transforms, or collision strips without extending the key produces
a silent staleness bug: the cache thinks the zones are still valid and
ghost meshes / overlays don't refresh after the new option changes.

Document what currently feeds the key and pin the precision convention
(*10 scale on float values for 0.1 mm resolution) so future contributors
know the contract and where to extend it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 00:32:42 -04:00
Clifford GarwoodandClaude Opus 4.7 4e0a2704b9 refactor(imex): consolidate IMEX active-tools parsing through one helper
GCode.cpp's static get_imex_active_tools() inlined its own "phys[:role]"
tokenizer with subtly different semantics from IMEXHelpers'
parse_imex_active_tools — only the GCode version bounded against
MAXIMUM_EXTRUDER_NUMBER. Three other call sites (PartPlate zones,
GCodeViewer legend, Plater warnings) routed through parse_imex_active_tools
already.

Move the bounds check into parse_imex_active_tools so all consumers get
it consistently, then rewrite get_imex_active_tools to do only the
Print-extraction portion (active mode lookup, tools-string fetch) and
delegate token parsing to the helper. Keeps Print out of IMEXHelpers'
include set.

No behavior change for the non-pathological case (mode strings have always
parsed identically); for indices >= MAXIMUM_EXTRUDER_NUMBER (64) the three
older call sites silently filter them out now where previously they would
have accepted them — this matches what get_imex_active_tools already did.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 00:32:34 -04:00
Clifford GarwoodandClaude Opus 4.7 085f5ccec8 refactor(imex): replace "primary" magic string with kImexPrimaryMode constant
Across 6 files the literal "primary" string was the sentinel for "no IMEX
parallel mode active" — used for short-circuiting in serialization, ghost
visualization, zone calc, popup-menu list construction, the IMEXModesCtrl
non-deletable first row, and several layer-of-export checks. A typo in
any one would silently bypass the guard.

Define kImexPrimaryMode in IMEXHelpers.hpp with a docstring describing
what equality with it means semantically, and route every call site
through it. No behavior change.

Touched: bbs_3mf.cpp, GCode.cpp, PartPlate.cpp, Plater.cpp, Tab.cpp.
The bbs_3mf and Tab files now include IMEXHelpers.hpp; the other three
already did.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 00:32:22 -04:00
Clifford GarwoodandClaude Opus 4.7 efa9d65cb4 fix(imex): code-review nits — null check, cache-key precision, lambda capture
Four quick-fix items surfaced by pre-PR self-review.

GCodeViewer.cpp:1607
  Null-check get_curr_plate() before dereferencing. Other call sites in
  the file already guard; this was the only unguarded one in the IMEX
  layer-preview path. In practice m_plate_list always has a plate, but
  the inconsistency is easy to fix and removes the only ungated deref.

PartPlate.cpp:build_imex_cache_key
  Cache key for IMEX zone geometry truncated nozzle_clearance_x/y to int
  before stringifying — a config change from 30.0 to 30.5 would not
  invalidate the cache. Match the *10 precision pattern already used for
  imex_carriage_margin so 0.1 mm steps invalidate correctly.

Plater.cpp:select_plate_by_hover_id (right-click popup)
  Two issues:
  1. Lambda captured `modes` by reference. PopupMenu() is synchronous
     today so the reference outlived the menu's event handling, but the
     pattern is fragile — anyone refactoring to async Popup() would
     silently dangle. Capture by value.
  2. Used wxID_HIGHEST + i for menu item IDs — standard wx anti-pattern
     because it can collide with other handlers listening in that range.
     Allocate per-item IDs via wxNewId() and look up the chosen mode by
     finding the event ID in a parallel vector. The lookup becomes O(N)
     instead of O(1) but N is small (mode count) and this is clicker
     latency, not a hot path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 00:07:35 -04:00
Clifford GarwoodandClaude Opus 4.7 7b9070d521 fix(gcode): restore BBL initial-filament PA emission removed in error
af59501f4a ("feat: firmware-agnostic per-tool PA emission for IMEX
parallel modes") inadvertently deleted the BBL-specific PA emission for
initial_non_support_extruder_id while adding IMEX per-tool PA support.
That deletion was scope creep into core BBL functionality and not part
of the IMEX feature.

Restore the original block verbatim. The new IMEX-parallel-modes PA
emission (per-secondary-tool, gated on m_imex_parallel_mode) is left
untouched — that's legitimately IMEX scope. BBL printers in non-IMEX
mode now get back the pre-PR initial-PA behavior.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 00:04:41 -04:00
Clifford GarwoodandClaude Opus 4.7 ee757dac20 test: address self-review findings on [Variant] and [3mf][IMEX] coverage
Self-review found two weaknesses in the preceding test commits:

1) The equal-size [Variant] scenario claimed to distinguish the truncation
   guard's `cur > target` predicate from a regression to `cur >= target`,
   but both paths yield identical child values in practice: when
   extruder_variant names match, set_with_restore's variant_index is fully
   populated (no -1 slots) and the merge path restores every position from
   backup — producing the same {1.5, 2.5} output as the skip path. The
   test passes in both guard states.

   Rewritten to use mismatched variant names between child and parent.
   variant_index then has -1 slots, and set_with_restore overwrites those
   positions with parent values. Now the merge path yields {0.8, 0.8} and
   the skip path yields {1.5, 2.5} — observably different. Verified:
     - `cur >  target` (correct):  4 scenarios pass, 15 assertions
     - `cur >= target` (regressed): equal-size scenario fails with
       "1.5 is within 0.000000001 of 0.80000000000000004"
     - Guard removed entirely: child>parent + stride=2 both fail with
       truncation ("1 == 2" / "2 == 4")

2) The [3mf][IMEX] round-trip only covered a single plate. A plate-
   indexing regression (IMEX metadata landing on the wrong plate, or
   bleeding across plates on reload) would not have been caught.

   Added a multi-plate scenario: two plates with distinct mode and
   head-filament-map values. Asserts both land on their respective
   destination plates after reload. Load-bearing verified:
     - With IMEX serialization intact:    3 scenarios pass, 45 assertions
     - With IMEX serialization disabled:  positive + multi-plate fail
       (both "nullptr != nullptr"); primary-mode passes (expects nullptr)
     - With primary-mode short-circuit removed: primary-mode scenario
       fails ("0x... == nullptr") because primary modes now serialize

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-24 23:29:01 -04:00
Clifford GarwoodandClaude Opus 4.7 b45d8a5b7b test(gcode): per-firmware coverage for GCodeWriter::set_temperature(tool)
Four scenarios cover the temperature emission surface that IMEX layer-change
handling routes through (Tier 1 of the deferred Target B test plan —
pure-function-only, no fixture).

- Per-flavor command routing: Marlin (M104), RRF (G10 — M104 is deprecated
  on RRF), Mach3/Machinekit (P-prefix for value instead of S).
- Wait handling: Marlin emits M109, MakerWare/Sailfish silently drop wait
  requests (the firmware doesn't support blocking waits), Teacup and RRF
  both emit a separate M116 poll.
- Per-tool qualifier for IMEX secondary carriages: Marlin and Klipper
  emit T<N>, RRF uses P<N> (same P override as its wait poll). This is
  exactly the path that lets IMEX set secondary-tool layer temperatures
  without a tool-change.
- Instance overload's multi-extruder gating: a tool index passed to a
  single-extruder GCodeWriter is discarded (no spurious T0 on
  single-tool printers), but a multiple_extruders writer passes it
  through verbatim.

All 24 assertions in 4 cases pass under [Temperature].

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-24 23:08:57 -04:00
Clifford GarwoodandClaude Opus 4.7 c2492ccc47 refactor(imex): extract imex_pem_tool_for helper + unit tests
The physical_extruder_map translation used by IMEX per-tool PA emission was
inlined identically at two sites in GCode.cpp (tool-change and second-layer
transition). Extract to IMEXHelpers so the routing rule ("parallel mode AND
populated pem → physical index, else -1") is testable in isolation and the
call sites read as intent rather than re-deriving the conditional.

Production change is behavior-preserving:
- Same predicate (`!mode.empty() && mode != "primary"`)
- Same empty-pem short-circuit returning -1
- Same get_at() dispatch on hit
- Both call sites replaced with a single call

Four unit tests in [IMEX] cover the routing matrix:
  - non-IMEX ("") and primary mode short-circuit
  - parallel mode + empty pem short-circuits (defense-in-depth; get_at would
    throw on empty values otherwise)
  - identity pem (non-MMU IDEX) routes filament to itself
  - MMU collapse routes multiple logical slots to one physical (7-slot profile
    with 4-lane MMU on physical 0 and direct drives on 1/2/3)

All IMEX + Variant regression suites pass post-refactor (133 assertions / 48
cases under libslic3r, 25 assertions / 6 cases under fff_print [PressureAdvance]).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-24 23:07:23 -04:00
Clifford GarwoodandClaude Opus 4.7 cb15f35444 test(3mf): round-trip coverage for per-plate IMEX state
Validates that imex_parallel_mode and imex_head_filament_map survive a
full store_bbs_3mf → load_bbs_3mf cycle — the same silent-state-loss bug
class that produced the variant-vector truncation regression, applied to
IMEX plate state which rides the same XML metadata path.

- Positive round-trip: a plate with copy_mode + a non-trivial head
  filament map ("1:2,2:3") is saved and reloaded; both options land on
  the destination plate's config with the exact values preserved.
- Guard scope: a plate with mode="primary" and empty head-filament-map
  does NOT emit metadata (per the serializer's short-circuit), and the
  reload leaves both options absent from the destination config. If the
  serializer ever regressed to writing primary-mode plates, the load
  path would surface phantom "primary" strings on plates that shipped
  clean — this catches that.

Both scenarios call set_temporary_dir to point the BBS exporter's backup
scaffolding at a writable per-process temp directory (by default it
resolves under root at runtime, which fails for non-root test
processes).

All 27 assertions in 2 test cases pass under [3mf][IMEX].

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-24 22:58:19 -04:00
Clifford GarwoodandClaude Opus 4.7 5434a5217c test(gcode): per-firmware coverage for GCodeWriter::set_pressure_advance(tool)
Exercises the IMEX per-tool PA emission surface added in af59501f4a
("feat: firmware-agnostic per-tool PA emission for IMEX parallel modes").
Six scenarios cover the full routing matrix:

- Negative PA returns empty across all flavors (early-exit guard).
- Klipper: bare vs EXTRUDER=extruder vs EXTRUDER=extruderN. Asserts the
  tool=0 case emits the unsuffixed extruder name (first Klipper extruder
  is named "extruder", not "extruder0") — a subtle edge case easy to
  regress.
- RRF: bare vs D0 vs DN. The D0 case matters: passing tool=0 explicitly
  must emit `D0`, not the current-tool fallback.
- Marlin 2.x: bare vs T0 vs TN.
- Marlin Legacy: tool index is silently dropped — verifies the fallback
  branch can't accidentally start emitting T qualifiers on firmware that
  doesn't support them.
- BBL: flag wins over firmware flavor (Marlin 2 flavor + BBL flag emits
  the BBL-specific `M900 K... L1000 M10`) and BBL never emits a per-tool
  qualifier regardless of the tool argument.

All 25 assertions across 6 cases pass under [PressureAdvance].

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-24 22:53:24 -04:00
Clifford GarwoodandClaude Opus 4.7 af8fe649ef test(preset): expand [Variant] coverage — stride=2, equal-size, non-variant guard
Adds three scenarios alongside the existing child>parent stride=1 regression
test for update_non_diff_values_to_base_config:

- stride=2 child>parent: machine_max_acceleration_x (size 4 vs 2) — confirms
  the truncation guard fires for the (normal,silent)-pair stride=2 path, not
  just stride=1. Catches a regression class the existing test would miss
  because stride=2 routes through normalize_stride2_floats and a different
  set_with_restore call site.

- equal-size (2=2): exercises the path the guard does NOT short-circuit;
  asserts child per-extruder values survive set_with_restore's nil-restore
  merge. Catches any future change that breaks the equal-size merge — the
  fix's `cur > target ? skip` predicate could regress to `cur >= target` and
  silently override child values otherwise.

- non-variant scalar: layer_height in `keys` and `different_keys` but absent
  from printer_options_with_variant_1/_2. Hits the is_scalar() / "nothing to
  do" branch and must remain untouched. Scopes the guard's blast radius.

All four scenarios in the [Variant] tag pass: 15 assertions, 4 test cases.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-24 22:49:59 -04:00
Clifford GarwoodandClaude Opus 4.7 6ed688dfc5 test(preset): regression test for child>parent variant-vector truncation
Adds a Catch2 scenario that builds a 2-extruder child DynamicPrintConfig
inheriting from a 1-extruder parent, calls update_non_diff_values_to_base_config
through the real printer_options_with_variant_1 / _2 key sets, and asserts
that printer_extruder_id, printer_extruder_variant, and retraction_length
retain their full size after the merge. Covers three distinct
set_with_restore<T> instantiations (Ints, Strings, Floats) and verifies
both size preservation and per-extruder value preservation.

Verified load-bearing: with the guard in update_non_diff_values_to_base_config
temporarily removed, the test fails with "1 == 2" on pe_id.values.size() and
retraction_length.values.size(); with the guard restored, all six assertions
pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-24 20:42:57 -04:00
Noisyfox 37de679533 Fix crash on launch caused by ref of tmp object (#13341) 2026-04-25 00:11:23 +08:00
Noisyfox 6e30443c62 Fix issue that filament combobox not working after adding extruder (#13194) 2026-04-24 22:29:26 +08:00
2af2f0f98b enh: flow rate pattern calibration menu (#11956)
* feat: Add flow rate calibration pattern selector dialog

* feat: Integrate PR #11881 and improve Flow Rate Calibration Wizard

- Integrated PR #11881: Display layer duration in G-code viewer position window.
- Enhanced Flow Rate Calibration:
    - Implemented a Wizard dialog (FlowRateCalibrationDialog) using DPIDialog for Dark Mode support.
    - Restricted pattern selection to 'Archimedean Chords' and 'Monotonic'.
    - Integrated logic to pass the selected pattern to the calibration generation.

* fix(UI): Refactor FlowRateCalibrationDialog to calib_dlg for macOS build fix and UI consistency

Moved FlowRateCalibrationDialog from MainFrame.cpp to calib_dlg.hpp/.cpp to resolve build errors on macOS. Updated UI to match Pressure Advance calibration dialog style (Dark Mode support, RadioGroups). Logic moved to dialog class.

* Update Wiki link for flow rate calibration

* ui: replace RadioGroup with BitmapComboBox for Flow Rate pattern selection

* fix(ui): use custom ComboBox widget for Flow Rate Calibration

Replaces wxBitmapComboBox with OrcaSlicer's custom ComboBox widget to fix rendering issues on Windows (empty selection) and compilation errors on Linux.

* Refactor: Cleanup unused includes and members in FlowRate calibration dialog

* Fix: Complete rename of Flow Rate to Flow ratio in calibration menus after merge

* Fix: Update Flow Rate to Flow Ratio in Calibration Dialog and Wiki Link

---------

Co-authored-by: yw4z <ywsyildiz@gmail.com>
Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-04-24 21:39:32 +08:00
Ian Bassi 91f54a07b9 Fix bug template: Wrap nightly build link in bug template (#13337) 2026-04-24 09:09:00 -03:00
Yevhen 09d5c92f6a fix gaps between walls and sparse infill, issue #12304 (#12770) 2026-04-24 18:36:00 +08:00
David Martínez Moreno b30470a714 Fix the OnText handler in ObjectTableDialog to close on Esc. (#12979)
The OnText handler in ObjectTableDialog catches WXK_ESCAPE but swallows it.  Invert the logic to call Close() on Esc, and pass anything else to evt.Skip().

While at it, fix a typo in the dialog's title.
2026-04-24 16:52:25 +08:00
yw4z 66eb5fc4f4 Add option to place window buttons on left side for Linux (#12831)
init
2026-04-24 16:51:00 +08:00
yw4zandIoannis Giannakas a5171b902d Fix vertical alignment issues (Printer name, Clone progress) (#13133)
init

Co-authored-by: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com>
2026-04-24 16:29:29 +08:00
a274b0e0ac CGAL Fix Model: New for Linux and Mac (#12155)
* CGAL Fix Model

Multi OS fix model with CGAL

Co-Authored-By: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

* Clean unused variables

* Early exit

* Validation

* Orca comments

* Steps to fix

* Simplify fixer

* BY10 to BYCGAL Full refactor

* repair_polygon_soup

* Revert "repair_polygon_soup"

This reverts commit cb88841e7a72a42c148e144fbf0cab146a54c3c8.

* CGAL 6.1.1

Update CGAL.cmake

* Update MeshBoolean.cpp

* Revert "CGAL 6.1.1"

This reverts commit c581887adb5f84ec4af97b320067b152f8812f49.

* Funca with RF

New remake, it seems to be working fine...
por ahora

Co-Authored-By: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

* Update src/libslic3r/MeshBoolean.cpp

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

* Include cleanup

Co-Authored-By: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

* Update Part list

Revert "Update Part list"

This reverts commit 95cab337d7ea602682ee00be2986ef941d0b06c2.

Reapply "Update Part list"

This reverts commit e401bec579f64b97e3f6deeb4131a8e5a79a146d.

* Comments

* Update FixModelByCgal.cpp

* Remove no 3d parts

Co-Authored-By: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

* Remove netfabb and w10 sdk

Co-Authored-By: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

* Update src/slic3r/Utils/FixModelByCgal.cpp

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

* redundant check

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Revet: suggestion from @RF47

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

---------

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-24 16:28:28 +08:00
Hanno WitzlebandHanno Witzleb c26b6a2ef0 Restructure Text/Emboss Tool UI (#12864)
* restructures text tool ui,
moves style selector over font,
moves reset buttons after settings,
matches style popup styling to font popup

* makes operation setting single-line

* makes "Advanced" button bigger, matching BambuStudio

---------

Co-authored-by: Hanno Witzleb <hannowitzleb@gmail.com>
2026-04-24 15:51:06 +08:00
Hanno WitzlebandHanno Witzleb babbdee5f5 Refactor Tooltip Button (#12848)
refactors tooltipbutton,
one common implementation,
one common shortcut data structure,
add tooltip button to text gizmo,
consistent shortcut wording

Co-authored-by: Hanno Witzleb <hannowitzleb@gmail.com>
2026-04-24 15:49:36 +08:00
Ian BassiandRodrigo Faselli 6f1b1b8767 Partial sacrificial bridge anchor fix (#13052)
* Partial sacrificial bridge anchor fix

Co-Authored-By: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

* Simplification

---------

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-04-24 14:53:53 +08:00
8bff921ade Require less clicks to change filament in object list (#12603)
* reduces number of clicks to change filament in objectlist

* dont set minimum width in dropdown if use_content_width == true

---------

Co-authored-by: Hanno Witzleb <hannowitzleb@gmail.com>
Co-authored-by: yw4z <ywsyildiz@gmail.com>
2026-04-24 14:48:59 +08:00
Hanno WitzlebandHanno Witzleb 0082b60852 Restructure Painting Tool UI Hierarchy (#12852)
restructure painting tools
place "On Overhangs only" checkbox under Overhand slider,
place "Vertical"/"Horizontal" checkboxes under pen size,
move some separators,
fix changing window width in MMUSegmentation,
show "Section View" slider for gap fill too

Co-authored-by: Hanno Witzleb <hannowitzleb@gmail.com>
2026-04-24 14:26:41 +08:00
Ian BassiandRodrigo Faselli dee9c0d72c Add extrusion role change G-code in Process and Filament (#11784)
* Add extrusion role change G-code options

Introduces new G-code options for handling extrusion role changes at the process and filament levels. Updates configuration, GUI, and GCode logic to support 'process_change_extrusion_role_gcode' and 'filament_change_extrusion_role_gcode', allowing custom G-code insertion when the extrusion role changes.

Co-Authored-By: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

* Optimize extrusion role-change gcode handling

Cache gcode template strings and current filament id, and guard creation of DynamicConfig/placeholder processing behind a check that at least one role-change gcode is non-empty. This avoids redundant config lookups and DynamicConfig/placeholder parsing when no custom role-change gcode is defined, improving clarity and performance without changing behavior.

---------

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-04-24 14:25:04 +08:00
Ian Bassi fd1aece9c7 Bug and PR Template enhancements (#13297)
* Add nightly build reproducibility checkbox

Add a required checkbox to the bug report template prompting reporters to verify the issue is reproducible in the latest nightly build (links to the nightly builds release). This helps catch issues already fixed in nightly releases and reduces duplicate reports.

* Add PR artifact download guide to template

Update the pull request template to include a commented section and a link to the OrcaSlicer wiki explaining how to download artifacts from a PR. This helps contributors and reviewers locate and retrieve build/test artifacts for verification and testing.
2026-04-24 14:22:26 +08:00
Ian Bassi 2b0a0023e0 3MF Export/Import Orca export tags (#12509)
* Using bbs versioning for bbs atributes

* Orca tags

* Bump SLIC3R version to match current BBS

* New import logic

* to_string_sf

* 2.3.2 No tagged

* Update comment
2026-04-24 14:21:44 +08:00
Ian BassiandRodrigo Faselli f8b0bcc725 Add Kinematics (Jerk & Accel) visualization support (#13169)
* Acceleration preview

Co-Authored-By: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

* Jerk visualization

* JD

---------

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-04-24 14:20:47 +08:00
Valerii BokhanandCopilot c30276ef24 Feature: Ability to set flow ratio for brims (#11876)
Fixes #11853

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-24 14:19:14 +08:00
Wachhund SkytowerandClaude Opus 4.6 1eb9a8efbd Fix Windows test linking: use main() instead of wmain() (#12939)
wxWidgets defines _UNICODE globally, which causes Catch2's
catch_main.cpp to provide wmain() instead of main(). This leads to
LNK2001 "unresolved external symbol main" for all test executables
when building with BUILD_TESTS=ON on MSVC.

Add DO_NOT_USE_WMAIN compile definition to Catch2WithMain target
so that Catch2 provides the standard main() entry point.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 14:07:24 +08:00
yw4z f9f5425a33 Fix: Could not load bitmap: printer_preview_ error causing crash on Linux (#12425)
Update Plater.cpp
2026-04-24 14:06:16 +08:00
Kegan Holtzhausen f1cacd89c0 Display number of tool changes after slicing #12464 (#12474) 2026-04-24 14:04:09 +08:00
Ian ChuaandSoftFever 9c046c7c24 Dedupe json traversal (#13334)
* WIP: benchmarking caching vs multi-thread parsing json

* stick to just caching, other functions does not seem to have any duplicate traversals

* Remove benchmarking code

* cleanup leftover code and clear cache when loading is done

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-04-24 13:54:09 +08:00
Kiss Lorand aa4dd7dfd5 Fix: Dirty-state marker ("*") not shown for edited system printer presets (#11900)
Fix missing dirty marker for edited system printer presets

System printer presets did not display the modified (“*”) marker in the sidebar when edited. Unlike other preset types, printer presets use `printer_model` as their display label, bypassing the normal dirty-state formatting.

This patch prepends the modified suffix to the displayed name when the selected system printer preset is dirty, restoring consistent UI behavior across all preset types.
2026-04-23 23:10:50 +03:00
Kiss Lorand 95ce474c8d Fix extrusion of some support layers at wrong Z height (#13327)
In some rare support edge cases, Orca could start extruding a new layer before moving to the correct Z height.

This happened when two support layers were generated back-to-back and the next layer started exactly where the previous one ended. In that situation, there was no movement that naturally updated the Z position first.

The code was clearing the “pending layer change” flag too early, so it lost track of the fact that a Z move was still required.

This change ensures that if a layer change is still pending, Orca will always move to the correct Z height before the first extrusion of that layer.

This guarantees that every layer starts at the correct height and fixes the missing / incorrect support layers seen in those edge cases.
2026-04-23 23:50:28 +08:00
Alexandre Folle de MenezesandCopilot 35b2b6212d Fix: Globally fixing the "milisecond" typo in the code (#13329)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-23 10:34:36 -03:00
Kiss Lorand 0c7e16aa36 Fix support preview artifacts (missing layers) (#13310)
Fix support preview artifacts caused by incorrect gap subdivision

Support generation could sometimes split a gap into too many steps,
even when it should fit exactly into a single layer.

This was most noticeable when max_suport_layer_height was equal to
the print layer height (e.g. 0.2 mm).

This resulted in incorrect support layering and visible artifacts
in preview.

The issue was caused by floating-point precision, where values that
should be equal to the configured limit were treated as slightly larger.

Fix by biasing the subdivision calculation with EPSILON so near-equal
values are not split into extra steps.

Applied consistently to:
- SupportMaterial (normal supports)
- TreeSupportCommon (tree stepping)
- TreeSupport (layer creation)
2026-04-23 10:20:06 -03:00
Damir Galeev ff3ad5ed98 Harden #5070 fix + disable dead change_part_type() via #if 0 (#13281)
* Restore SVG/text→Support crash guard (#5070), disable change_part_type()

The crash fix from #5070 prevented converting SVG/text modifiers to Support
Blocker / Support Enforcer by hiding those entries in the old SingleChoiceDialog
opened from ObjectList::change_part_type(). When the "Change type" UI was
reworked into a submenu that calls ObjectList::set_volume_type() directly, the
guard was left behind in the unused change_part_type() path -- the submenu path
had no protection, silently reintroducing the #5070 crash on the submenu route
(ModelVolume::set_type() does not clear text_configuration / emboss_shape, so
the stale emboss state stays attached to a support volume).

- Guard set_volume_type(): reject SUPPORT_BLOCKER / SUPPORT_ENFORCER when any
  selected volume is SVG or text, showing the same error as before.
- Wrap ObjectList::change_part_type() in #if 0 instead of deleting it: the
  function is unused since the submenu rework, but keeping it in commented-out
  form preserves traceability with upstream Bambu Studio (avoids merge
  conflicts on each BBL sync). Suggested by RF47, confirmed by ianalexis.

* Log instead of showing user error; action guard is defense-in-depth only

Per review feedback from RF47: with the UI-side guard in #13120, the
set_volume_type() action-time check is a pure safety net -- a healthy UI
should never let the user reach it. Showing a modal error dialog would
therefore either confuse a user who did nothing wrong (if the UI guard
is bypassed by a future refactor/plugin/shortcut) or be dead code at
runtime. Log the event for developers instead, keep the early return so
the crash is still prevented.
2026-04-23 10:12:18 -03:00
Kiss Lorand b2ce9f649f Fix air filtration/exhaust and chamber heater UI control (#12525) 2026-04-23 09:58:49 -03:00
Ian Bassi 709ec51712 Remove validation for Disabled Small area compensation (#12528)
Do not check if disabled
2026-04-23 00:22:34 +08:00
Rodrigo Faselli e99382da68 💥Fix crash svg use surface (#13262)
* Fix crash svg use surface

* unnecesarry header
2026-04-23 00:21:19 +08:00