Commit Graph
14492 Commits
Author SHA1 Message Date
peachismomo b8069c37df fix: isolate plugin browser profile lifecycle 2026-11-21 01:34:57 +08:00
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
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
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
AsTechEvolves 4c714ac95e Show the Orca logo instead of Bambu's camera placeholder for non-Bambu printers (#17524)
* IMPROVEMENT - show the Orca logo instead of Bambu's placeholder before a non-Bambu printer's camera plays in MediaPlayCtrl and wxMediaCtrl3

* IMPROVEMENT - pick the camera placeholder from image files in MediaPlayCtrl: Bambu's as live_stream_bambu.png for Bambu presets, Orca's as live_stream_default.png for the rest, set when the view is shown
2026-11-17 14:30:07 +08:00
Ian Chua 9232613297 fix: nozzle sync table flash and white box (#17607)
* fix: nozzle table height measurement before dialog layout

* fix: white flash when nozzle list table loads
2026-11-17 14:28:08 +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 Chua 4b161be150 fix: prevent oversized AMS mapping popup on Wayland (#17606) 2026-11-16 18:55:18 +08:00
yw4zandNoisyfox ff93256eff LabeledCheckBox class (#15761)
* init

* extend feature set

* update

* fix tidy

* fix tidy

* Update calib_dlg.cpp

* simplify class

* update

* align labels with RadioGroup

* replace ImportCheckBox

* Update LabeledCheckBox.cpp

* apply to more dialog

* add to ai skills

* update

* fix Tooltip only reaches the children on the first call

* fix Label can stay grey after a theme switch

* Update release dialog

* change focus target for all platforms

---------

Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
2026-11-16 11:24:56 +08:00
Kiss Lorand 87fb987668 Fix part deformation in Assembly Parallel operation (#17552) 2026-11-15 15:52:34 -03:00
Noisyfox b4a9565dee Round mixed filament row corners (#17561) 2026-11-15 11:52:27 -03: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
Kris Austin 33c07cc74d Fix overlapping text under "Check the reason" on macOS (#17366)
The error panel that "Check the reason" opens in the print, send,
calibration and bind dialogs is a scrolled window with a fixed size.
It starts hidden, and showing it gives it the size it already had.
macOS only sends a size event when the size changes, so the panel
never laid out its rows and drew them all at its top-left corner.
Lay the panel out when it opens.

Fixes #17065
2026-11-14 10:46:32 -06: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
yw4zandIan Bassi 9a285770d4 Variable layer height: allow painting directly on objects (#17471)
Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
2026-11-13 16:24:14 -03:00
Rodrigo Faselli 5d69ba055f Round top canvas toolbar corners (#17491) 2026-11-13 15:26:54 -03:00
Joseph Robertson 3936cd5f6a Fix black scene cache and FXAA frames under VirtualGL (#17508) 2026-11-13 15:00:05 -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
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
TheLegendTubaGuy 4b21b29cd2 Add a Reload from Disk Keyboard Shortcut (#17373) 2026-11-12 13:30:35 -03:00
Ian Bassi db9968b9ee Painted modifiers (#16213) 2026-11-12 10:38:03 -03:00
Noisyfoxandyw4z 47a17ad9a3 Fix Cut gizmo empty-space right clicks and Reset availability (#17200)
* Fix empty-space right clicks entering cut part selection

Return whether a cut part was hit and discard only a newly initialized part selection on a miss. Preserve existing grouping and skip connector updates when nothing was hit.

Validation: RelWithDebInfo build passed. GUI checked right clicks on empty plate and outside plate preserve preview and an enabled, checked Cut to parts option; an empty click preserves existing grouping.

Local clang-tidy is blocked by wx/msw/wrapcctl.h HDITEM errors also reproduced on the unchanged baseline.

* Enable Cut Reset while part selection is active

Treat active part selection as resettable state even when the plane remains centered and there are no connectors. Reuse reset_cut_plane to clear grouping and restore model rendering.

Validation: RelWithDebInfo build passed. GUI verified actual part selection enables Reset; Reset restores the initial preview and Cut to parts; performing Cut to parts then produces Cube_A and Cube_B under one Cube object.

Local clang-tidy remains blocked by baseline wxWidgets HDITEM errors.

* Avoid rebuilding cut parts for empty-space right clicks

Query the selected volumes' existing original-mesh raycasters before initializing part selection. Use world transforms and ignore cut-plane clipping. Fall back to the existing cut-part test if an original raycaster is unavailable, and retain the final hit/miss cleanup.

Validation: existing RelWithDebInfo build and diff check passed. GUI tested a 262144-triangle torus: five outside clicks and five hole clicks added no cut trace records; actual part clicks built selection, existing grouping survived hole clicks, Reset recovered normal cutting, and Cut to parts produced A/B volumes under one object. Full right-drag gestures and macOS/Linux were not tested. Local clang-tidy remains blocked by baseline wxWidgets HDITEM errors.

* Skip empty undo snapshots when resetting only cut grouping

Create the scoped Reset Cut snapshot only when the plane differs from its initial state or connectors will be removed. Part selection is not serialized, so clearing it alone must not add an ineffective undo entry.

Validation: existing RelWithDebInfo build and diff check passed. GUI and trace logs confirmed grouping-only Reset creates no Reset Cut snapshot, a plane Reset remains undoable from 17.5 mm back to 22.5 mm, and connector-only Reset remains undoable. Local clang-tidy remains blocked by baseline wxWidgets HDITEM errors.

* Clarify Cut Reset tooltip includes part assignments

Describe the cutting plane, connector removal, and part-assignment reset in one translatable message. Add a translator comment explaining the assignments.

Validation: git diff --check passed. Full gettext extraction, merging, and compilation passed for all 23 catalogs in an isolated validation workspace.

---------

Co-authored-by: yw4z <ywsyildiz@gmail.com>
2026-11-12 14:29:22 +03:00
yw4z 9e554377a0 Draw g-code marker tilted for belt printers (#17427)
* init

* update

* fix tilt for decoupled frames
2026-11-12 13:58:16 +03:00
HanifKoh 7cb97a82de Ignore Modifiers When Focus Mode Decides Which Plate an Object Is On (#17474)
Focus mode hid an object only when its footprint missed the current plate, and the footprint included its modifiers, negative volumes and support enforcers/blockers. A large modifier reaching over another plate kept the object drawn there. Build the footprint from the model parts only, as plate membership does.
2026-11-12 14:31:12 +08:00
Rodrigo Faselli 0291395132 Place Separate Objects Side by Side in the Assembly View (#17386) 2026-11-11 19:32:58 -03:00
Rodrigo FaselliandIan Bassi ec1b800e23 Round the corners of input boxes and dropdowns (#17393)
Co-authored-by: Ian Bassi <12130714+ianalexis@users.noreply.github.com>
2026-11-11 19:32:14 -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 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
SoftFever 40f43febbd Register Fill bed instances with the plate they land on (#17480) 2026-11-11 22:32:10 +08:00
Ian Chua 8f879a3700 fix: plugin permission refresh with unsaved edits (#17448)
* fix: plugin permission refresh with unsaved edits

* fix: announce permission edit status only when visible
2026-11-11 20:04:09 +08:00
HanifKoh 3c72223aaf Don't Crash or Stay Silent When the OpenGL Context Can't Be Activated (#17441)
* Don't Crash or Stay Silent When the OpenGL Context Can't Be Activated

When the driver refuses to make the OpenGL context current, no ImGui frame ever runs and
OpenGL is never initialized, so ImGui has no current font and the GL functions are never
loaded. A notification that measures its text from an event handler (a validation warning, a
job's progress, the slicing progress bar) then reads the null font and crashes, and once a
slice completes, loading its G-code preview calls the unloaded GL functions and crashes too.

Notifications now skip measuring until a frame has set up the font; they stay Unknown, and
render() already measures them when it draws. The G-code preview is not loaded while OpenGL
cannot be initialized; with OpenGL up, init_opengl() returns at once and nothing changes.

On Windows, a shown canvas whose context cannot be made current is reported once: wx drops the
wglMakeCurrent error in release builds, so the call is repeated to log GetLastError() with the
canvas's pixel format and the display it is on. If OpenGL never came up in the session, the
user gets one error dialog instead of an empty 3D view with no explanation. A GTK canvas can
fail until its surface is mapped, so other platforms only get the crash fixes.

* Name the Display Adapter Instead of Only Suggesting a Driver Upgrade When OpenGL Can't Be Activated

A context that can't be made current has several causes: no OpenGL driver
behind the display the window is on (a disabled adapter, or one running on
the Microsoft Basic Display Adapter), a broken driver, or an overlay. The old
advice to upgrade the driver covered only one of them. The dialog now names
the adapter Windows reports for the window's display and lists the general
checks, and the log line keeps the display device and adapter name.
2026-11-11 14:19:30 +08:00
TheLegendTubaGuy 6d33e58347 Fix panning and rotating from the center of mass details box (#17137)
A drag that starts on the center of mass details box, off its close button, now turns or pans the view like a drag over empty space. Its release no longer opens the canvas context menu. A right click off the box now closes it, the same as a left click. A click inside the box always goes to ImGui, including the click that closes a context menu.
2026-11-10 20:22:43 -06:00
Kris Austinandyw4z 91db25f2cf Fix crashes when clicking in the Measure tool (#17383)
The Measure and Assembly tools could crash on a click when the hovered gripper had nothing to select. That happened off the model over an edge's highlight, on a feature that Assembly mode filters out, or on a selection sphere that was just removed. The click dereferenced an empty `std::optional`, which aborts on builds with libstdc++ assertions, like the Flatpak.

The hover id now names only a gripper hit this frame. A click selects a selection sphere that still exists, or the hovered feature and, in point selection, its point. Otherwise it acts like a click on empty space.

The selected planes and circles no longer get pick raycasters, since a click selects from the hovered feature. The selected circles' raycasters pointed at the hovered circle's, which was freed on the next hover. Also fixes the selected circle's ring keeping the thickness from the zoom it was selected at, a missed ray storing `DBL_MAX` as the point in point selection, and a selected feature's volume being recorded from whatever was under the cursor a frame later.

Checked by hand on Windows and on the Linux Flatpak.

Fixes #17367

Co-authored-by: yw4z <28517890+yw4z@users.noreply.github.com>
2026-11-10 20:00:08 -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
brumbear f9d5a614b0 Fix Flow Dynamics Calibration capability detection (#16055)
Older A1 and A1 mini firmware reports PA support through `support_flow_calibration` but leaves `home_flag` bit 16 clear, so `parse_home_flag` reset `is_support_pa_calibration` and the Flow Dynamics Calibration checkbox was hidden when sending a print. On series N printers, `home_flag` no longer clears the two calibration flags once either one is set. Other printers are unchanged.
2026-11-10 18:49:31 -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
SoftFever c872776d24 Select sketch constraints by clicking their badges instead of deleting them (#17459)
* Select sketch constraints by clicking their badges instead of deleting them

* Drop a selected sketch constraint when geometry is picked or the tool changes
2026-11-11 03:19:41 +08:00
SoftFever 2ee47e29fb Show a sketch's constraints and own name as soon as it opens for editing (#17458)
* Show a sketch's constraints in the sidebar as soon as it opens for editing

* Name the sketch being edited in the Design tab's sketch card and banner

* Keep an ampersand in an edited sketch's name on its card and banner
2026-11-11 03:19:25 +08:00
HanifKoh af5f6806ac Update the Vendored miniz to 3.1.2 (#17294)
* Update the Vendored miniz to 3.1.2

The 2.1.0 copy reads every .3mf and plugin archive we open. Upstream has
since fixed a central-directory offset overflow when reading the zip header,
an infinite loop in tinfl_decompress on a zero code length, an integer
overflow in the header corruption check, wrong sizes in
mz_zip_reader_extract_to_heap and several uninitialised reads on malformed
deflate streams, none of which 2.1.0 has.

The local modifications are carried over onto the new amalgamation:
m_is_utf8 on mz_zip_archive_file_stat, mz_zip_reader_get_extra and
mz_zip_reader_get_filename_from_extra, mz_zip_reader_extract_to_file_w and
mz_zip_writer_add_file_ex for Windows paths, the PrusaSlicer staged writer
(mz_zip_writer_add_staged_open/data/finish) and the zip64 "version needed"
fields. The max_size form of mz_zip_writer_add_read_buf_callback that
PrusaSlicer had patched in is upstream since 2.2.0 and is taken from there.

Verified on Linux: the application and tests build, and the [3mf], [AMF],
[plugin], [project], [SL1Import] and [TextureImport] libslic3r tests pass
(88 cases, 1908 assertions).

* Pass UTF-8 Paths to miniz on Windows

miniz 3.x converts narrow file names from UTF-8 to wide characters
before opening them, where the vendored 2.1.0 passed them to fopen as
local code page bytes. The call sites that wrapped their paths in
encode_path() therefore handed it code page bytes to decode as UTF-8,
which breaks any non-ASCII path. Pass the UTF-8 strings straight
through; the zip entry names still use the native encoding plus the
Unicode path extra field.

* Record the Local miniz Changes as a Patch

The vendored miniz carries BBS and PrusaResearch changes that README-Prusa
described only in prose, so each upstream bump meant finding them again by
hand. Commit the diff between the upstream 3.1.2 release and the files here,
and have the README list what it carries and how to re-apply it.

* Extract Plug-in Files Through extract_zip_entry_to_file

install_plugin still handed miniz a destination converted to the local
code page, which 3.x decodes as UTF-8, so a non-ASCII install path was
mangled; the open then failed and fell back to
mz_zip_reader_extract_to_file_w. That carried function never worked:
mz_wfopen passed a narrow mode string to _wfopen_s, the stream was
opened in text mode, and the wide path went into the narrow
mz_zip_set_file_times. Use the existing helper, which opens an
extended-length wide path in binary mode, and drop the _w API from
miniz, the patch and the README.
2026-11-10 16:48:19 +08:00
HanifKohandRodrigo Faselli 46f7b0e719 Offer the Sliced Objects as a Solid Model While Dragging the Preview (#15818)
* Offer the Sliced Objects as a Solid Model While Dragging

The G-code preview draws every toolpath segment as an instanced box, and its frame cost is
linear in the number of segments drawn. On a plate of large objects that is enough that
dragging the camera or a preview slider cannot keep up, and no amount of per-segment work
changes that; only drawing fewer segments does.

The objects themselves are cheaper: a mesh costs its triangles once, however many layers it
has, and the preview already loads the objects as shells for its translucent ghost. A new
preference, "Only render solid model when dragging" (off by default), draws those shells
opaque in their filament colours instead of the toolpaths while the user drags.

The visible layer range still holds. The shells are cut at the range's top and bottom through
the gouraud shader's z range, and libvgcode keeps a second index buffer holding just the
range's bottom and top layers, filled in the same walk as the full one, which is drawn
afterwards so that it caps the cut with what was really printed there. Switching between the
two sets is a buffer binding, never a rebuild. The prime tower is added to the shells from its
sliced mesh while the preference is on, positioned as the print placed it; it keeps its opaque
colour and so stays out of the translucent ghost. Supports have no mesh and are not shown.

Dragging is the camera, the navigator or either slider being held; a slider reports it from
ImGui's active id, since its dirty flag is raised and consumed inside one frame. A wheel step
holds the solid model for a 150 ms settle time, with the frame that restores the toolpaths
scheduled for when it runs out. The switch is decided at the top of the frame, before the
cached scene is consulted, and a frame that switches redraws the scene. A drag cut short by
focus or capture loss is ended explicitly, and a button release wakes the idle loop, since on
some platforms no idle event follows it until the next input.

With the preference off, nothing is built and the preview is unchanged.

* Release the Reduced Set When Unused and Share the Drag Check With the Scene Cache

The reduced index buffers were only re-uploaded while the preference was on, so
the last set stayed allocated until the next load once it was switched off, and
their size was missing from get_used_gpu_memory(). They are now uploaded on every
rebuild, empty when nothing was built, and counted.

The scene cache and the solid model both asked whether the user was dragging,
with different lists: the cache knew about gizmos and the rectangle selection,
the solid model about the navigator and the sliders. One is_user_interacting()
now answers both.

The tooltip says that negative volumes are not cut out of the solid model, since
load_shells() drops every non-model-part volume, and the preferences handler
keeps the dimming comment with the branch it documents.

* Let the User Choose What the Preview Draws While Dragging

The solid model is one answer to a preview that cannot keep up with a drag; a
reviewer asked for the two that keep the drag view made of toolpaths. The
checkbox is now a combobox, "Simplify preview while dragging", with Off, Solid
model, Skip layers and Outer walls, and a spin, "Draw one layer in every N",
for the toolpath modes. Off is the default, and with it nothing is built.

Skip layers keeps one layer in every N. Outer walls keeps the outer and overhang
perimeters of those layers, so the prime tower and supports, whose segments have
other roles, drop out of it. Both keep the bottom and top layers of the visible
range whole, as the solid model does, so the faces the range cuts open stay what
was printed there.

libvgcode takes the choice as EReducedDetailMode and a stride; the sets are
rebuilt when either changes, and drawing from the reduced one is still a buffer
binding. A mode change reaches the loaded preview at once, as the checkbox did.

* Add a Shell-Only Drag Mode That Keeps What Can Be Seen From Outside

A third mode of the drag preference: the reduced set keeps every role but the sparse
infill, internal solid infill, internal bridge infill and gap fill, which lie under the
skins or between the walls, on every layer. Walls, top and bottom surfaces, bridges,
supports and the prime tower are drawn whole, so from outside the print looks as it does
at rest, and the two end layers of the visible range stay whole as in every mode.

The roles come from the slicer, so the classification is exact wherever the slicer's is.
What a role cannot tell apart is the inside of the prime tower or of a support from its
outside; both are kept whole. A profile with no top or bottom shell layers exposes infill,
which this mode hides.

* Keep Only the Solid Model and Shell Modes While Dragging

The skip-layers and outer-walls modes drew one layer in every N, and every visual
complaint on the review came from the gaps that leaves at close range. The shell mode
draws every layer and looks the same from outside, and the solid model is the one mode
whose cost does not depend on the toolpaths, so the two of them cover what the stride
modes were for. The layer stride goes with them; a saved preference naming a removed
mode falls back to off.

* Hide Infill in the Shell Drag Mode Only Where the Profile Covers It

A profile with no top or bottom shell layers, or no walls, leaves the infill on the surface,
so hiding it changed the picture. The viewer now reads the print's default region settings
when it loads a print and leaves the infill in place for such a print; per-object overrides
are not consulted.

* Keep the Ghost and Cap the Cut of the Solid Model While Dragging

In the solid model mode the translucent ghost disappeared for the length of every drag, since the scene drew either it or the solid; it is now drawn in every mode, so the part above the cut stays in view.

The cut itself was open: a sparse layer on the cut showed, between its lines, whatever lay below inside the hollow shell, the first layer or the bed, which moved with the camera and read as a flickering shadow; and a face of the model in the cut layer's own plane fought that layer's toolpaths pixel by pixel. The solid now runs from the top of the range's bottom layer to the bottom of its top layer, and a stencil pass caps each cut plane, body by body, with a quad in the body's colour darkened where the cut has opened it: back faces less front faces, counted with the depth test off, which leaves a closed body at zero.

* Leave the Preview Untouched While Dragging With the Mode Off

The reduced flag was raised on every drag whatever the mode. libvgcode still drew the full set with the mode off, but the canvas reads the flag: it redrew the scene on the first and last frame of each drag, scheduled an extra frame after every wheel burst, and ended a drag that lost focus or capture. The flag is now raised only when a mode is set.

The realistic view's shadow-caster pass draws whichever set is bound, and the static shadow map's key did not say which, so a map built during a drag stayed thinned after release; the key now includes it.

* Tidy the Drag Mode: Cheaper Caps and No Leftovers

The solid model's cap quads are built once per frame and recoloured per body instead of being rebuilt for each, and the stencil count draws each body directly: going through the collection's render built the full preset config and sorted every volume once per body, per frame. A one-line settings wrapper is inlined, the function that added or removed the tower with the mode is folded into its one caller, the two libvgcode getters nobody calls are removed, and the wheel's settle time is set where the wheel is handled. The Shell only tooltip names internal bridges, which the mode hides.

* Cut the Solid Model at the Toolpaths' Heights on a Printer With a Z Offset

The cut heights took the printer's z offset out of the layer heights, which the G-code processor has already taken it out of, so on a printer with a z offset the solid was cut one offset away from the layers drawn as toolpaths: a gap under the top one and an overlap with the bottom one, and the caps sat off the solid's cut plane. The layer heights are in the shells' frame as they are.

* Test That AppConfig Keeps Only the Preview Drag Modes It Knows

A missing mode becomes off, the three modes survive, and a value from an earlier revision or an empty one falls back to off.

* Hold the Navigator's Drag for as Long as the Button Is Held

The navigator reports a drag only on a frame the mouse moved in, and the flag is written by the overlay, after the frame has chosen which toolpath set to draw. A still frame in the middle of a drag dropped the flag, so the next one drew the full set, and a release with no motion left the reduced set on screen until the next mouse event. The flag now holds while the button does, and the drag check reads the button itself.

* Keep the Toolpaths While Dragging a Print Whose Layers Do Not Rise

The solid model is cut at the heights of the layer range's two ends, one range for the whole plate. Printed object by object, the layer heights start over with each object, so those two heights do not bound the range: an earlier object was cut at a later one's height, and a range across two objects could come out empty. Such a print keeps its toolpaths while dragging, as a plate with no shells does.

* Cut the Solid Model Past a Layer With No Extrusion

A layer with no extrusion has a height of zero, and the solid model read its cut heights from the layers at the ends of the range as they were: with such a layer under the top of the range the whole solid was cut away. The nearest layer below with a height stands in for it.

* Keep the Toolpaths While Dragging a Preview Cut by the Section View

The section view cuts the toolpaths open to show their inside. The solid model was drawn with no clipping plane, so while dragging it covered the section whole and the section came back on release. A preview with a section active now keeps its toolpaths while dragging, as a print made object by object does; the shell mode draws through the same plane as the full set and is unaffected.

* Keep the Supports While Dragging in the Solid Model Mode

The solid model stands in for the sliced objects, which are the only shells the preview loads: a support has no mesh, so the moment a drag started everything under an overhang vanished and the object sat on nothing until release. The reduced set now keeps the support roles whole on every layer, as the shell mode does, and the supports draw as toolpaths beside the solid.

* Draw the Layers Down to the Nearest Infill Whole at Each End of the Range

The reduced set kept the two end layers of the visible range whole, and the solid model was cut right under the top one, as though every layer carried every role. Infill combination prints the sparse infill of a few layers in one and leaves the others walls alone, and a support layer with no object layer at its height gets a layer of its own, so a cut under such a layer capped the print where at rest the infill of the layer below shows through: a flat disc inside the walls while dragging, the infill grid on release. Each end of the range now runs to the nearest layer with sparse infill, at most eight layers deep, in both modes, and the solid is cut at the edges of those bands. The layer table is the whole plate's, so another object's solid infill on a layer does not end the band while sparse infill is within reach; a print with none in reach falls back to the nearest layer with any infill, else keeps the end layer alone. The layer table records which layers have infill when the toolpaths are loaded, and the bands are covered by tests.

* Colour the Solid Model as the View Colours the Toolpaths

The solid model and its caps wore the filament colours whatever the view, so a drag in the Line type view turned an orange-walled, red-filled print into a block of its filament colour. The solid stands in for the toolpaths, so it now takes their colours: in a view that colours by something other than the filament, the body the outer wall's, each cap the infill's of the layer it is cut under, sparse before solid, and the prime tower its own role's, each sampled from the first vertex of the role through the viewer. The filament views keep every body its own colour. The colours are resolved when a drag starts and when the view type or the end bands change.

* Close the End Bands Object by Object

The end bands of the reduced set stopped at the nearest layer with sparse infill anywhere on the plate. Two objects rarely combine their infill on the same layers, so where one object still had sparse infill on a layer the other's walls-only layer closed the band, and that object was capped right under it: a flat disc inside the cone's walls while the funnel beside it printed its last infill. The G-code labels its moves with their object, so the wrapper that feeds libvgcode now tallies walls and infill per object and layer and hands the viewer the layers whose infill closes every object printed on them; the bands stop at those. Sparse infill closes an object on a layer. Solid infill closes it only where the object has no sparse infill left in the direction the band looks from, its top shells as seen from above and its bottom shells as seen from below, since a layer whose sparse infill was combined into another still carries the solid infill under its skins and is open; an object with no sparse infill anywhere is closed by any infill. A range from the print's first layer has no bottom band, as nothing is cut under that layer. A preview built from the print, or one whose G-code labels no object, carries no such list and keeps the judgement by the roles of the whole layer.

The G-code processor read the object only from the "start printing object" line that Bambu printers add; every printer writes "printing object <name> id:<n> copy <m>", so it reads that too, and takes the id after the last "id:" so that a colon in the name does not mislead it. The printable-area check that groups extrusions by that id now sees the objects of such a print one by one, as it does for a Bambu print, instead of as one.

* Colour the Solid Model From the Grade Most of the Role Was Printed At

The solid model took each colour from the first vertex of the role in the
sampled layer. The first vertex of an outer wall is the start of its
extrusion, still on the acceleration ramp, so under Actual speed and Actual
flow the whole solid showed the slowest grade of the legend, and under Fan
speed the body colour jumped between drags with whichever layer happened to
be the top cut.

Viewer::find_extrusion_vertex() now takes a layer interval and, in a view
that grades the toolpaths by a value, returns the extrusion of the role at
the length-weighted median of that value over up to eight layers spread
across the interval; in any other view the first extrusion found, as
before. The body and the prime tower are sampled over the layers the solid
stands for, each cap in its own cut layer.

* Count Each Cap of the Solid Model Against Its Own Cut

With the bottom slider above the first layer the solid model is cut at both
ends, and the one stencil count that both caps were drawn through counted
the body with both cuts applied. An open tube counts a view ray through
both openings as closed, so the top cap had a hole through which the
infill toolpaths showed, and a ray in through a wall and out through the
bottom opening as open, so from a low angle the top cap's quad, which
spans the bounding box, was drawn in the air beside the body.

Each cap now gets its own count, with the body cut at that cap alone and
whole at its other end, which is odd exactly where the cap plane lies
inside the body from any viewpoint. The second body pass per volume only
runs when the bottom is cut.

* Let the Solid Model Cast and Take the Realistic View's Shadows

The realistic view's shadow map was built from the toolpath segments
alone, and while dragging in the solid model mode those are only the end
bands and the supports, so the solid threw no shadow at all. Its own pass
also forced the shadow intensity to zero, so it took none either.

In that mode the shells, cut at the solid's heights, are now drawn
depth-only into the same map through the flat clip shader, and the solid
samples the map back with the light the canvas passed on, so a body
shades the plate, its neighbours and the end-band toolpaths as the
toolpaths it stands in for would, and takes their shadows in turn. The
map's key also carries the drag mode, so a map built with the solid is not
kept for the shell mode.

* Keep the Reduced Set Up While a Navigator Click Turns the Camera

A click on a face or a corner of the 3D navigator makes it turn the camera
over the forty frames that follow, with no button held. Each of those
frames was drawn with the full toolpaths, since nothing counted as a drag,
and on a weak GPU the turn took seconds.

The overlay reports each of those frames as a change that is not a drag,
so the canvas holds a flag for as long as that lasts and counts it as
interacting; the frame after the last one is requested so that the full
toolpaths come back on their own.

* Let the Cut Faces of the Solid Model Cast Their Shadow

The solid model was drawn into the shadow map as the shells cut at the
same heights, open where it is cut, on the ground that from the light an
open body's far wall closes its outline. It does, but not its depth: a
ray through the opening passes the end band's sparse infill lines and
reaches the far wall, so on a flank below the light's side the solid
carried the lattice of those lines, where the toolpaths it stands in for
are in one uniform shadow under the opaque layers above.

The shells now cast through a shader of their own: a back face that a
ray reached through a cut is drawn at the depth of that cut, the nearest
of the cut planes on the way back toward the light, and a front face
keeps its own depth. A ray reaches a back face through a lit wall as
well, and the cut's depth would then shadow that wall, so the front
faces are drawn on their own first, into a depth texture of the
viewer's, for the shader to tell the two apart. The shadow map has no
stencil, so the camera pass's cap count could not be reused here.

* Hold the Solid Model's Body Colour While a Slider Drag Moves the Span

A slider drag shows the solid model like a camera drag does, and the
body took a fresh sample at every step, from eight layers spread over
the span of the moment. Where the walls' speed or fan differs from layer
to layer, each step fell on another mix of layers and the length-weighted
median flipped with it, so the body jumped between the grades of the
legend for as long as the slider moved.

The body and the tower are now sampled once, as the drag begins, and
held until it ends; the next drag samples them afresh over the span it
finds. Each cap still follows its own layer, as the toolpaths of that
layer would.

* Colour Each Body of the Solid Model From Its Own Toolpaths

The solid model took one body colour for every object on the plate,
sampled from all the walls of the layers it stands for, so an object
printed at its own speeds wore the grade of the others while its
toolpaths showed another.

The viewer's sampler now takes a rectangle of the XY plane and counts
only the extrusions that end inside it, and each shell volume samples
its body and caps within its own footprint; the tower likewise, from its
own role. Objects that overlap in XY share their samples, which is as
close as the toolpaths come to naming their object.

* Dim and Grey the Solid Model With the Layers It Stands For

With "Dim lower layers" on, the toolpaths around the inspected layers
are drawn at the preference's brightness, and with it off they go dark
grey while the moves slider is short of the top layer's end. The solid
model, which stands in for exactly those layers, was drawn at full
brightness either way.

The layers the solid stands for are never the ones a slider thumb
lights, so its bodies, caps and tower now take the same brightness or
grey the toolpath shader gives the rest of the print, decided by the
rule that shader is given.

* Cut the Solid Model by the Section View

While the section view was on, a drag kept the full toolpaths, since the
solid model would have covered what the view cuts them open to show.
That held even where the plane cut nothing, so with the view on the drag
mode gave nothing at all.

The solid now takes the section plane as the toolpaths do: the bodies
are clipped by it, the two height caps are drawn on its kept side, and
the section face gets a cap of its own, counted on the body cut by that
plane alone and drawn between the two heights, in the body's colour
darkened like the others. What the plane cuts away casts no shadow.

* Keep the Travels Between the End Layers of the Solid Model

With Travel shown in the legend, the solid model kept the travels only on the
layers at the ends of the range, so they vanished on every drag. They are kept
on every layer now, as the supports are. The rule moves into Utils so the
cases can be tested.

* Drag Belt Printer Previews With the Toolpaths Instead of the Solid Model

The solid model is cut by horizontal planes at the end layers' heights, but a
belt printer's layers are planes tilted at the belt angle, with heights in the
G-code's frame, so the cuts missed the body. On belt printers a drag keeps the
toolpaths, as it does for a print whose layer heights start over per object.

* Cast the Solid Model's Cut Faces Into the Shadow Map

A band cut at both ends let the light in through the top cut and out through
the bottom one past every wall, so only the top band's infill lines cast and
the bed showed their grid. The cut faces are now counted and drawn into the
shadow map as the visible pass draws them: in a depth and stencil target of
the viewer's, since the map has no stencil, then copied into the map. This
replaces the back-face depth rewrite of the cut caster shader, and both
passes build the caps through one helper.

* Describe the Solid Model's Cut-Face Shadows, Travels, Belt Fallback and Section Cut

* Keep Parts Above the Visible Range Out of the Solid Model's Cut-Face Shadow

The light's frustum ends at the highest visible layer, so its near plane
cut through parts above the range (a bunny's ears) during the cut-face
stencil count: only their far faces were counted, the count read them as
open and the bottom cap cast an ear-shaped shadow on the bed. Clamp depth
during the count so every face is counted.

* Say in the Drag Option That Belt Printers Keep Their Toolpaths

The solid model handles the section view, and belt printers fall back to
the toolpaths; the description said the opposite of both.

---------

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-11-10 08:23:08 +08:00
Noisyfox af931e65fc Fix plate offsets in the preview tool position readout (#17172)
Fix preview tool position coordinates on additional plates
2026-11-09 21:28:40 +03:00
Ian Bassi b1d8c5da60 Section view: percent depth, wheel on the panel, start at 50% and Follow camera (#17338) 2026-11-09 13:37:37 -03:00
TheLegendTubaGuy b4bd9c8492 Remove null checks before delete (#17375)
Deleting a null pointer already does nothing. Enable clang-tidy's readability-delete-null-pointer so new null checks around delete are caught on changed lines, drop the one in DragCanvas's destructor, and remove ParamsPanel::delete_subwindows(), whose only caller is inside #if 0.

The --fix help and summary message in the clang-tidy scripts are reworded to "apply clang-tidy's fixes", since this check has its own fix.

Closes #7847
2026-11-09 07:55:35 -06:00