Commit Graph
222 Commits
Author SHA1 Message Date
SoftFever dc522e59e4 Start an opt-in MCP server with slicer, preset, action and screenshot tools 2026-10-28 19:43:09 +08:00
SoftFever 16c4ef8675 Add the MCP protocol, loopback transport and job core 2026-10-28 19:43:08 +08:00
TheLegendTubaGuy b6ca378b23 Apply the print dialog's Box mapping on Qidi printers (#16723)
With printer agents on, the Qidi agent now uses the Box slot picked for each filament in the print dialog. After the upload it writes `SAVE_VARIABLE VARIABLE=value_t<n> VALUE="'slot<m>'"` for each mapped filament, which the firmware's T<n> macros read. Then it starts the print through `/printer/print/start`, because the Max 4, Q2, Q2C and Plus 5 only open prints from the copy that Moonraker's print start makes.

- `MoonrakerPrinterAgent::start_local_print` now ends with a virtual `print_uploaded_file()`. The default still sends `SDCARD_PRINT_FILE`, so other Moonraker agents are unchanged.
- Box units show as "Qidi Box 1", "Qidi Box 2". Agents can set an optional `display_name` on an AMS unit.
- New agent flag `native_device_tab`. Qidi sets it to false, so its native Device and Calibration tabs are hidden and the web page becomes the Device tab.
- The Moonraker agent retries its first connection with the status stream's backoff. A disconnect, a newer connection or closing the app stops the retries.
- The print dialog fetches filament data itself for agents that only send it when asked, so the slot picker shows the Box units without a sidebar sync.
- Agent printers show their address in the print dialog's printer list instead of "(LAN)". Bambu printers keep "(LAN)".
- A single nozzle whose size the printer hasn't reported shows no size instead of "Unknown".
2026-10-27 10:47:06 -05:00
Eldenroot af16875afb ENH: Configurable shortcuts to switch between the main tabs including tab switching (#16301)
Adds unbound shortcuts to jump to Prepare, Preview, Device and Project, and Ctrl+Tab / Ctrl+Shift+Tab to cycle through the tabs. Cycling wraps around, skips tabs that refuse the switch, and moves focus to the tab bar on web pages so the next key press still works.
2026-10-27 10:10:20 -05:00
SoftFever c34532aefa Recover pending custom-printer deletes and keep parents of kept presets
Presets cloned from a bundle's for a new printer are the user's own, and every
cloud delete now passes the same check that the preset is the user's synced one.
2026-10-27 20:46:21 +08:00
SoftFever 474980a51b Revalidate the subscription list instead of downloading it on every poll 2026-10-27 18:53:55 +08:00
SoftFever bec67ab2c7 Stop preset cloud deletes from retrying forever 2026-10-27 17:52:57 +08:00
f92dc78be0 Check Moonraker Free Space Before Reporting Storage (#16903)
* Report storage on every Moonraker status push

MachineObject sets the storage state on every push, first from "sdcard"
and then from home_flag bits 8-9. The Moonraker agent sent neither, so
each push reset the state to NO_SDCARD and the send dialog blocked with
"Storage needs to be inserted before printing". Moonraker printers always
have storage (virtual_sdcard), so report it in both places.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Check Moonraker Free Space Before Reporting Storage

Report storage only when the gcodes root has free space, read from
disk_usage in /server/files/directory?path=gcodes, instead of always
reporting it. The status stream checks before the subscription and again
from the read loop every 30 s. A check that fails counts as no storage.

Move the Http::get boilerplate of the device info, status, object list
and storage queries into one get_json helper.

* Ask to Insert Storage or Free Up Space Before Printing

A printer agent now also reports no storage when its disk is full, so
the messages for that state say to free up space as well. The two
"before send(ing) to printer" variants share one string.

---------

Co-authored-by: dr-apple <15102858+dr-apple@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 13:27:04 +08:00
Ian Bassi b4772dca38 Add Order By to the plate menu (name, filament, height, size) (#16850) 2026-10-26 10:43:41 -03:00
Noisyfox 13a40b47a2 Fix MSVC-only lazy preset dialog build failure (#16899)
* Fix MSVC-only build failures after MainFrame forward declarations

* Defer lazy preset dialog instantiation with unique_ptr

* Include memory directly for std::make_unique
2026-10-26 20:34:34 +08:00
SoftFever 555321215e Add alpha and gradient support to custom AMS colors (#16538)
# Description

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

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

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

# Screenshots/Recordings/Graphs

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


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


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


## Tests

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

[How to Download Pull Requests Artifacts for
Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts)
2026-10-26 17:26:19 +08:00
HanifKoh fbc50d3d3a Start a Creality Print Job From the Spool Holder When No CFS Slot Is Mapped (#16794)
CrealityPrint::start_print() chose between the plain opGcodeFile start and the
colorMatch + multiColorPrint pair by the model id alone, and inside the
multi-colour branch it fell back to the plain start only when a filament was
mapped onto box 0. A K1-family printer reports the same model id with and
without a CFS, and without one it never answers the boxsInfo query, so the send
dialog had no slots to map and the printer received a colorMatch with an empty
list followed by multiColorPrint. The job printed, but the firmware flagged
"no material" (materialStatus 1) for its whole duration. The same happened on
any CFS-capable model whenever the boxsInfo query failed.

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

Fixes #16695.
2026-10-26 15:27:20 +08:00
Noisyfox 0d7c956558 Merge upstream/main into dev/ams-custom-color-alpha-gradient 2026-10-26 15:18:06 +08:00
SoftFeverandSoftFever acb4cce4ae Explain why settings are hidden or disabled (#16657)
* Record option availability reasons per settings tab

* Explain option restrictions in field and label tooltips

* Show option restriction reasons in settings search

* Explain support and raft option restrictions

* Explain print option dependency restrictions

* Explain printer and filament option restrictions

* Declare settings owner lookup in the Tab header

* Reuse repeated option availability reasons

* Fix availability tooltips for synthetic options

* Deduplicate availability reasons in row tooltips

* Keep motion limit availability consistent with disabled controls

* Show availability reasons in object table settings

* Explain filament override retraction dependencies

* Explain disabled preset compatibility conditions

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

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-10-26 13:59:47 +08:00
HanifKoh 5817a76da6 Trim pybind11 Includes From the Plugin Headers (#16839)
* Move Plugin JSON-Python Helpers Out of PluginFsUtils to Trim pybind11 Includes

* Forward Declare pybind11 module_ in PagesPluginCapability Header
2026-10-26 12:40:52 +08:00
Eric Lin 4804b54cd1 Fix: WSS streaming over TLS (#16878)
The Moonraker printer agent's status stream returned at once for an https print host, so Orca got the printer's first status over HTTP and no live updates after it. The stream now connects over TLS for an https print host. Like the agent's HTTP requests, it does not verify the certificate, so a printer's self-signed one is accepted. It sends the host name for SNI, and the `Host` header leaves out the default port 443.
2026-10-25 21:56:21 -05:00
HanifKoh 75252a70f7 Bound Plugin Disconnect and Python Shutdown When OrcaSlicer Exits (#16765)
* Bound Plugin Disconnect and Python Shutdown When OrcaSlicer Exits

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

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

* Run the Threading Atexit Hooks Before Waiting for Plugin Threads

An idle concurrent.futures worker only ends when the hooks registered with
threading._register_atexit() tell it to, and Py_Finalize runs those after
the shutdown wait, so a plugin that left an executor open made every exit
wait the full deadline and skip finalization. The hooks now run first, on a
daemon thread joined within the same deadline, since they join their
workers without a timeout.
2026-10-26 03:52:09 +08:00
HanifKoh 9cb9f9694f Keep nlohmann/json.hpp Out of Widely Included Headers (#16843) 2026-10-26 02:33:27 +08:00
SoftFever 8efa90c763 Merge branch 'main' into dev/option-unavailability-reasons 2026-10-26 02:19:01 +08:00
HanifKoh 8af4c382a1 Add Precompiled Headers to the Larger Test Suites (#16838) 2026-10-26 01:06:25 +08:00
Kris Austin 2054242884 Fix Creality print host hanging on a printer that stops answering (#16772)
ws_connect(), query_boxes_info() and start_print() set expires_after()
deadlines, then made synchronous Beast calls. Beast only applies those
deadlines to async operations, so none of them fired. A printer that
accepted the websocket and then stopped answering blocked the caller
forever. That froze the GUI thread when the Creality send dialog opened
or the sidebar synced filaments, and left uploads stuck after the file
arrived.

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

The websocket port and deadlines move into a protected ws_settings
member, so the tests can use a local port and short deadlines. The new
tests run CrealityPrint against a fake printer that goes silent before
or after the handshake.
2026-10-24 22:01:15 -05:00
SoftFever 54afdaf887 Merge branch 'main' into fix/plugin-network-permissions 2026-10-24 23:58:51 +08:00
SoftFever b4a2eb8803 Merge branch 'main' into feat/plugin-wildcard-permissions 2026-10-24 23:14:26 +08:00
Ian Bassi 7319a2c54c Draw translucent filaments translucent in Preview (#16776) 2026-10-23 17:14:09 -03:00
peachismomo de6861bb38 fix: tests 2026-10-24 01:40:28 +08:00
Noisyfox bfd3002875 Merge upstream/main and retain motion limit availability reasons
Follow the removal of silent_mode by updating only motion limit index zero, preserving disabled tooltips and visible controls.
2026-10-23 22:21:29 +08:00
Ian Chua 9739d3a9c4 fix: reject symlink and resolve relative paths to absolute 2026-10-23 16:48:34 +08:00
Ian Chua 3bb40bc007 Merge branch 'main' into feat/plugin-wildcard-permissions 2026-10-23 16:15:30 +08:00
Ian Chua 6a0223f055 fix: Tighten plugin network grants and clarify consent scope 2026-10-23 16:12:57 +08:00
Ian Chua 0439578fca Merge branch 'main' into fix/plugin-network-permissions 2026-10-23 13:56:09 +08:00
Ian Chua 557feba649 feat: introduce plugin APIs for mutable presets (#16518)
* feat: introduce plugin APIs for mutable presets

* fix: tests

* fix: tests

* doc: HLSD for preset plugin APIs

* feat: preset APIs

* fix: remove async behavior and clang-tidy

* fix: update demo plugins
2026-10-23 13:54:08 +08:00
Noisyfox 7d0ba0a5aa Merge upstream/main into option-unavailability-reasons
Keep option availability reasons while adopting the ArcFittingMode enum.
2026-10-23 09:43:58 +08:00
Kris Austin 3f8ff53e65 Keep keys away from the 3D view while ImGui has the keyboard (#16673)
The 3D view decided whether to run its shortcuts from ImGui's "wants the
keyboard" flag, which is updated a frame late. The first key typed after
clicking into a field could still reach the canvas.

The canvas now leaves every key to ImGui while an ImGui text field is
active, while a popup (dropdown, menu or modal) is open, or while a
slider or button is held with the mouse. A focused sidebar text field
works the same way. Global shortcuts still run unless they edit text.
Every key still goes to ImGui.

- ImGuiWrapper::claim_key_event() decides on the key-down. The key's
  repeats, char event and release follow that decision, so a key never
  both runs a shortcut and types.
- Esc closes an open dropdown or menu before the gizmo.
- Esc and Tab during a slider drag no longer close the gizmo or switch
  views.
- text_input_active() reads ImGui's text input request, so a slider
  that once had a value typed into it no longer counts as a text field
  when dragged.
- A modifier whose key-up went to a dialog no longer stays stuck. The
  canvas releases held modifiers when it loses the focus, and ImGui
  takes its modifiers from each mouse event.
- The macOS Edit menu's key equivalents follow the same rule.
2026-10-22 10:22:23 -05:00
Noisyfox 4eac8f70a0 Explain print option dependency restrictions 2026-10-22 23:01:01 +08:00
Noisyfox ffb1a0b6cc Explain option restrictions in field and label tooltips 2026-10-22 23:01:01 +08:00
Noisyfox 3573195780 Record option availability reasons per settings tab 2026-10-22 23:01:01 +08:00
SoftFever f92f75e0fa Feat: Add multiple and 3D bed exclusion volumes (#13777)
# Description

This PR adds opt-in, height-aware exclusion volumes to OrcaSlicer,
including multi-nozzle handling, object and generated-geometry
validation, final G-code collision checking, and travel rerouting.

It grew from the original object-placement prototype into a
collision-aware slicing pipeline with documented limitations. The
central compatibility decision is that Orca's existing
`bed_exclude_area` keeps its historical meaning, while the new
`bed_exclude_volumes` setting explicitly enables the stronger
collision-aware behavior.

<img width="935" height="707" alt="Travel paths routed around exclusion
volumes"
src="https://github.com/user-attachments/assets/22925e5c-a3b1-4c26-be1a-8a89d9970cb5"
/>

Related issues: #5922, #10579, #10638 and #12774.

## Why this is useful

The existing 2D exclusion area prevents object placement in areas such
as the filament-cutter corner on Bambu printers. It cannot describe low
bed clips, raised tool docks, camera arms, flying-gantry hardware, or
other obstacles that occupy only part of the printer's Z range.

Treating every existing area as a physical motion obstacle would also be
unsafe for compatibility: some printers deliberately move into their
excluded material area. This PR therefore separates the two concepts
rather than changing the meaning of existing profiles.

| Setting | Purpose | Existing motion affected? |
| --- | --- | --- |
| `bed_exclude_area` | Existing bed-fixed material/placement keep-out |
No G-code checking or travel rerouting |
| `bed_exclude_volumes` | Shared 3D collision volumes |
Object/generated-material checks, G-code validation and travel rerouting
|
| `extruder_bed_exclude_volumes` | Per-extruder 3D collision volumes |
Same collision behavior, resolved for the active physical nozzle |

Bed areas and collision volumes are additive. A printer can retain an
existing cutter/material keep-out while adding separate physical
collision volumes. Belt printers retain the existing projection of bed
areas onto the tilted belt surface; collision volumes remain in model
coordinates.

## Configuration and syntax

`bed_exclude_volumes` accepts one or more polygonal prisms:

```text
XxY,XxY,...
```

defines a full-height collision volume.

```text
REGION|REGION|REGION
```

defines multiple independent volumes.

```text
ZMIN..ZMAX;XxY,XxY,...
```

defines a volume active only across that Z range. Either Z bound may be
omitted:

```text
..10;20x20,40x20,40x40,20x40
30..;20x20,40x20,40x40,20x40
```

For example:

```text
20x0,45x0,45x18,20x18|8..22;115x20,145x20,145x48,115x48
```

defines one full-height volume and one volume active from Z=8 mm to Z=22
mm. Z ranges are validated and clamped against the configured printable
height, and decimal parsing is locale-independent.

The CLI exposes the same distinction:

```text
--bed-exclude-area
--bed-exclude-volumes
```

Existing scripts using `--bed-exclude-area` retain the original polygon
format and behavior.

## Backward compatibility and migration

- Existing profiles and projects using only `bed_exclude_area` keep its
material/placement keep-out meaning; they do not implicitly enable
collision-volume checking or travel rerouting.
- Stock printer motion is not checked or rerouted against bed areas.
This is important for machines that deliberately enter an excluded
material area during cutting or loading.
- The new syntax is stored under separate config keys, so an older Orca
build does not try to deserialize a volumetric string as the existing
point-list option.
- In **Printer settings → Basic information → Printable space**,
**Excluded bed area** remains a normal editable field with Orca's
standard reset controls. **Toolhead collision volumes** is a separate
field directly below it. There is no Convert/Copy button and neither
setting clears the other.
- A bed-area polygon can be manually copied into the collision-volume
field to describe a full-height physical obstacle. Pasting volume syntax
into the bed-area field instead prompts for confirmation before adding
it to the appropriate volume definitions. The saved bed area, existing
volumes and selected nozzle mode are preserved; cancelling leaves them
unchanged.
- If a user does not configure the new volume keys, the new G-code
checker, rerouter, support trimming and nozzle-specific brim behavior
remain inactive.

This gives existing profiles a stable compatibility boundary while
allowing users and maintainers to migrate deliberately to full collision
checking over time.

## Multi-nozzle behavior

For multi-nozzle printers, the collision-volume mode selects one of
three behaviours. In individual mode, each extruder's definition is
edited on its own Extruder settings page. These modes apply only to
collision volumes; the excluded bed area stays shared and bed-fixed.

Collision volumes support three modes:

<img width="549" height="441" alt="Exclusion volume behavior selector"
src="https://github.com/user-attachments/assets/6ca8c2e2-d00e-4b32-9b12-bfbff0928966"
/>

### Shared

Every physical nozzle uses the same collision-volume definition.

<img width="2353" height="1633" alt="Shared exclusion volumes"
src="https://github.com/user-attachments/assets/96fe938b-07b4-4cd9-b587-e31f2ebba5f8"
/>

### Toolhead-relative (nozzle offsets)

The shared definition is treated as relative to the toolhead. Orca
derives the other nozzles' collision regions using their configured XY
offset from the reference nozzle. This is useful where the same physical
carriage must avoid an obstacle but its position changes when a
different offset nozzle prints at the same model coordinate.

<img width="1084" height="803" alt="Toolhead-relative exclusion volumes"
src="https://github.com/user-attachments/assets/e0790ee4-68b5-444f-90ac-22a5eba05eec"
/>

### Individual per extruder

Each physical extruder/nozzle has its own independent volume definition.
This supports machines whose valid region differs by tool and cannot be
derived from a simple nozzle offset.

<img width="1123" height="761" alt="Independent exclusion volumes for
three extruders"
src="https://github.com/user-attachments/assets/c6404ceb-9958-4df8-93ed-5ff2ac7dc658"
/>

Object validation resolves logical filament assignments to the physical
nozzle or nozzles that may print the object, including automatic Bambu
mapping. If an object may use several nozzles through painting,
feature-level assignments, modifiers, support or interface material, the
complete object is conservatively checked against every relevant
nozzle's volumes.

## Object validation and 3D preview

Object collision detection uses a cheap XY/Z broad phase followed by an
exact mesh-versus-prism test. The exact test:

- Avoids rejecting an object whose XY shadow overlaps a raised volume
while its real mesh remains clear.
- Detects normal surface crossings.
- Detects a volume completely enclosed inside a solid model.
- Respects object-instance and model-volume transforms.
- Separates the collision decision from optional preview-mesh
generation.

When a collision is found, Orca reports the relevant extruder where
possible and renders the intersecting model surface in red. The bed
preview shows a neutral grey footprint, a thin nozzle-colored ownership
border where appropriate, and a translucent 3D prism when a nearby
object makes the volume relevant. Raised volumes keep their ownership
outline on the bed rather than floating at their starting Z.

<img width="578" height="534" alt="Red model and exclusion-volume
intersection preview"
src="https://github.com/user-attachments/assets/d409f574-1790-48e5-b4a3-703273439954"
/>

Single-nozzle/shared geometry remains visually neutral; nozzle colors
are used when they convey distinct tool ownership.

The default automatic preview limits the translucent 3D geometry to
nearby object height to avoid obscuring the workspace. **View → Show all
collision volumes** displays the complete configured Z ranges, including
on an empty bed. Its default shortcut is **Ctrl+Shift+V**
(**Command+Shift+V** on macOS), and it can be changed in the shortcut
settings. Orca remembers this application-level display preference
independently of printer presets; it does not change collision checks or
slicing.

## Arrange and Fill Bed

Arrange and Fill Bed receive Z-aware, nozzle-aware obstacles, so an
object may occupy a footprint belonging only to another nozzle or pass
below a raised volume when its height permits it.

- Existing objects remain obstacles when Fill Bed creates new copies.
- Convex volume footprints are passed through accurately.
- Orca's current libnest2d path supports convex NFP obstacles only, so
non-convex volumes use a documented conservative bounding box until
convex decomposition is implemented.
- Orca's existing final alignment and normal unplaced-item behavior are
retained.

<img width="1097" height="846" alt="Fill Bed with multiple tools and
exclusion volumes"
src="https://github.com/user-attachments/assets/8c0ee5cf-624b-42a6-b57a-13c73400ac5c"
/>

## Brim and support generation

When collision volumes are enabled, object and support brims are clipped
against the relevant first-layer volume footprints before their final
extrusion paths are generated. Brim ownership is retained so touching
object and support brims cannot be merged and silently reassigned to a
nozzle whose volume they intersect. Established bed-edge and bed-area
brim clipping remains unchanged when collision volumes are not
configured.

<img width="1139" height="770" alt="Object and support brims clipped
around nozzle-specific volumes"
src="https://github.com/user-attachments/assets/2913ff31-53e4-4e43-8b27-1afba7e3bafb"
/>

Normal support and raft polygon categories are trimmed against the
relevant volumes over each support layer's actual vertical slab.
Support-material resolution accounts for explicit support/interface
tools, “current filament” behavior, alternating material layers,
automatic physical-nozzle mapping, support brims, and shared support
geometry.

TreeSupport3D receives active exclusion geometry during branch planning
so its existing avoidance machinery can steer branches around obstacles
rather than merely cutting finished paths.

## Final G-code collision validation

The final emitted G-code is checked as a safety backstop after slicing.
The checker tracks:

- The active physical nozzle and its XY offset.
- Absolute and relative XY/Z motion.
- Travel, extrusion and other parsed motion types.
- Tool selection and physical/nozzle mapping.
- Explicit motion in start, filament-change and tool-change G-code.
- Coordinate resets and common `G28` forms, including bare, spaced,
compact and parameterized axis selections.

Material keep-outs from `bed_exclude_area` are deliberately ignored by
the motion checker. Only explicit collision volumes constrain motion.

If Z is genuinely unknown, the check is conservative across all relevant
heights and the warning identifies that fact and includes the relevant
G-code line. The artificial first segment that the preview draws from
`(0,0)` is not treated as a real machine move.

## Travel rerouting

Generated travel moves are rerouted around active collision volumes when
a valid route exists.

Routing is:

- Aware of the travel's actual Z slab and planned lift/Z-hop.
- Resolved for the active physical nozzle.
- Constrained so any detour vertices added by Orca remain inside the
printable bed.
- Able to accept firmware-established start/end points on or beyond the
nominal bed edge.
- Revalidated before the replacement path is emitted.

The implementation covers ordinary generated travels, the first
generated move after start G-code, and moves following physical or
same-nozzle filament changes. Explicit movement commands in custom
start/tool-change G-code update the tracked position so the next
generated travel begins from the correct point without defeating Orca's
post-toolchange Z restoration.

Obstacle geometry is cached by extruder and active Z-region set, with
bounding-box rejection before expensive polygon work. Clear travels
therefore avoid repeatedly unioning and offsetting the same obstacles.

If no safe route can be found, Orca leaves the original move for the
final checker to report rather than emitting an assumed-safe detour.
Extrusion paths are validated but never rerouted.

<img width="1286" height="706" alt="Travel rerouting from start G-code
across multiple Z-aware volumes"
src="https://github.com/user-attachments/assets/a68cd98f-5576-4f78-af43-697e9f687a9b"
/>

And here is an example of independent nozzle travel rerouting:
<img width="2532" height="876" alt="image"
src="https://github.com/user-attachments/assets/28b0c26e-59d6-42b9-a64f-4c2205c4ea3f"
/>


## Testing and review status

Targeted Catch2 coverage now includes:

- Bed-area/volume parsing, validation, confirmed paste handling,
additive behavior and CLI options.
- Belt-surface projection of bed areas through both static and dynamic
region resolution, including the reported cube positions, with collision
volumes left unprojected.
- Shared, toolhead-relative and individual per-extruder resolution.
- Physical-nozzle and filament mapping.
- Exact object intersection, including fully enclosed prisms and
transformed instances.
- 3MF persistence.
- Arrange behavior for convex and non-convex obstacles.
- Brim bed-boundary and volume clipping regressions.
- Support and interface-material masks across support polygon
categories.
- G-code motion classification, coordinate tracking, homing forms and
tool selection.
- Safe travel rerouting, Z-aware activation, nozzle selection, off-bed
firmware endpoints and failure cases.

The reviewed `929beaee15` revision passed the CI checks, and review
testing confirmed that the unit tests and earlier arrange, tool-change Z
restoration, support, brim and brim-ownership regressions still pass.
Stock-output comparisons covered 12 printers × 3 jobs plus 17 project
files and produced G-code identical to `main` when the new feature was
not configured.

The belt projection correction and its regression coverage are included
in the latest update. Please use the checks below for the current head's
build and test status; earlier successful runs do not substitute for
validation of a new revision.

Review also compared CLI output against `main` across stock printers and
multi-filament projects. The compatibility regressions found during that
review—including stock Bambu cutter motion, preset dirty state,
unintended bed-area brim/support changes, tool-change Z restoration,
stale post-change origins, arrange rejection, router cost, locale
parsing and bed-edge brim clipping—have been addressed.

## Known limitations and follow-up work

The implementation deliberately favors conservative safety. A false
positive or some unused build volume is preferable to emitting a
movement that may collide with the machine. Collision warnings are not
an automatic repair or a guarantee of safe output.

- Skirts and draft shields are not regenerated or detoured around
collision volumes. The final checker can report an intersection, but
producing a valid closed loop around internal obstacles while remaining
inside the bed needs a dedicated solution.
- Extrusion paths are checked but not rerouted.
- Spiral Z-hop's circular XY sweep is generated after the primary travel
route has been planned. That sweep is not currently rerouted; the final
G-code checker can report a collision, but does not repair it.
- Orca cannot infer movement hidden inside an opaque firmware macro. A
deterministic macro endpoint should be exposed with explicit `G90`/`G91`
and `G0`/`G1` motion in Orca's custom G-code so the following travel can
be routed from a known position. Movements inside custom G-code are
checked, but only the generated travel after them is rerouted.
- Negative model parts are not applied to the raw object-intersection
mesh, so geometry removed only by a negative part can produce a
conservative false positive.
- Multi-nozzle object validation applies every relevant nozzle's volume
to the complete object rather than only its visibly painted surface.
- Support shared by several instances uses a conservative union of
relevant plate-space exclusions.
- Support avoidance trims or steers generated geometry but does not
perform structural support re-planning. Support above a raised volume
may resume over a void; native tree-support paths not using
TreeSupport3D are not yet volume-aware.
- Raised-only collision volumes are not yet fully represented in
prime/wipe-tower placement validation; the final G-code checker remains
the safety backstop.
- Existing cross-object support-to-support overlap behavior is outside
this PR.
- “No tool selected” carriage-only exclusions are not represented by
Orca's current backend and remain a possible future extension.

## Origin

This work began with the [Muon3D
M1](https://www.youtube.com/watch?v=jBatFQpTM6g), whose notched glass
bed leaves usable print volume above a low obstruction. Upstreaming the
capability lets other printers describe low clips, raised docks,
toolchanger hardware and per-tool clearance limits without requiring a
permanent fork.

Thank you to everyone who tested the implementation, reviewed the
architecture, identified regressions and helped improve the test
coverage—especially the multi-tool and macOS testers. Further
real-hardware feedback remains welcome, but the current implementation
and compatibility behavior are ready to merge.

Harry Loud  
Muon3D
2026-10-22 22:04:40 +08:00
Ian Chua 2410112046 feat: add wildcard permissions for fs 2026-10-22 20:49:57 +08:00
Ian Chua 0ae2b4840b Merge branch 'main' into fix/plugin-network-permissions 2026-10-22 13:55:07 +08:00
Ian Chua 4441bcc065 fix(test): keep embedded Python alive across slic3rutils cases (#16732)
* fix(test): keep embedded Python alive across slic3rutils cases

* fix: clang-tidy
2026-10-22 13:40:14 +08:00
Lam Wei Lun 857896dc6b Make Ctrl+Q quit the application on Linux and Windows
Quit was only bound to Cmd+Q on macOS. Add a Quit entry to the shortcut
registry bound to Ctrl+Q and handle it in the global key handler, so the
shortcut reaches the app regardless of focus. The File menu shows it as
display text. The macOS-only key check is removed; Cmd+Q now goes through
the registry.
2026-10-21 17:52:48 +08:00
Ian Chua 1abb2a0fd9 fix: flatpak audit denial because of config in path (#16685) 2026-10-21 17:48:19 +08:00
Kris AustinandIan Chua 1d977f02fd Fix Moonraker connection threads outliving the printer agent (#16675)
Fix Moonraker connection threads outliving a destroyed printer agent

connect_printer and disconnect_printer detached the in-flight
connection thread, so the agent's destructor could not join it. On
exit, clear_printer_agent_cache disconnects each agent and then
destroys it, and a connection thread whose query succeeded afterwards
used the freed agent.

Each connection thread now joins the one it replaces, so the
destructor's join waits for all of them. The server info and status
queries are cancelled once their connection is superseded, so the wait
is about a second at most. A superseded connection no longer writes its
status into the next connection's cache or reports itself connected.
clear_printer_agent_cache destroys the agents after releasing the
registry lock, since destroying one now waits for its threads.

Co-authored-by: Ian Chua <iancrb00@gmail.com>
2026-10-21 16:06:51 +08:00
Ian Chua 9f030a9559 Merge branch 'main' into fix/plugin-network-permissions 2026-10-21 15:46:07 +08:00
Ian ChuaandSoftFever 37dcc65752 fix: Allow plugins to read the embedded Python stdlib (#16669)
* Stop re-asking for plugin permissions granted in an earlier session

* fix: Allow plugins to read the embedded Python stdlib

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-10-20 21:31:25 +08:00
Ian Chua 4a0d5e5edd Merge branch 'main' into fix/plugin-network-permissions 2026-10-20 18:23:02 +08:00
Ian Chua e7d6cc32a7 fix: deny plugin from modifying plugin sidecar (#16634) 2026-10-20 18:04:42 +08:00
SoftFever 6626377abc Stop re-asking for plugin permissions granted in an earlier session (#16658) 2026-10-20 13:38:44 +08:00
HanifKoh 506dd497db Translate H2C Nozzle Rack Filament IDs at the Printer Boundary (#16612)
The Bambu payload rewrite only matched tray_info_idx, filament_id and filamentId. The H2C nozzle rack puts filament ids in cate (the auto nozzle mapping request) and fila_id (the rack status), so the printer got Orca's OF ids for the filaments and its own ids back for the nozzles in the same request, and the device tab could not name a rack nozzle's filament. Add both keys to one shared list used by the rewrite and its pre-check.
2026-10-19 19:42:05 -05:00
Robert J AudasandRF47 90a5a0b964 Fix JPEG texture imports and filament-matching crash (#16607)
Co-authored-by: RF47 <162915171+RF47@users.noreply.github.com>
2026-10-19 20:30:03 -03:00