Commit Graph
20090 Commits
Author SHA1 Message Date
RrrrobertB1992 e00f4b7008 Moonraker printer agents: report a color list for every slot (#16630)
Moonraker agents now send cols and ctype for every tray, the same fields the Bambu AMS sends. A single-color tray sends its one color with ctype 1. A multi-color spool sends all its colors once an agent fills the new AmsTrayData::tray_colors. Sending cols for every tray keeps update_filament_multi_color() from stopping at the first tray that has none.
2026-10-26 13:16:15 -05:00
Ian Bassi 0ef9015904 Ask for the size of a primitive when adding it (#16848) 2026-10-26 15:01:47 -03:00
Lam Wei Lun 0b4e7e9e2a Handle Unreadable Bundled uv Path in Python Plugin Init (#16888)
boost::filesystem::exists() threw on Windows error 1005 for the build-time uv path, which skipped the packaged uv fallback. Use the error_code overloads so an unreadable path counts as absent, and look up uv before scoped_interpreter is created so a failure there cannot leave the interpreter running.
2026-10-27 00:28:53 +08:00
HanifKoh a0e51b4044 Keep Cut Connector Holes at Full Depth While They Break Through the Cut Face (#16893)
Every connector hole was moved 0.05 mm toward the cut face so it would open
the face instead of leaving a coplanar skin. Moving the whole volume also
moved its far end, so a plug hole was 0.05 mm shallower than depth plus
tolerance, and each dowel hole 0.05 mm shallower than depth plus half the
tolerance.

Grow the plug and snap hole by the overlap at the face instead of moving it,
and cut each dowel half just past the plane so the holes keep their depth
and still overlap the face.

The connector tests now measure each hole from the cut face, which is what
shows the missing 0.05 mm, and also run on a tilted, shifted cut plane.
2026-10-26 22:45:30 +08:00
Ian Bassi b4772dca38 Add Order By to the plate menu (name, filament, height, size) (#16850) 2026-10-26 10:43:41 -03:00
Dipl.-Ing. Raoul Rubien, BSc 1f8111526c Fix GCC dangling-pointer, maybe-uninitialized and use-after-free warnings (#10750)
Give two Eigen `auto` locals in SLAPrint.cpp and Selection.cpp concrete types so they no longer refer to destroyed temporaries. Zero-initialize two vectors in GLGizmoBrimEars.cpp, and build each wxDataViewItem before its delete in ObjectDataViewModel::Delete.
2026-10-26 08:22:04 -05:00
Error404JoyNotFoundandHanifKoh 4a0d0bb553 Split the cut tool's dowel depth tolerance evenly between both holes (#16020)
Dowels are centered on the cut plane, so the extra depth from the tolerance already splits evenly between the two holes. Only plugs and snaps are now shifted along the cut normal.

The test fix that finds the cut parts by their position in the object is from HanifKoh.

Co-authored-by: HanifKoh <76276251+HanifKoh@users.noreply.github.com>
2026-10-26 08:13:16 -05:00
thereprocase bff0487b76 Fix CLI crash and dropped layers when loading filaments without colours (#16867)
Filament presets have no `filament_colour`, so loading two or more filaments in the CLI without `--filament-colour` left a one-entry palette. Code that sizes per-filament tables from it then read out of bounds, which crashed the slicer or dropped the layers for filament 2. The CLI now pads `filament_colour` to the filament count and rebuilds the flush matrix. Adds a CLI test that slices a per-layer change to filament 2.
2026-10-26 07:51:50 -05:00
TheLegendTubaGuy aa069d90fb Fix plates keeping stale objects after a cut (#16881)
The cut and "Delete all connectors" removed objects without telling the plates, so the plates kept counting objects by their old index. Prime tower previews showed another plate's filaments, and Select All picked up objects from other plates.

Removing a whole object now also removes every instance of it from the plates, not just the first one.
2026-10-26 07:46:30 -05:00
Noisyfox 13a40b47a2 Fix MSVC-only lazy preset dialog build failure (#16899)
* Fix MSVC-only build failures after MainFrame forward declarations

* Defer lazy preset dialog instantiation with unique_ptr

* Include memory directly for std::make_unique
2026-10-26 20:34:34 +08:00
Lam Wei Lun e021ccb316 Fix missing-plugin notices not appearing on preset switch (#16897)
The notices were rebuilt only during plate validation, so selecting a
preset that needs a missing plugin on an empty plate showed nothing.
new_project() cleared the notices but kept their shown state, so they
never came back.

Refresh the notices on every preset change or edit, when a plugin loads,
unloads or has a capability disabled, after a plugin is deleted or
unsubscribed, and at the end of new_project(). A notice that is no
longer on screen is pushed again even when its set of plugins is
unchanged.
2026-10-26 18:10:23 +08:00
SoftFever 10c38a54e1 Merge branch 'main' into feat/lane-data-filament-id-matching 2026-10-26 17:40:53 +08:00
SoftFever 20388f846d Resolve Moonraker lane filament_id through the shared AMS matcher 2026-10-26 17:30:42 +08:00
SoftFever 555321215e Add alpha and gradient support to custom AMS colors (#16538)
# Description

AMS custom colors now support alpha and ordered gradients through the
shared color picker. Printers advertising manual multicolor support can
edit up to four gradient colors; other printers retain single-color
editing with alpha. The picker accepts a per-caller gradient limit while
project editing and shared favorites retain their existing seven-color
limit. Canceling or confirming an unchanged seed preserves selections
that the editor cannot represent.

Filament previews composite translucent colors over a checkerboard,
including AMS custom swatches, circles and cards, the filament rack,
Change Filament menus, object-list selectors and feature-filament
selectors. Single-color AMS, external-spool and AMS Lite cards use the
same checkerboard renderer and alpha compositing as gradient cards, with
no separate SVG checkerboard cache. Rounded AMS card fills retain their
geometry and remaining-material bounds. Generated preview bitmaps use
opaque RGB storage after compositing so Windows menu conversion does not
corrupt the numbered labels; stored RGBA colors remain intact.

The rendering uses the existing graphics-context path without alternate
rendering fallbacks. Existing project/profile formats and device
permission checks are preserved.

# Screenshots/Recordings/Graphs

AMS now can have custom gradient with alpha up to 4 colors:
<img width="500" alt="image"
src="https://github.com/user-attachments/assets/c28c0ee6-aad2-41c8-ae03-b8bd25ce1da8"
/>


Checkerboard background for colors with alpha:
<img width="500" alt="image"
src="https://github.com/user-attachments/assets/de2af9e5-141f-4ab2-bcfe-561168c2435b"
/>


Bambu Handy should work too:
<img width="500" alt="98456ee77c51d79981ac50cd8f562e86"
src="https://github.com/user-attachments/assets/86951dbf-b898-4caa-9dc6-9407204f61fc"
/>
<img width="500" alt="b911c1c638ce71306ad1ac92587aea96"
src="https://github.com/user-attachments/assets/2f65c748-25fc-4bde-bbcf-305d0dfd3293"
/>


## Tests

- Windows, using the existing `build-dbginfo` / `RelWithDebInfo`:
`ALL_BUILD` and `slic3rutils_tests` build successfully.
- Focused native tests pass: 63 test cases, 5118 assertions, randomized
order. Includes AMS settings, device command payloads, color picker
validation and bitmap pixels, including 48 solid-versus-gradient
transparency comparisons.
- `node --test
resources/web/dialog/ColorPickerDialog/colorpicker.test.js`: 10 tests
pass.
- Manual GUI/device writeback and macOS/Linux runtime verification were
not performed.

[How to Download Pull Requests Artifacts for
Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts)
2026-10-26 17:26:19 +08:00
HanifKoh b1488b5c0c Fix Adaptive PA Speed When the Extrusion Inherits the Travel Feedrate (#16857)
The cooling buffer drops a G1 F that repeats the feedrate the preceding
travel, wipe or retraction already set, so an extrusion printed at the
travel speed reaches the adaptive pressure advance processor without a
feedrate line of its own. The processor only read standalone G1 F lines
and fell back to the last one it had seen, often the first layer's, so
the predicted pressure advance stayed at the first-layer value for the
rest of the print.

Track the feedrate every move with an F word sets, as the firmware does,
and use it for an extrusion that no G1 F precedes.
2026-10-26 16:36:56 +08:00
HanifKoh fbc50d3d3a Start a Creality Print Job From the Spool Holder When No CFS Slot Is Mapped (#16794)
CrealityPrint::start_print() chose between the plain opGcodeFile start and the
colorMatch + multiColorPrint pair by the model id alone, and inside the
multi-colour branch it fell back to the plain start only when a filament was
mapped onto box 0. A K1-family printer reports the same model id with and
without a CFS, and without one it never answers the boxsInfo query, so the send
dialog had no slots to map and the printer received a colorMatch with an empty
list followed by multiColorPrint. The job printed, but the firmware flagged
"no material" (materialStatus 1) for its whole duration. The same happened on
any CFS-capable model whenever the boxsInfo query failed.

Treat an empty mapping like a mapping onto the spool holder and send the plain
start with enableSelfTest, which is what Creality Print does when the printer
lists no colours. The command building moves into start_print_commands(), a
pure function, so the decision is unit-tested. Every plain start now reads the
printer's answer best-effort before closing, as the non-CFS start already did,
so the close frame never follows the command in the same burst.

Fixes #16695.
2026-10-26 15:27:20 +08:00
Noisyfox 0d7c956558 Merge upstream/main into dev/ams-custom-color-alpha-gradient 2026-10-26 15:18:06 +08:00
SoftFever c1119ee013 Merge branch 'main' into feat/lane-data-filament-id-matching 2026-10-26 14:55:37 +08:00
yw4zandNoisyfox 2dfcba390a Add color sampler to color picker dialog (#16587)
* init

* update icons

* Fix macOS color sampler compilation with Xcode

* add linux support

* add more guards for portal

---------

Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
2026-10-26 14:54:40 +08:00
Lam Wei Lun ab4ed386d0 Added missing headers. Does not build without precompiled headers 2026-10-26 14:43:26 +08:00
HanifKoh 12ce9d6fe6 Make the Discrete GPU a Linux Preference Instead of a Desktop-Entry Hint (#16875)
* Make the Discrete GPU a Linux Preference Instead of a Desktop-Entry Hint

The desktop entries asked the launcher for the discrete GPU with
PrefersNonDefaultGPU and X-KDE-RunOnDiscreteGpu. KDE and GNOME honour
that by adding the PRIME variables to every menu launch, so on a hybrid
laptop under Wayland the 3D view was rendered by zink on the GPU that
does not drive the display and its frames never reached the compositor:
an empty Prepare and Preview canvas from the menu, a working one from a
terminal.

Drop the two keys from the installed desktop file, the AppImage's
embedded entry and the entries the Desktop Integration dialog writes.
Add a "Render on the discrete GPU" preference (Linux, default off,
requires restart) that exports DRI_PRIME and, with the NVIDIA kernel
module loaded, the NVIDIA render-offload variables before GTK opens the
display. The GDK_BACKEND=x11 opt-in path exported them unconditionally;
it now leaves GPU selection to the preference as well.

The preference acts before GUI_App loads the configuration, so
AppConfig::peek_bool reads one app boolean straight from the saved file
and xdg_config_dir resolves the default Linux data dir the way the wx
code did; GUI_App's two copies of that lookup use the same helper, and AppConfig::config_path gained a
static form so the file name lives in one place.

* Share the Linux Data-Dir Lookup and Let DRI_PRIME Override the GPU Preference

default_data_dir() in libslic3r resolves the Linux data dir a start without
--datadir uses: a portable data_dir folder next to the executable, else the
XDG config dir. GUI_App::init_app_config and the discrete-GPU start-up code
both call it, so they cannot drift apart.

A DRI_PRIME already in the environment now skips the export entirely, so one
start with DRI_PRIME=0 gets back to Preferences when the discrete GPU cannot
open the window. The tooltip says so.

* Attach the DRI_PRIME Translator Note to the Tooltip It Describes
2026-10-26 14:02:54 +08:00
SoftFeverandSoftFever acb4cce4ae Explain why settings are hidden or disabled (#16657)
* Record option availability reasons per settings tab

* Explain option restrictions in field and label tooltips

* Show option restriction reasons in settings search

* Explain support and raft option restrictions

* Explain print option dependency restrictions

* Explain printer and filament option restrictions

* Declare settings owner lookup in the Tab header

* Reuse repeated option availability reasons

* Fix availability tooltips for synthetic options

* Deduplicate availability reasons in row tooltips

* Keep motion limit availability consistent with disabled controls

* Show availability reasons in object table settings

* Explain filament override retraction dependencies

* Explain disabled preset compatibility conditions

* Stop search and Speed Dial from refusing settings that are visible

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-10-26 13:59:47 +08:00
SoftFever 1d9bd2704d Stop search and Speed Dial from refusing settings that are visible 2026-10-26 13:43:32 +08:00
HanifKoh 5817a76da6 Trim pybind11 Includes From the Plugin Headers (#16839)
* Move Plugin JSON-Python Helpers Out of PluginFsUtils to Trim pybind11 Includes

* Forward Declare pybind11 module_ in PagesPluginCapability Header
2026-10-26 12:40:52 +08:00
HanifKoh d0966a0502 Forward Declare PartPlate and Other GUI Types in Plater.hpp (#16840) 2026-10-26 12:40:40 +08:00
HanifKoh 2a6e7a199b Forward Declare GUI Panels in MainFrame.hpp (#16842)
* Forward Declare GUI Panels in MainFrame.hpp

* Include wx/statline.h Directly Where wxStaticLine Is Used

The Windows builds failed in AboutDialog.cpp because MainFrame.hpp no longer brings in wx/statline.h.

* Include BBLTopbar.hpp Directly in GUI_App.cpp

The Windows builds failed in GUI_App.cpp with member access into incomplete type BBLTopbar.
2026-10-26 12:40:27 +08:00
HanifKoh cbbe590230 Trim Heavy Includes From GUI_App.hpp (#16841)
* Trim Heavy Includes from GUI_App.hpp

* Include winternl.h in the Windows Troubleshoot Dialog Code

The Windows builds failed in TroubleshootDialog.cpp with unknown type name NTSTATUS.
2026-10-26 12:39:32 +08:00
yw4z 0fb11ef556 Fetch cloud plugin metadata off the UI thread at startup (#16642)
When an Orca Cloud account is logged in, on_init_inner() ran fetch_plugins_from_cloud() synchronously, about 2 s of UI-thread time before presets loaded. The fetch now runs on a worker thread while presets load and the main window is created.

The "no longer available" and "unauthorized" plugin notifications are posted with CallAfter. If they arrive before post_init(), they are kept and shown from post_init(). Before this change they were never shown at startup, because plater() was still null.

The thread is joined on logout, so the fetch can't re-add the old account's metadata, and in OnExit(), CleanUp() and the macOS wxEVT_END_SESSION handler.
2026-10-25 22:00:10 -05:00
Eric Lin 4804b54cd1 Fix: WSS streaming over TLS (#16878)
The Moonraker printer agent's status stream returned at once for an https print host, so Orca got the printer's first status over HTTP and no live updates after it. The stream now connects over TLS for an https print host. Like the agent's HTTP requests, it does not verify the certificate, so a printer's self-signed one is accepted. It sends the host name for SNI, and the `Host` header leaves out the default port 443.
2026-10-25 21:56:21 -05:00
Gazi Faysal Jubayer 6c36861a6b Fix MSVC build of PluginHostUi.cpp (#16870)
`run_on_ui_blocking()`, added in #16763, declared its call states in an enum inside the function template. MSVC does not find those enumerators from the default member initializer of the local `struct Call`, so `libslic3r_gui` failed to compile with cl (C2065, C2280). The states are now at namespace scope as `UiCallPending`, `UiCallClaimed` and `UiCallAbandoned`. Behavior is unchanged.
2026-10-25 21:44:10 -05:00
Josh Jones 710452d0b8 Fix plate name filename placeholder (#16715)
Undo/redo restores a plate's name but reattaches its Print without copying the name, so `{plate_name}` in the output filename and G-code could be empty or out of date. For example, delete a named plate and then undo. `PartPlate::set_print()` now copies the plate name to the Print.
2026-10-25 21:41:40 -05:00
BroncosisandClaude Sonnet 5 0d1c53d36e Match filament presets by filament_id/setting_id from Moonraker lane_data
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-25 18:58:38 -07:00
Eric Lin baff031626 Fix: Connect to Moonraker over https (#16872)
`MachineObject::connect` read `use_ssl` from `dev_ip`, which holds host:port with the scheme removed. So the Moonraker printer agent always used plain HTTP and could not reach a printer whose print host is https. It now reads the scheme from the matching `print_host`.
2026-10-25 14:55:59 -05:00
HanifKoh 75252a70f7 Bound Plugin Disconnect and Python Shutdown When OrcaSlicer Exits (#16765)
* Bound Plugin Disconnect and Python Shutdown When OrcaSlicer Exits

A Python printer agent whose disconnect_printer() never returned froze
the closing app, and a plugin thread that never ended kept the process
alive after its window closed, because Py_Finalize joins every
non-daemon thread.

At shutdown a Python agent's disconnect_printer() now runs once per
agent on a helper thread with a 3 second deadline, holding a reference
that keeps the plugin object alive if the call outlives a forced
unload. PythonInterpreter::shutdown() waits up to 3 seconds for running
plugin calls and for non-daemon threads; if either is still going, the
interpreter is left unfinalized for the process exit to end.

* Run the Threading Atexit Hooks Before Waiting for Plugin Threads

An idle concurrent.futures worker only ends when the hooks registered with
threading._register_atexit() tell it to, and Py_Finalize runs those after
the shutdown wait, so a plugin that left an executor open made every exit
wait the full deadline and skip finalization. The hooks now run first, on a
daemon thread joined within the same deadline, since they join their
workers without a timeout.
2026-10-26 03:52:09 +08:00
Kenneth Raplee 88890b9bb1 Build against recent system Boost (>= 1.87) (#15835)
Boost 1.87 removed io_service and io_context::reset(), and 1.88 moved the classic Boost.Process API under boost/process/v1/ and dropped deadline_timer from boost/asio.hpp. Use io_context, restart() and steady_timer, and include Boost.Process only through the new slic3r/Utils/BoostProcessCompat.hpp, which picks the v1 headers on 1.88+. The bundled Boost 1.84 build is unchanged.
2026-10-25 14:33:17 -05:00
Valerii Bokhan 887a8f1806 Feature: Add experimental high precision G-code export (#16568) 2026-10-25 16:29:13 -03:00
Sergei 51dfa8fe7a Fix first-layer bbox in plate_N.json being shifted by the plate origin (#16860)
get_first_layer_bbox() already returns plate-local coordinates, and generate_first_layer_bbox() subtracted the plate origin from them a second time. On every plate after the first, bbox_all and bbox_objects in plate_N.json ended up outside the bed. The CLI export path already wrote plate-local values, and the wipe tower handling is unchanged.
2026-10-25 14:25:22 -05:00
Kris Austin 1b8bc0b19d Remove the FreeType dependency (#16852)
FreeType was only bundled for OCCT's font code in TKService. The only Orca code that used that font code was Shape/TextShape.cpp, and nothing calls it. Its one call in ImGuiWrapper.cpp is commented out. The Emboss tool and the Design tab's text use stb_truetype.

Build OCCT with USE_FREETYPE=OFF, and remove the FREETYPE dep, its Flatpak source entry, the freetype.dll copy on Windows, TextShape, and the freetype and fontconfig links in libslic3r. OCCT only links fontconfig when FreeType is on, and libslic3r_gui links fontconfig on its own.
2026-10-25 13:51:34 -05:00
HanifKoh 9cb9f9694f Keep nlohmann/json.hpp Out of Widely Included Headers (#16843) 2026-10-26 02:33:27 +08:00
HanifKoh a438fb9aaa Move std::regex Out of Utils.hpp and the Precompiled Headers (#16844) 2026-10-26 02:31:45 +08:00
SoftFever 8efa90c763 Merge branch 'main' into dev/option-unavailability-reasons 2026-10-26 02:19:01 +08:00
Kris Austin 09aa0114b4 Fix the Lay on Face delay when Smooth normals is on (#16846) 2026-10-25 10:31:50 -03:00
SoftFever e2590f7559 Stop re-adding a deleted filament on dual-nozzle printers (#16856) 2026-10-25 20:56:34 +08:00
yw4z 51fd8604f8 Texture Displacement Gizmo: use Resolution and Bugdet controls on a expandable section and move "Add Layer" button to header (#16524)
• Makes gizmo more compact
• Moved budget and resolution on collapsible "Quality" section. it shows
"Auto" status on title
• Moved "Add layer" moved layers header. Fixes position of button and
thats important while adding layers repeatedly

**Before - After**
<img width="757" height="566" alt="Screenshot-20261015200616"
src="https://github.com/user-attachments/assets/d7e356fd-6685-4608-92a6-56e1d2518f69"
/>
2026-10-25 14:00:08 +08:00
Kris Austin 2054242884 Fix Creality print host hanging on a printer that stops answering (#16772)
ws_connect(), query_boxes_info() and start_print() set expires_after()
deadlines, then made synchronous Beast calls. Beast only applies those
deadlines to async operations, so none of them fired. A printer that
accepted the websocket and then stopped answering blocked the caller
forever. That froze the GUI thread when the Creality send dialog opened
or the sidebar synced filaments, and left uploads stuck after the file
arrived.

Run every websocket call as an async operation on the local io_context,
so the deadlines apply. run_until_done() and the per-address connect
loop move from MoonrakerPrinterAgent.cpp into AsioUtils.hpp, and both
files share them. Each resolved address gets its own connect deadline,
and start_print() gets a reply deadline for its commands. A start-print
timeout shows the translated timeout message that HTTP timeouts already
use, now shared through PrintHost::timed_out_message(), and other
websocket errors drop Boost's source location.

The websocket port and deadlines move into a protected ws_settings
member, so the tests can use a local port and short deadlines. The new
tests run CrealityPrint against a fake printer that goes silent before
or after the handshake.
2026-10-24 22:01:15 -05:00
yw4z 7bbb18cbf4 Make gizmo +/- buttons repeat while held (#16525)
Holding a +/- step button on a gizmo input changed the value only once. ImGui repeats a held button only on new frames, and the canvas draws only when an event arrives, so a mouse held still produced no repeats.

- Add ImGuiWrapper::request_frames_while_held() and call it after the Emboss Height and Depth, SVG Depth, and Cut groove Count inputs.
- Set io.DeltaTime from a real clock in ImGuiWrapper::new_frame(), capped at 1/60 s, so the repeat rate does not depend on the frame rate.
- Handle wxEVT_MOUSE_CAPTURE_LOST on the canvas, so a lost button-up does not leave an ImGui widget active.
- Cut groove Count no longer rebuilds when the value is already at its limit.
2026-10-24 20:44:49 -05:00
yw4z 2ec2a60b81 Homepage Fixes / Improvements (#15785)
* init

* update

* keep dimming for disabled login item

* fix navigation buttons

* Add translation support

* fix button style not applies for cloud

* add translations and fix actions bar height

* translate page after updating recent list
2026-10-25 02:01:57 +03:00
Kenneth Rapleeandyw4z 115df364e2 Avoid SetLabel() on plain wxTextCtrl controls (#15881)
* Avoid SetLabel() on plain wxTextCtrl controls in Field.cpp

wxWidgets 3.3 turned wxTextCtrlBase::SetLabel() into an explicit
failure (wxFAIL_MSG, "Use SetValue() or ChangeValue() instead"). It
sets nothing, and with assertions enabled every call pops up an
assertion dialog.

TextCtrl::BUILD() only sets the side-text label in the single-line
case now (the TextInput composite). For multiline fields the control
is a plain wxTextCtrl, and the option group draws the side text
itself when there is any (combine_side_text() is false).

SpinCtrl::BUILD() replaces SetLabel() on the inner text control with
ChangeValue(). Nothing has been stored there since 3.3, and the one
reader of that label (propagate_value(), null-value case) already
sees an empty string. ChangeValue sets the initial text without
events, and the following SetValue(default_value) determines what is
displayed.

* Avoid label APIs on TextInput's inner wxTextCtrl

SetLabelText() routes to the virtual SetLabel(), which wx 3.3's
wxTextCtrlBase overrides, so both label APIs assert or silently no-op on
a plain wxTextCtrl. All become ChangeValue(), which sets the text
without events.

* Apply review suggestions to SliderCtrl, SpinCtrl, and machine dialog

---------

Co-authored-by: yw4z <ywsyildiz@gmail.com>
2026-10-25 01:50:49 +03:00
Dipl.-Ing. Raoul Rubien, BSc 9f5b414589 Fix GCC -Warray-bounds warnings in ConfigOptionVector::set_at (#15079)
Use dynamic_cast in the vector branch of ConfigOptionVector::set_at. GCC at -O3 inlines set_at into the wipe tower position code, where the argument is a scalar ConfigOptionFloat, and the static_cast made it warn about an out-of-bounds read in the branch that never runs.

The scalar branch still uses static_cast. ConfigOptionFloatOrPercent is not a ConfigOptionSingle<FloatOrPercent>, so a dynamic_cast there would throw when a coFloatsOrPercents option is edited in the GUI.
2026-10-24 16:55:13 -05:00
Eric Lin a07bc8ff5b Fix out-of-bounds config reads in the Type1 prime tower (#15183)
Several per-filament and per-extruder options default to a single value. When a config lists fewer values than there are filaments or nozzles, the Type1 prime tower and the pre-heat injector read past the end of the vector, and the same scene could slice to different G-code from one run to the next.

- Read `filament_change_length`, `filament_change_length_nc` and `hotend_cooling_rate` with the same fallback to the first value that `get_at()` uses.
- `is_nil(idx)` falls back to the first value like `get_at()` instead of reading past the end.
- Skip the pre-cooling and last-layer reads when `get_extruder_id()` returns -1, and when no wall filament matches the selected category.
- Bounds-check the pre-heat injector's per-filament and per-extruder reads, and use the extruder index when `physical_extruder_map` is too short.

Configs that list a value for every filament and nozzle produce the same G-code as before.

Adds a test that nozzle-change ramming extrudes the same length in both directions when `filament_change_length` has one value for two filaments.
2026-10-24 16:21:32 -05:00