Commit Graph
1198 Commits
Author SHA1 Message Date
Ian Chua 113b42da33 Merge branch 'main' into fix/isolate-plugin-browser-session 2026-11-18 18:14:21 +08:00
Ian Chua 3838002bc8 feat: serialize permission grant for create and delete files (#17478)
* feat: serialize permission grant for create and delete files

* test: expect saved copytree permissions in hardlink audit test

* refactor: simplify plugin filesystem and permission handling

* fix: show triggering paths in plugin permission prompts

* fix: require subtree consent for recursive plugin deletes

* fix: tests

* fix: Windows short-path aliases in plugin audit checks

* fix: correct plugin folder permission display and consent text
2026-11-18 17:50:29 +08:00
HanifKoh 4aaef535e6 Skip Arachne Toolpaths When the Voronoi Diagram Cannot Be Repaired (#17600)
* Skip Arachne Toolpaths When the Voronoi Diagram Cannot Be Repaired

When the Voronoi repair fails, the skeletal graph built from the
diagram has edges without twins, and the later stages dereference
them. Leave the graph empty and log an error instead, so that outline
gets no toolpaths rather than crashing the slice.

* Cast the Far Sliver Coordinates to `coord_t` in the Unrepairable Voronoi Test

On macOS int64_t is long long, so a literal of type long matched no Point constructor exactly and the call was ambiguous.
2026-11-18 14:04:54 +08:00
HanifKoh d3992c2288 Bound Out-of-Range filament_map and physical_extruder_map Values (#17476)
* Treat a filament_map Nozzle Outside the Printer as Nozzle 1

A filament_map entry of 0, a negative number or a number above the
nozzle count made Extruder::extruder_id() wrap or run past the end, and
print_machine_envelope then took the std::max over the per-extruder
machine limits out of bounds on a flavour that emits them.

Print::apply now treats an entry outside [1, nozzle count] as nozzle 1,
before the variant expansion and the config snapshot, and logs it once.
After the clamp the slicing engine only sees in-range values. It works
on this print's copy of the config; readers of the plate or project
config are not changed, and in-range maps are left alone.

* Skip a physical_extruder_map Entry Outside the Per-Nozzle Table on Export

The first-filament table built for the start G-code is sized by the
nozzle count, and the export wrote it at the index named by
physical_extruder_map. An entry outside that range corrupted the heap,
and a negative one aborted or hung the export.

The value is a firmware tool number that is also emitted elsewhere, so
it is left as it is; only the write into the table is bounded.

* Treat a filament_map Nozzle Outside the Printer as Nozzle 1 in the CLI

With --filament-map-mode Manual on a multi-nozzle profile, the CLI
indexed the per-nozzle unprintable-filament sets, and shifted the
per-filament printable status, with the raw filament_map value. A value
of 0, a negative number or one above the nozzle count read out of bounds
and crashed before the print was configured.

The checks now use a local copy of the map in which an entry outside
[1, nozzle count] is nozzle 1, the same policy Print::apply applies.
In-range maps are unchanged.
2026-11-18 14:04:32 +08:00
HanifKoh 8ebb0a9a2b Stop Arachne's Outline Simplification From Placing Vertices Metres Away (#17599)
simplify() may move a vertex to the intersection of its neighbouring
lines, guarded by a check that the point stays near them. The check
squared the distance in int64, which overflows when nearly parallel
lines meet more than about 3 m away, so the far point was accepted.
The broken outline gave a Voronoi diagram the repair could not fix,
and SkeletalTrapezoidation then dereferenced an edge without a twin.

Compute the squared distances in double.
2026-11-18 12:58:45 +08:00
Kris Austin 428a8fcc91 Arrange items almost as wide as the bed again (#17416)
* Arrange items almost as wide as the bed again

An arrange spacing lets a rectangular bed grow by the part of the spacing
past every item's brim or tree support, the way printing by object
already grows it. The spacing is kept in full and a part that fits the
bed is not refused for it. The bed does not grow when an item that can
be placed would keep less inflation than the growth, beyond the EPSILON
slack, so a part that fills the bed may sit up to EPSILON past its edge,
within BuildVolume::BedEpsilon. A round bed never grows for a spacing,
since moving its points along each axis would grow it unevenly.

The cap on an item's inflation measures the item as the nester packs it,
inflated with square joins and turned, so it holds for an item turned to
the Y axis or by hand, and it leaves room for the skirt. An item too big
for the bed keeps its full inflation, so it is still refused on a grown
bed, and it no longer sets the bed margin given back to the other items.
Printing by object, this keeps the 5 mm margin for the placed objects
when another one is refused.

The arrange bed keeps EPSILON on each side of the largest item for every
print sequence, since the nester cannot place an item beside one that
fills the bed exactly.

The skirt room reads a percent first layer line width against the
nozzle diameter instead of as millimeters, and accepts a width stored as
a plain number.

update_arrange_items() runs the arrange setup in the order it depends on
for the arrange job and the CLI.

* Arrange items the nester has to turn

With rotations allowed the nester turns an item that does not fit as it
lies, even onto the bed's diagonal, so no item counts as too big. An item
that has to turn is measured at an angle where it fits along the bed's
axes, if there is one, so it keeps its spacing.
2026-11-17 22:07:31 -06:00
Ian Bassi 12c9ee813b Brim filament for features (#17655) 2026-11-17 21:58:49 -03:00
Ian BassiandRodrigo Faselli 8b3de0be86 Sparse infill strategy selector (#17645)
Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-11-17 21:16:40 -03:00
Lam Wei LunandIan Bassi 07f38df2a4 Fix top surface printing over inner walls with only one wall on top (#17597)
Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
2026-11-17 14:39:16 -03:00
Ian Bassi e76b4d676c Split smoothed infill corners no finer than 5 microns (#17630) 2026-11-17 09:54:18 -03:00
Ian Bassi 745207d3e3 Choose the filament each calibration prints with (#17621) 2026-11-17 08:36:13 -03:00
Ian Chua 0ab2785f6d feat: keep plugins activated/deactivated based on pre-update state (#17473)
* feat: keep plugins activated/deactivated based on pre-update state

* fix: preserve plugin capability choices across updates

Cloud plugin replacement resets the install-state sidecar, which silently
re-enabled capabilities the user had disabled. Snapshot the installed sidecar
before replacing the package, then write the pre-update capability choices and
activation intent back after the install. Permissions stay cleared so the new
package must request them again, and the reload now waits until that state is
persisted.

Add regression tests for updating both an active and a deactivated cloud
plugin.

* fix: roll back a failed plugin update and keep the old package usable

Download the replacement before unloading or deleting the installed package, so
a download failure leaves the old package and its sidecar untouched. Refuse to
replace a package whose sidecar exists but cannot be read, rather than resetting
the user's capability choices and grants.

Extract the install-from-package step so the updater can reuse it. When the
install fails, restore the previous sidecar (activation intent, capability
choices and grants) that the unload step overwrote, and reload the old package
if it was active. Keep a stale package from another cloud directory until the
new one is committed.

In install_plugin, use one rollback helper for every failure path and give
backups a "__" prefix so an abandoned backup is never discovered as a plugin.

Add regression tests for failed download and failed install.

* fix: prevent a plugin load and an update from racing

Claim a plugin key for the duration of update_cloud_plugin under m_mutex, and
make load_plugin refuse a key that an update owns. An update that starts while
a load is still running now fails with a clear error instead of unloading the
package underneath the loader; the claim is released before the replacement is
reloaded and on every failure path.

Keep the dialog's Update button disabled while the selected plugin is loading,
so the UI cannot start an update the manager would refuse. Add a JavaScript
test for the button state and a C++ test for the load refusal and claim
release.

* fix: clang-tidy

* fix: plugin update safety and simplify state handling

* fix: plugin update rollback and error reporting

* refactor: simplify plugin update state handling and tests

* fix: avoid marking plugins as errored on update conflicts
2026-11-17 16:36:52 +08:00
Ian Chua 0aa479f27c fix: overlapping permission dialogs (#17318)
* fix: queue permissions dialogs

* fix: serialize plugin permission dialogs across prompt types

* fix: unit tests

* fix: move audit prompt stuff to PluginAuditManager

* fix: discard pending permission requests when plugin load is cancelled

* fix: simplify audit prompt cancellation and align denial tests with prod

* fix: queued permission prompts lost after plugin load failure
2026-11-17 14:33:17 +08:00
Kiss Lorand 32f6db87e8 Fix validation of legacy bed exclusion areas (#17618) 2026-11-17 10:20:41 +08:00
Kiss Lorand 9cdaaedad7 Fix Measure geometry after nonuniform scaling (#17549) 2026-11-16 18:35:55 -03:00
Ian Bassi c49e32c1e7 Set feature speeds in mm³/s or % of max volumetric speed (#16299) 2026-11-16 17:55:09 -03:00
HanifKoh 59acdedd06 Keep Heavy Boost and Plugin Headers Out of Widely Included Headers (#17494)
* Keep Heavy Boost and Plugin Headers Out of Widely Included Headers

Several headers that most of the code includes pulled in large libraries they barely use, so hundreds of files compiled them for nothing:

- Point.hpp, Line.hpp, Polygon.hpp and ExPolygon.hpp included all of Boost.Polygon to declare traits. Point and Line now include only the concept headers they need, and the polygon traits move to BoostPolygonTraits.hpp, included by BridgeDetector.cpp, the one file that runs Boost.Polygon algorithms on polygons.
- ProjectTask.hpp included Boost.Thread and the filesystem streams but only uses boost::filesystem::path.
- Utils.hpp included Boost.DateTime for one inline function, which moves to utils.cpp.
- Semver.hpp used boost::format for two version strings; std::to_string prints the same.
- MainFrame.hpp held PluginPages by value, which brought in the web view and plugin headers; it now holds it by unique_ptr.
- Model.hpp included STEP.hpp, and with it OpenCASCADE, for a forward-declarable type and two typedefs.

Files that relied on these headers arriving indirectly now include what they use.

* Include What the Polygon Traits and the End-Time Helper Use

* Drop Two Unneeded Includes and Include the Filesystem Directory Header
2026-11-16 19:30:35 +08:00
Ian Bassi 8b8d573a85 Keep Outer Walls Out of the Resonance Avoidance Range in the Layer Cooling Slowdown (#17534) 2026-11-15 11:29:03 -03:00
Ian Bassi ebfce227c6 Copy the Python runtime only when it changes, and use thin archives with clang-cl (#17511) 2026-11-15 11:07:56 -03:00
Ian Bassi 8a1cef365e Time Layer Cooling With Acceleration, as the Preview Does (#17540) 2026-11-15 10:47:57 -03:00
Kris Austin 9921437c27 Fail tests whose sections assert nothing (#17420)
tests/CATCH2.md says to run the suites with `--order rand --warn
NoAssertions`. On main that fails in fff_print (8 test cases), libslic3r
(15), sla_print (1) and slic3rutils (4), even when each case runs alone.
ctest never passed the flag, so nothing stopped new ones. Most of these
tests have SECTIONs that only set up state, with the assertions after
them, or generated cases that return early for combinations that don't
apply. Catch2 counts assertions per section, so each of those reads as
an empty test.

Where only a value or a short setup changes, use GENERATE or a table and
generate only the combinations that apply. Elsewhere, end each section
with a call to a local check. ctest now passes `--warn NoAssertions`, so
CI fails a case or section that asserts nothing, and tests/AGENTS.md
says so. ctest also passes the CATCH_EXTRA_ARGS cache variable, which
nothing read before, split like a command line, so setting it now takes
effect.

Three tests only wrote a debug mesh or diagram and asserted nothing.
They now check that the Voronoi diagram of the six points is complete,
that hollowing with hfRemoveInsideTriangles removes at least half of the
roughly 400 mm² of the two spheres that lies deeper than the wall, and
that the half cone is closed. The legacy 3MF scenario checked for a
volume map on every plate of a file that has none, so it now also saves
and loads a project with a plate, and its name says so.
2026-11-14 10:47:42 -06:00
Kris Austin bf1fb93b78 Use WebKit's Shared-Memory Transport on Wayland Outside the Flatpak (#17399)
* Use WebKit's shared-memory transport on Wayland outside the Flatpak

In a Wayland session, the hardware DMABUF path of Ubuntu's WebKitGTK 2.52
on Intel GPUs froze the Preview, Device and Project tabs and left the 3D
view drawn over other pages. On the default path of a build with EGL,
outside the Flatpak, set WEBKIT_DMABUF_RENDERER_FORCE_SHM=1, as Orca
already does for NVIDIA and virtual machines, so compositing stays on.
WebKitGTK 2.42 and 2.43 have the DMABUF renderer but ignore that switch,
so they get WEBKIT_DISABLE_COMPOSITING_MODE=1 instead. The Flatpak's
runtime WebKitGTK works, so it keeps the hardware path.

A Wayland session is detected by wayland_socket_available(), which looks
for the socket the way wl_display_connect(NULL) does. The no-EGL fallback
and the GUI start-up check use it too, so all three agree with GTK.
is_running_in_flatpak() checks only /.flatpak-info, because a host process
started from a Flatpak can inherit FLATPAK_ID; the data-dir migration and
the Troubleshoot dialog now use it. Both helpers live in libslic3r/Utils
and have unit tests.

Fixes #17381

* Note that Debian's WebKitGTK 2.54 on AMD freezes too
2026-11-14 10:46:49 -06:00
Rodrigo Faselli 6268535d2f Multiline rectilinear infill optimization (#17547) 2026-11-14 11:33:39 -03:00
Damir GaleevandIoannis Giannakas 82135af6ff Fix seam dents caused by skipped retraction after outer wall (#16982)
Co-authored-by: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com>
2026-11-14 11:30:49 -03:00
Hanif Koh 87cf1429ca Keep Every Overhang That Joins a Tree Support Cluster on the Same Layer
An overhang cluster stored one overhang per layer, so a second overhang
joining the cluster on a layer it already had was dropped and got no tree
support. Store every overhang of the layer, as BambuStudio does since
adb3fbcfc.
2026-11-14 16:06:46 +08:00
Ian Bassi 36815b4f03 Stop Feed-Rate-Only Lines From Counting as Extrusion in the Layer Cooling Slowdown (#17535) 2026-11-13 11:09:33 -03:00
HanifKoh 71c9f556f0 Fix the Crash When Editing an Object's Speed on a Printer Without a Matching Variant (#17529)
A process whose print_extruder_variant has no entry for the printer's extruder type and nozzle volume (a Bowden
printer with a "Direct Drive Standard" process, or a bare "Bowden" variant) made Tab::switch_excluder return
before it mapped the page's variant fields. Editing a per-variant option on the Objects tab then read the end of
that empty map in TabPrintModel::on_value_change and crashed with std::bad_alloc.

switch_excluder now falls back to the extruder's first variant through find_variant_index, as slicing does,
and logs it; get_index_for_extruder keeps returning -1 for its other callers. on_value_change checks the map
lookup and otherwise takes the index from the field id.
2026-11-13 16:00:08 +08:00
HanifKoh 2c50d15451 Skip the Final Wipe-Tower Unload on Toolchangers When the Tower Stops Short (#17496)
The short-tower final unload is only needed on single-extruder MMU printers, which have to pull the
last filament out. Without SEMM the final purge only rams, with no retraction or parking, so a
toolchanger whose filament has multitool ramming on printed those lines in mid-air above the tower.
Generate it for SEMM only.
2026-11-13 12:59:41 +08:00
Eric LinandClaude Fable 5.1 7c76be2ebc Fix CLI crash when filament presets set no diameter (#16911)
Since #16867 pads filament_colour to the filament count, every CLI run that loads filament presets without a colour recomputes the flush matrix. Standalone filament presets may omit the per-filament keys that block reads. A missing filament_diameter crashed the CLI, and a short filament_is_support failed the size check.

Grow both to the filament count before the recompute. A missing diameter follows the first filament, as get_at() reads it. A missing support flag is off.

get_min_flush_volumes() also read past the end of filament_long_retractions_when_cut and filament_retraction_distances_when_cut when a filament omitted them. Pad both with the first filament's value, so the flush matrix matches the print.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-12 18:45:38 -06:00
yw4z 30da6fd145 Add SLIC3R_OPENVDB option to build without OpenVDB (#17401)
OpenVDB, Blosc and OpenEXR are no longer built or searched for by default. Only SLA hollowing uses them, and SLA printing can't be reached in OrcaSlicer. Configure both the deps and the app with `-DSLIC3R_OPENVDB=ON` to build them again.

Without OpenVDB, `sla::generate_interior()` logs a warning and returns an empty interior, and the hollowed-cube SLA test is skipped. The Flatpak manifest no longer downloads the three source archives.
2026-11-12 18:15:26 -06:00
Damir Galeev 97bf1f4d1d Fix missing seam markers in the preview on overhanging outer walls (#16296)
* Fix missing seam markers in the preview on overhanging outer walls

An outer wall that starts on an overhang is labelled "Overhang wall" in
G-code, like the overhanging part of an inner wall, so the preview's seam
detector never opened a candidate for it.

The G-code generator now writes one comment, OUTER_OVERHANG_WALL, before
such a wall. The detector reads it and treats that wall as an outer wall
for seam detection only, so extrusion roles, legend and colours stay the
same. Markers also appear in G-code opened from a file.

* Share the outer wall check and drop the sloped seam test variant

A loop that starts on an overhang never gets a scarf seam, so the tagged
stream with a sloped start could not be generated. The outer wall check
used by the G-code generator and SeamPlacer moves to is_outer_wall(), and
the generator runs it last, after the cheap conditions.
2026-11-13 02:55:16 +08:00
Kris Austin 93941dc34e Add tests that pin the infill rotation template output (#17418) 2026-11-12 11:07:26 -03:00
Ian Bassi db9968b9ee Painted modifiers (#16213) 2026-11-12 10:38:03 -03:00
HanifKoh 2d7b0e1c6d Slice Each Final Configuration Once in the Surface Centering Test (#17481)
The test compared every one of its 216 combinations against a fresh slice of the final settings, but those settings take only 72 distinct values. Keep each fresh slice and reuse it, which cuts the test's slices from 648 to 504 with the same checks.
2026-11-12 14:19:20 +08:00
Rodrigo Faselli 0291395132 Place Separate Objects Side by Side in the Assembly View (#17386) 2026-11-11 19:32:58 -03:00
Ian Bassiandraistlin7447 34de2b49df Copy per-nozzle settings to every tool of a toolchanger, and choose which unsaved changes to keep (#17461)
Co-authored-by: raistlin7447 <kris.austin@gmail.com>
2026-11-11 19:18:28 -03:00
Arthur Porto 32dbacb423 Variable layer height on several objects, and with the prime tower on objects of different heights (#16462)
* Variable layer height on several objects, and with the prime tower on objects of different heights

The variable layer height tool now opens with several objects selected.
Adaptive, Smooth, Reset and manual edits apply to all of them: they share one
profile, the finest layer height any of them asks for at each Z, unless
"Each object separately" is ticked. Every selected object is painted with
its layer heights. With a profile each, up to three objects get a bar of
their own, drawn to one scale, and the bar under the mouse is the one edited.

The prime tower check compares the layers objects are sliced at over the
height they share, rather than the raw profiles, which never matched once the
profile of a lower object ended at its own top. Precise Z height, which fits
the last layers of each object to its own height, is left out of such a
print, with a warning.

* Check the prime tower layers on the sliced objects, and note the new strings for translators

* Include what the new tests use

* Compare the layers as sliced, before the prime tower is generated from them

* Check that precise Z height stays on without a prime tower

* Keep each object's layer height texture on the GPU, and mark only lower tops

The variable layer height tool sent a 1024x1024 texture to the GPU for every
selected object on every frame, and set_config(), run after every edit,
dropped the other objects' textures so that each was generated again.

Each other object now has a texture of its own on the GPU. It is generated
and sent only when its profile, its height or the slicing parameters it shows
change, which set_config() now only asks to check. The object shown sends its
texture only when it is generated, and while the objects share one profile,
those on its layers are drawn with its texture and need none of their own.
The textures of objects no longer selected are freed.

The bars and the layer height curves are built again only when what they
show changes, and each bar is scaled with its own object's layer heights.

A lower object's top is marked only when it is lower than the object shown,
objects ending at the same height share one label, and a label stays on the
canvas and below the one above it.

The comment on precise_z_height_overridden() now says what the override
trades: the tower can join the off-grid layers to the tower layer below, but
a joined layer holds two purges, which makes the tower deeper.

* Fix the precise Z warning, shared profiles across first layers and the bar clicked

- The precise Z override, and its warning, now need an object with precise
  Z height on. Every plate with a prime tower and variable layer height on
  objects of different heights warned about a setting that is off by
  default.
- The objects the override slices again get their slicing parameters back
  at once, since validate() reads them before slicing.
- When the objects share one profile, an object that starts its layers
  elsewhere than the object shown, with a raft of its own say, keeps its
  own. The shared profile starts with the first layer of the object shown,
  and PrintObject::update_layer_height_profile() dropped it on such an
  object, which then printed at the preset layer height.
- Clicking a bar edits its object, even when no frame was drawn since the
  mouse got there.
- Select all is ignored while a profile is painted, and select all plates
  while the tool is open.
- The bars' models are made again, not copied, when their number changes:
  a copy shares the GPU buffers that the original deletes.
- Objects with no height above the bed are left out of the tool, and a
  profile fitted within EPSILON above one of its entries no longer runs
  past it.

* Keep the object top labels below the toolbar row

When the toolbar row ends next to the bar, the label of an object that
ends near the top of the tallest one covered the toolbar's last buttons.
Such a label now starts below the row, with its arrow pointing up to the
line on the bar.

* Fill the layer height texture up to the top of the object

The last layer can end under the top of the object, by up to half a
layer, and no layer wrote the cells there. The top face is drawn with
them, so it showed what the buffer held before: black on the texture of
an object made for the first time, or the colours of another object.
The last layer now fills them, with the shade of its top.

* Draw horizontal faces without the layer stripes

A horizontal face lies at one height, so the stripes cannot show on it,
only the shade they have there. That shade changed whenever a layer
under it moved, and the tops flickered at every stroke. Such a face now
gets the plain colour of its layer height, from the 2nd level of the
texture.

That level is now read at its own level of detail instead of with a
bias. On a horizontal face the texture coordinates do not change, so the
GPU picks the 1st level however large the bias, and read it at the
coordinates of the 2nd: the tops showed black, or the colour of another
height. The 110 shader does so where GL_ARB_shader_texture_lod is
available, and keeps the stripes elsewhere.

* Include ObjectID.hpp where ObjectWithTimestamp is used

clang-tidy (misc-include-cleaner) asks for the header to be included directly.

* Find the horizontal faces with the inverse transpose of the world matrix

The variable layer height shader took the normals to world space with the world matrix itself, which is only right under a uniform scale. With a non-uniform scale it drew sloped faces as flat, and once the object was also rotated it missed real flat ones. The normals now go through the inverse transpose of the world matrix, which render_object_volumes() already built for the view normal matrix.

* Note why the precise Z override keys on has_wipe_tower()

Since #16999 the tower is printed only when slicing finds it is needed, so
the override also applies on plates where no tower is printed in the end.
2026-11-12 02:34:10 +08:00
HanifKoh 478cc90ae7 Write One Nozzle Volume Type per Nozzle From the CLI (#17440)
The CLI now sets one nozzle_volume_type per nozzle, as the GUI does. A command-line value wins, then the project's own types, then the printer's defaults. A short list repeats its first entry and a long one is cut to the nozzle count. The sized list is written to the project config and over the command-line value, so the export has one type per nozzle, and reopening it in the CLI keeps the flush matrix the user set. The flush volume setup reads the sized types instead of indexing a short command-line list past its end.

Adds the cli_nozzle_volume_type test.
2026-11-11 08:56:36 -06:00
HanifKoh d7534d7fb9 Fix the Crash When the Per-Extruder Printable Areas Do Not Overlap (#17439)
When the per-extruder printable areas only touched or did not overlap, get_shared_poly read the first polygon of an empty intersection. That crashed the CLI on the bed shape, and the GUI in scale to fit, fill bed and prime tower placement.

The shared area is now empty in that case. An area with fewer than three points leaves its extruder the whole bed. Placement (get_bed_shape with use_share, PartPlate::get_build_volume(true)) falls back to the whole bed. The prime tower's default position and drag fall back to the plate's shape. Validation now says the extruder printable areas share no common area, instead of reporting the tower as partially outside the printable area.

Profiles whose areas overlap, and profiles without areas, get the same shapes as before.
2026-11-11 08:53:37 -06:00
Lam Wei Lun 97ee8d9197 Cut: keep per-part filament colors after dovetail cut (#17322)
* Cut: keep per-part filament colors after dovetail cut

The dovetail path merged every model part of each half into one volume
built from a raw mesh, dropping per-part extruder and material overrides,
so the cut result fell back to the object-level extruder (T1).

Merge by effective slicing identity (extruder, material, per-part config)
instead, one merged volume per group, copying the representative's config
and material. Connectors and modifiers are never merged or deleted, and
single-group results keep today's single volume named after the object.

Fixes #17187

* Fix missing includes

* Cut: number extra parts and fix null material lookups

Name the extra merged parts Object_2, Object_3, ... as splitting a mesh
into parts does, instead of Object_T<extruder>, which misleads when the
parts differ by material or by a per-part setting, and whose fallback
suffix was not re-checked for uniqueness.

Move the merged mesh into the new volume instead of copying it.

add_cut_volume() dereferenced the source volume's material, but the cut
model has no material table, so cutting a part that has a material id
crashed before the merge could carry that id. Fall back to the material
id alone, and let PrintObject skip a material's region settings when the
material is missing rather than dereferencing null.

* Cut: don't replace the source material while copying it

add_cut_volume() carried the source volume's material with set_material(),
and Model::add_material(id, other) deletes the existing material before
copying from other. The source volume and the target object share the cut
model, so the second copy of the same volume (the "_A" and "_B" halves of
a groove cut) resolved that same material and replaced it with a copy of
itself after deleting it, reading freed memory. A part with a material id
segfaulted the cut before the merge could carry that id.

Copy the material's settings only when the target model has no material
of that id yet; otherwise just set the id and keep the existing one.

* Cut: carry a part's material id and merge by effective settings

The cut model holds no material settings, so add_cut_volume() only needs
the id: copying the material there could only replace the source object's
own entry, which Model::add_material() deletes before copying from it.
Drop the unused duplicate of add_cut_volume() in Model.cpp as well.

Group parts by the settings they slice with rather than by the keys they
set explicitly: a part that restates a value the object already sets now
stays with a part that leaves it implicit, instead of coming back as
Object_2.

* Model: keep a part's material when converting units

ModelObject::convert_units() rebuilt a clone detached from its model and
then called set_material() on it: the source volume's material was read
without a check, and set_material() reached add_material() through the
clone's null model. Any part with a material id crashed the conversion.

Copy the id, pointing the clone at the source model for the call so the
entry is recorded and its settings resolve after the conversion.
set_material() has no callers left, so remove it.

* Model tests: free the converted objects through a model

ModelObject's destructor is private, so the tests cannot delete the
objects convert_units() hands back. Give them to a Model, which owns
model objects and frees them.
2026-11-11 18:36:58 +08:00
163b95f93d Keep the final wipe-tower unload for ramming printers when the tower stops short (#15917)
Keep the final wipe-tower unload for ramming printers when the tower stops short of the object's top

The Type2 final purge was skipped whenever the tower stopped below the object's top layer,
so a ramming printer's last filament was never unloaded. Generate it again when the last
filament rams (single_extruder_multi_material or filament_multitool_ramming), placing it at
the object's top layer so the nozzle doesn't descend into the part, and keep skipping it
otherwise.

Co-authored-by: Fernando Marino <f.marino@rheagroup.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 17:34:57 +08:00
DIEHARDave bb81f6b39a Fix: Run slicing pipeline plugins whose manifest reference is missing (#16884)
When a capability named in `slicing_pipeline_plugin` has no entry in the derived `plugins` manifest, the slicing pipeline now finds it by name among the loaded plugins instead of skipping it. The lookup moved into `PluginManager::resolve_capability_ref()`, so the manifest resolver and this fallback use the same rule.

A capability that isn't loaded is still skipped. So is a manifest entry that points at a plugin that isn't installed. No local plugin with the same capability name runs in its place.

Adds a test that slices with an empty manifest and checks that the capability ran.
2026-11-10 22:07:56 -06:00
TheLegendTubaGuy 9696797638 Keep Bambu LAN printers saved before printer agents in the Device tab (#17468)
Builds before 2.5.0 saved local machines without a printer_agent_id, and
DeviceManager hides and drops entries with no agent, so Bambu printers bound
over LAN in 2.4.x vanished after the upgrade. Assign them to the Bambu agent
when the config is loaded. Entries of the other agents stay unassigned: those
were keyed by their address, which equals the stored IP or contains a '.' or
':' that a Bambu serial number never has.
2026-11-10 20:30:37 -06:00
ccatlett1984 54f46ca3b0 Fix Snapmaker filament sync: nozzle temperature, invented material types, and a crash on an empty spool colour (#16300)
Fixes five problems in how the Snapmaker agent turns the printer's filament data into AMS trays.

- Read the nozzle temperature from HOTEND_MAX_TEMP instead of FIRST_LAYER_TEMP, which external tag readers never set. Slots with no vendor now get their temperatures too.
- Return the base material type for finish sub types, instead of names like PLA SILK that aren't valid filament types. Fold a fiber loading into the plain fiber, so PA12 with CF10 gives PA12-CF.
- Match the vendor by whole word in either direction, and stop a preset with no color from ranking as black.
- Prefer a preset whose name carries the spool's sub type. When no preset matches the spool's vendor, try Orca's Generic presets before the type-only fallback.
- Fix a crash on a spool with an empty color.

Adds tests in tests/slic3rutils/test_snapmaker_filament_match.cpp.
2026-11-10 20:04:27 -06:00
oliverzein ea80024735 Write the T command before filament start G-code when only the first filament prints (#14763)
On non-Bambu printers, a print that used only the first filament wrote the filament start G-code and pressure advance before `T0`. Every other toolchange writes the T first. Printers that set a temperature on a T command, like Creality printers with a CFS, then overwrote the temperature from the filament start G-code, and the print ran at the CFS temperature.

The single-extruder path now writes the T command first, then the filament start G-code and pressure advance, in the same order as the multi-extruder path. When the T is written, single-extruder multi-material is on and the prime tower is off, an M104 for the filament follows the T, as in the multi-extruder path. A temperature set in the filament start G-code comes after it and still wins. Prints with only one filament configured get no T and are unchanged.

Adds three tests to `test_multifilament.cpp`.

Fixes #14753
Fixes #11542
2026-11-10 19:54:21 -06:00
TheLegendTubaGuy 376fd433f2 Fix the mixed filament ratio pickers and dialog sizing (#16866)
The ratio triangle handle no longer jumps to the opposite side when it is dragged outside the triangle. It now snaps to the nearest point on the outline.

When the dialog grows for a third material or the gradient editor, it now stays inside its display and is never taller than the display, so Cancel and OK stay above the taskbar. A DPI change resizes it the same way.

The 10% minimum for each filament is now drawn as a dashed line on the triangle, the ratio bar and the gradient graph. The gradient grid is now 10x10, so the line falls on a grid line. The two-material ratio bar now spans the full dialog width, below the preview.

Part of #16781.
2026-11-10 19:45:17 -06:00
HanifKoh 6ba9eb49e7 Size the CLI's Filament Index Tables to the Loaded Filaments (#17244)
When `--load-filaments` names more presets than the project has filaments, the CLI now grows the project to the loaded count before the config merge. The new filament slots go in before the printer's slot in `inherits_group`, `different_settings_to_system` and `compatible_machine_expression_group`. Before, the merge read past the end of its index tables, which aborts under libstdc++ assertions, and the new filament overwrote the printer's inheritance, changed settings and compatibility condition.

The project's own filaments keep their per-variant values, also when the loaded count equals the project's variant count.

An empty `--load-filaments` entry past the project's filament count now fails with `CLI_INVALID_PARAMS` and names the slot, since there is no project filament to keep there. `--load-defaultfila` still fills such a slot with the first loaded preset.

Adds the `cli_load_filaments_count` CLI test.
2026-11-10 18:53:30 -06:00
Niklas 96d7742974 Trust the per-printer CA file for Bambu LAN connections (#17062)
The HTTPS CA file in the IP and access code dialog had no effect for Bambu Lab printers. For Bambu printers, the CA path is now saved with the printer's local machine entry instead of being read from the selected preset. On connect, Orca builds `<data_dir>/cert` with the bundled `printer.cer` plus the CA of each printer connected in this session, and points the network plug-in there. The file must contain only CA certificates. If it doesn't, Orca logs a warning and keeps the bundled certs. Other printer agents still use `printhost_cafile` from the preset.

A CA chosen before this change is not migrated. Choose it again in the dialog.

Fixes #17061
2026-11-10 18:48:28 -06:00
Eric Lin fabad6114a Fix filament sync showing a slot as another material (#17089)
When no visible filament preset matched the material a printer reported, first_visible_idx_by_type() returned an arbitrary visible preset, so the slot showed a different material. It now returns no match, and the Moonraker, Creality CFS, Qidi and Snapmaker agents fall back to the OrcaFilamentLibrary generic for that material.

The generic name table now maps PLA+, PLA PRO, ABS+ and PETG+ to their family, and adds PLA Matte, PETG HF, PETG-CF, PE-CF, PP-CF and PP-GF. The redundant visible-base check in the Creality CFS fallback is gone.
2026-11-10 18:34:50 -06:00
Kuzuri 7243d15ea2 Measure short objects and the compacted tower clearance by the printed top (#17445)
`is_all_objects_are_short()` and both "No sparse layers" compacted tower clearance checks now measure an object by its top above the bed, with the raft, Z offset and Z shrinkage included. Before, a short object on a raft still counted as short in a by-object print, and the raft was left out of an object's rise above the compacted tower. These checks and the by-object check now read the new `PrintObject::print_z_max()`. Belt printers use the model's own top.
2026-11-10 18:19:17 -06:00