Commit Graph

30129 Commits

Author SHA1 Message Date
Ian Chua
bb1e68aa94 Merge branch 'main' into fix/recursive_include 2026-08-19 13:01:02 +08:00
Ian Chua
02f148123d Add clang-cl (LLVM) build support on Windows (#14375)
# Description

This PR enables building OrcaSlicer on Windows with the **clang-cl
(LLVM)**
toolchain and the **Ninja** generator, in addition to the existing MSVC
path.
Clang is already supported on Linux with this codebase, so this extends
that
support to Windows.

The changes fall into three categories. All are either no-ops on the
existing
MSVC/Visual Studio path or Windows/clang-cl-specific, so the standard
build is
not affected.

### 1. C++ conformance fixes
clang-cl is stricter than MSVC and rejects several constructs that
cl.exe
silently accepted. Each of these is non-conforming code that MSVC
tolerated:

* **Explicit template instantiation in `BoundingBox.cpp`** — clang-cl
does not
instantiate `BoundingBoxBase<Point, Points>::construct` through the same
  transitive path MSVC uses; added the explicit instantiation.
* **Eigen cast materialization in `AABBTreeLines.hpp`** — `.cast<T>()`
returns a
lazy `CwiseUnaryOp`, not a concrete `Matrix`; materialized it before
passing to
  `distance_to_squared`, which expects a concrete type.
* **`LabelItemType` underlying type in `PresetComboBoxes.hpp`** — gave
the enum
the same `std::size_t` underlying type as `Marker` to resolve a
narrowing
  conversion in a switch.
* **`T2A_` cast in `BaseException.cpp`** — explicit `static_cast<const
char*>` on
  the ATL conversion helper result.
* **Wide string literals in `GUI_App.cpp`** — used `L""` literals where
  concatenated with a `std::wstring` (`url_prefix`).

### 2. Build system / dependencies
* **Exclude clang-cl from MSVC-only CMake guards** — `if(MSVC)` is true
for
  clang-cl, so blocks applying cl.exe-only flags now exclude Clang.
* **Disable TBB LTCG** — oneTBB enables MSVC IPO/LTCG by default,
emitting
proprietary `/GL` bitcode objects that `lld-link` cannot consume.
Disabling IPO
produces native COFF, linkable by both `link.exe` and `lld-link`. TBB is
threading infrastructure, so the runtime impact of disabling LTCG is
negligible.
* **wxWidgets target path** — clang-cl uses the MSVC frontend variant on
Windows
but reports compiler id `Clang`, so wxWidgets looked under
`clang_x64_lib`
  instead of the `vc_x64_lib` layout the deps are built with.

### 3. Ninja generator support
* **Runtime DLL copy** — the DLL copy step was nested under
`CMAKE_CONFIGURATION_TYPES` (multi-config only), so single-config Ninja
skipped
copying OCCT/GMP/MPFR/WebView2/freetype DLLs next to the executable. Now
runs
  for both generator styles, guarded by `if(WIN32)`.
* **`build_release_vs.bat` Ninja target** — `ALL_BUILD` is a Visual
Studio
  target; Ninja uses `all`. The script failed with
  `ninja: error: unknown target 'ALL_BUILD'` when invoked with `-x`.

## Tests

Built from a clean checkout on Windows with:
* clang-cl 22 (LLVM toolchain bundled with Visual Studio 18)
* Ninja Multi-Config generator
* lld-link as the linker

The full build (deps + slicer) compiles, `OrcaSlicer.dll` links with
`lld-link`,
and `orca-slicer.exe` runs. Verified end-to-end by loading a model,
slicing it,
and generating valid G-code (screenshot below).

The existing MSVC / Visual Studio build path is unaffected — all changes
are
guarded by compiler/generator/platform checks or are conformance fixes
that
compile identically under MSVC.

# Screenshots
<img width="1919" height="1079" alt="image"
src="https://github.com/user-attachments/assets/02082437-db36-4696-a91a-d9acf57d4a52"
/>
2026-08-19 13:00:46 +08:00
Ian Chua
156e096a9b Merge branch 'main' into fix/recursive_include 2026-08-19 03:37:06 +08:00
peachismomo
050ebbb1f4 Merge branch 'main' into fix/clang-cl-windows-support 2026-08-19 03:14:10 +08:00
peachismomo
e840187edc fix: clang-cl arm64 wxWidgets path and plater desctructor before merging main 2026-08-19 03:12:56 +08:00
Ian Bassi
4fd7fdb3fa Move smooth factor wiki link (#15287) 2026-08-18 12:25:59 -03:00
Ian Bassi
322dc9b6a6 Smooth more patterns (#15205) 2026-08-18 12:19:27 -03:00
GlauTech
6a52ea1818 Update OrcaSlicer_tr.po (#15119)
* Update OrcaSlicer_tr.po

* Update OrcaSlicer_tr.po

Fixed inaccurate AI-generated text and updated missing translations.

* REmoive # AI Translated

---------

Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
2026-08-18 10:51:40 -03:00
peachismomo
b6e4f52c05 fix: recursive include between HMS.hpp and GUI_App.hpp 2026-08-18 19:00:53 +08:00
SoftFever
ba22a87a0b Add /bot merge for delegated vendor profile maintainers (#15279)
* Add /bot merge for delegated vendor profile maintainers

Vendor profile PRs no longer need a maintainer with repository write access: an
account listed in the FOLDER_MERGERS variable can squash-merge a PR confined to
the folders it owns by commenting /bot merge on it. Anything reaching outside
that grant, targeting a branch other than main or release/*, or missing a green
Check profiles run is declined with a comment naming the offending files.
Grants live in the merge-delegation environment, so only an admin can change who
may merge, and MERGE_BOT_DRY_RUN stops all merging without a code change.

Check profiles now also runs on release/* pull requests; nothing else changes
for existing contributors.

* Add profile version bump to the code review checklist

Without the bump in resources/profiles/<Vendor>.json, a preset change never
reaches existing installs over the air.
2026-08-18 00:42:03 +08:00
jimmy-brightz
542cd18d19 Fix prime tower rotation angle setting not working (#15227) 2026-08-17 14:34:41 +08:00
SoftFever
57092d5abd Reorder network initialization calls 2026-08-17 13:31:30 +08:00
Robert J Audas
f529692ac0 Fix slowdown for caged external overhangs (#14735)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
2026-08-16 23:40:50 -03:00
Alexandre Folle de Menezes
728cf63c3d Verify and improve AI pt_BR translations (#15261) 2026-08-15 12:54:00 -03:00
Manzari
d5dbd96dd6 Skip filament_colour_type in G-code config block to fix Anycubic Kobra 3 parse crash (#13507)
Co-authored-by: manzari <mail@manzari.dev>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-08-13 21:52:52 -03:00
TheLegendTubaGuy
0225cadff0 Fix PLA/PETG warning wiki link (#15172) 2026-08-13 18:57:08 -03:00
TheLegendTubaGuy
c5aedd1cea Enable Snapmaker U1 bed type selector (#15174) 2026-08-13 18:25:52 -03:00
Robert J Audas
78eef79ffe Fix flushing-volume warning for single-filament plates (#14704)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-08-13 17:50:55 -03:00
Kiss Lorand
56d2c527cb Fix crashes from object-level small perimeter speed overrides (#15232) 2026-08-13 17:28:31 -03:00
Kiss Lorand
fd23b74b99 Fix single-value object overrides on multi-nozzle printers (#15221) 2026-08-13 17:09:10 -03:00
Kiss Lorand
d322b1a156 Fix assembly parts omitted by height range modifiers (#15225) 2026-08-12 15:42:21 -03:00
Kiss Lorand
ee6613a4b8 Fix stale flush matrix after enabling SEMM (#15223) 2026-08-12 15:18:00 -03:00
Ian Chua
e9d421050e refactor: access codes and device tab (#15134) 2026-08-12 18:50:49 +08:00
Terasit Juntarasombut
6dbdb1d07e l10n: Fix contextual and technical translation errors in Thai (th) (#15213)
* l10n: Fix contextual and technical translation errors in Thai (th)

* l10n(th): standardize technical terms and sync localization glossary (#15213)

* l10n(th): remove localization_glossary.tsv from PR (#15213)
2026-08-11 16:56:59 -03:00
Kiss Lorand
117ed0060d Fix Celsius symbol rendering in Preview (#15202) 2026-08-11 16:25:09 -03:00
Ian Bassi
c5d2944ee0 Euskera update (#15215)
Based in https://github.com/OrcaSlicer/OrcaSlicer/pull/14970#issuecomment-5145928650
2026-08-11 09:54:37 -03:00
Anson Liu
b422636740 Move Generic vendor above Bambu vendor in AMS material setting. (#11306)
* Move Generic vendor above Bambu vendor in AMS material setting.

* Remove hardcoded sorted_names. Alphabetically sort Bambu with all vendors

* Fix sorting with case insensitive comparison

* Use arithmetic to get rank distance because priorities are stored in a vector. This lets us remove the <interator> include.
2026-08-11 14:51:25 +08:00
Anson Liu
c806a09c7c Show current filaments at top of AMS filament dropdown (#11293)
* Move currently active filaments added to the Prepare sidebar to the top of the AMS Material Selection combo box.

It is likely the user wants to set the material to the currently active filament.

* Reduce logging verbosity.

* Refactor current active preset filament finding to find nested preset inheritance.

* Initialize pointer to null before usage.

* Remove old commit code

* Remove new line

---------

Co-authored-by: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com>
Co-authored-by: yw4z <ywsyildiz@gmail.com>
2026-08-10 11:04:17 +08:00
yw4z
1a8f39c5f7 Fix emboss gizmo font preview of style not rendering properly (#14612) 2026-08-09 13:24:04 +08:00
TheLegendTubaGuy
9421e7fa9b Fix detached copies of system presets (#15173)
* Fix detached copies of system presets

* Clarify detached preset compatibility

* Show unique preset state in save dialog

* Update SavePresetDialog.cpp

---------

Co-authored-by: yw4z <ywsyildiz@gmail.com>
2026-08-09 02:08:54 +03:00
Mitchell Mashburn
af9fd10d7a re:3D profile updates. (#15169)
* re:3D profile updates.

- Replace vendor-specific "re3D Greengate rPETG" filament with a generic "re3D rPETG" (base + @0.8/@1.75 nozzle variants), matching the naming convention used for rPLA/rPETG elsewhere in the re:3D vendor
  pack.
- Add fdm_filament_pp as a proper filament-type parent and switch re3D rPP to inherit from it instead of overriding filament_type on top of fdm_filament_pet.
- Added filament_type to the specific printer JSON file and removed from the base printer JSON file [fixes Issue#14693]
- Updates to speeds and accelerations for re:3D profiles, moved from common to machine processes [closed: PR#14259]
- Updates to fdm profile filename format so that it lists the filename and extruder number in the sliced .gcode file

* Fix setting IDs

* Add rename from for changed material names.
2026-08-08 01:07:03 +08:00
Kris Austin
74aed7a2bb test: finish the temp-file cleanup (#14976)
Follow-up to #14785. Routes the tests that still hand-rolled temp paths through
the shared helpers and unifies the temp guards.

- Add ScopedTemporaryDir and a shared ScopedTemporaryPath base under it and
  ScopedTemporaryFile.
- Move test_3mf's round-trip .3mf output out of the TEST_DATA_DIR source tree
  (a fixed-name leak) and test_toolordering's fixed-name temp .gcode (a sharding
  collision) onto ScopedTemporaryFile.
- Move test_config, test_slicing_pipeline_bindings, the test_3mf backup dirs, and
  test_preset_bundle_loading onto the guards.
- Make slic3rutils ScopedDataDir compose ScopedTemporaryDir; dedupe
  test_network_versions' fixture and delete test_plugin_lifecycle's duplicate.
2026-08-07 13:33:37 -03:00
Kris Austin
8bff9aaf32 fix(GUI): honor "Ignore" when layer height exceeds the configured maximum (#14369)
* fix(GUI): honor "Ignore" when layer height exceeds the configured maximum

Entering a layer height above the printer's max_layer_height on the Print
Settings tab fired two guards in sequence. Tab::on_value_change prompts
"...Adjust to the set range automatically?" with an Adjust/Ignore choice, and
ConfigManipulation::update_print_fff_config then showed an OK-only "Too large
layer height. Reset to X" dialog whose result was never checked, so it always
reset the value. The second guard overrode the user's "Ignore", resetting the
layer height regardless.

Changes:
- Extract the shared Adjust/Ignore dialog into
  ConfigManipulation::layer_height_out_of_range_dialog, reused by the tab
  (Tab::on_value_change) and the per-object/part settings panels. The dialog now
  names the value it will clamp to and reads correctly for too-low as well as
  too-high.
- The tab/plate path is already covered by Tab::on_value_change, so the
  duplicate reset is dropped from update_print_fff_config.
- The per-object/part panels have no on_value_change hook, so add
  ConfigManipulation::check_object_layer_height and call it from the object
  settings update paths, gated on the edited option (changed_opt_key ==
  "layer_height"). It prompts once per layer-height edit and does not re-prompt
  when unrelated object settings change after the user chose "Ignore".

Fixes #14214

* refactor(GUI): unify the layer-height range check across tab and object panels

Copilot review of #14369 noted that the per-object check only guarded the
max at extruder 0 and skipped the too-low case, diverging from the tab.

Move the whole range check into ConfigManipulation::check_layer_height,
used by both Tab::on_value_change and the per-object/part panels. It takes
the widest [min, max] window across the printer's extruders, offers
Adjust/Ignore in both directions, and resets a near-zero value. The tab's
inline block collapses to one call, dropping the duplicated limit logic.

* fix(GUI): only enforce layer-height limits that are actually set

max_layer_height defaults to 0 (unset), so the unconditional range check
offered to clamp any layer height to 0 on presets that don't define it.
Guard each branch (near-zero, too-high, too-low) so an unset limit disables
that direction; the slice-time nozzle-diameter check still applies.

Also run check_layer_height before update_print_fff_config in the object
panels so a near-zero per-object value prompts the same way the tab does,
with update_print_fff_config's fallback still covering the no-minimum case.
2026-08-07 13:31:04 -03:00
Kris Austin
83723e2a7b fix: Slice all crash on a multi-plate project with an uninitialized toolbar (#15117)
_update_select_plate_toolbar_stats_item(true) runs from
on_action_slice_all before the select-plate toolbar has necessarily been
initialized. m_all_plates_stats_item is only assigned in
_init_select_plate_toolbar, so slicing a multi-plate project shortly
after startup (before the Preview tab has rendered) leaves the pointer
null while show_stats_item is true, and the branch dereferences it,
crashing with SIGSEGV.

Every other dereference of this pointer already null-checks it. Add the
same check here so the all-plates stats item is left unselected until the
toolbar is initialized instead of crashing.

Fixes #15116
2026-08-07 13:28:54 -03:00
Kris Austin
e2fd46f82c fix: default-initialize WallToolPathsParams fields (#15138)
min_length_factor and is_top_or_bottom_layer had no default initializers, and the FillConcentric/FillConcentricInternal callers never set them, so WallToolPaths::removeSmallLines() thresholded on stack garbage. Which short extrusion lines it dropped then depended on memory layout, so concentric solid-infill output was nondeterministic between runs and across machines. Give every member a default, matching the adjacent FillParams. The perimeter path was already fine because it builds the struct via make_paths_params().
2026-08-07 13:22:26 -03:00
TheLegendTubaGuy
b216813bf0 Add the Qidi Plus 5 (#15163)
* Add the Qidi Plus 5

* Remove ignored profiles

Qidi didn't register these, so they are essentially dead weight.

* Set Qidi profile version to 02.04.00.10
2026-08-07 13:07:27 -03:00
Felix14_v2
b3296fa199 Review AI changes in Russian localization (#15092)
* Review AI changes

* Part 2

* Part 3

* Part 4

God bless Ian Alexis

* Part 5

* Final part!

* Catches by Gemma

This 6-minute check probably saved me a week

* Tweak

* Update OrcaSlicer_ru.po
2026-08-07 12:03:53 -03:00
Surfoo
6d9a9eeb04 i18n(fr): improve French localization quality and consistency. (#15106) 2026-08-07 09:31:57 -03:00
Clifford
8e243faa3a Fix Linux unit test failure in the wipe tower temperature trace comparison (#15161)
## Problem

`Toolchange temperature commands are unchanged when the wipe tower wait
is off`
(added in #15144) fails on both Linux runners and passes on Windows and
macOS.
It is the only failing test in the suite, and it has been failing on
main since
that PR merged.

| Job | Result |
| --- | --- |
| Windows x64 / Unit Tests | pass |
| Windows arm64 / Unit Tests | pass |
| macOS arm64 / Unit Tests | pass |
| Linux x86_64 / Unit Tests | **fail** |
| Linux aarch64 / Unit Tests | **fail** |

From the merge commit
([Linux
x86_64](https://github.com/OrcaSlicer/OrcaSlicer/actions/runs/31072382258/job/92531704095),
[Linux
aarch64](https://github.com/OrcaSlicer/OrcaSlicer/actions/runs/31072382258/job/92531704075)),
still reproducing on current main:

```
first difference at trace entry 29
  main:   M104 S240 T0 ; preheat T0 time: 31s	lead 30.9s
  branch: M104 S240 T0 ; preheat T0 time: 30s	lead 30.3s
```

## Cause

Each preheat entry records the same quantity twice: `lead` at one
decimal, and
`time:` inside the command text as that value rounded to a whole second.

`split_lead` already compares `lead` with a 0.5s tolerance and explains
why the
estimate moves. `time:` sits in the exactly-compared command text, so it
never
got that tolerance — and being rounded, it flips on a drift far below
0.5s
(30.4 and 30.6 render as `30s` and `31s`). Entry 29 is the only entry in
the
163-entry golden whose lead rounds up; every other preheat sits at
30.0–30.4 and
rounds down, which is why it is the only one that fails.

The variation is per-toolchain, not run to run. Both Linux arches
produce
exactly `lead 30.3s`; Windows x64/arm64 and macOS arm64 all produce
exactly
`30.9s`. Repeated local runs are byte-identical. macOS arm64 passing
while Linux
aarch64 fails rules out the ISA — it is floating-point accumulation over
a few
thousand move durations under GCC vs Clang vs MSVC.

The mechanism makes it discrete rather than gradual: the backtrace parks
the
preheat at the first exported line at least `preheat_time` before the
tool
change, so `lead` is `preheat_time` plus the leftover of whichever move
that
landed on. A sub-tenth difference selects the neighbouring move and
`lead` steps
by that move's whole duration.

Entries 1–28 match exactly, including five earlier preheats whose leads
fall
inside the existing tolerance, so the toolpaths themselves are
identical. I also
reverted the two prime-tower commits that landed between the golden's
capture
point and now, rebuilt, and got a byte-identical trace — this is not
behavioural
drift.

That also rules out regenerating the golden: no single capture satisfies
all
three toolchains, and recapturing on Linux would turn the three
currently-green
runners red.

## Fix

Test-only.

- `lead` keeps a tolerance, widened to 1.5s (measured drift 0.6s; a
preheat
actually leaving its backtrace position would move by tens of seconds).
- `time:` is **not** compared across runs at all. Being a rounding of
`lead`, it
carries nothing the tolerance does not already cover, and comparing it
across
runs can only reproduce the flake. It is instead checked against its own
  entry's `lead` — a correct rounding keeps `|time - lead| <= 0.5`.

That second point matters: simply tolerating `time:` numerically would
have made
the test blind to a real change, because drift and a wrong rounding both
move it
by 1. The self-consistency check keeps that coverage. I verified it by
changing
`(int) std::round(time_diffs[0])` to `(int) time_diffs[0]` in
`GCodeProcessor::export_lines` — the test fails with
`"time:" is not its entry's "lead" rounded to a whole second`, where a
plain
tolerance would have passed silently.

Everything else is still compared exactly: all M104/M109 values, tool
ids,
block markers, ordering, entry count, and the annotation text including
its
trailing `s`. The other 138 entries remain byte-exact.

No production code, no golden regeneration. The golden file and these
helpers
are used by this one test and nothing else, and the tolerance only
widens, so
Windows and macOS keep passing unchanged. A note is added to the
golden's header
so the next mismatch in those fields is not "fixed" by recapturing.

## How to verify

Before, on Linux:

```bash
git checkout main && ./build_linux.sh -t
ctest --test-dir build/tests -R "Toolchange temperature commands are unchanged" --output-on-failure
# fails at trace entry 29
```

After:

```bash
cmake --build build --config Release --target fff_print_tests
ctest --test-dir build/tests --output-on-failure     # 463/463
```
2026-08-07 20:26:18 +08:00
Alexandre Folle de Menezes
b5412221b6 Verify and improve AI pt_BR translations (#15080) 2026-08-07 09:22:42 -03:00
Kiss Lorand
f444176df8 Fix Windows crash after using "Replace all with 3D files" (#15102)
Fix Windows crash in Replace all with 3D file

Keep the replacement result message as wxString and substitute the volume
name directly.

On Windows, wxString::ToStdString() cannot encode the Unicode status icon
through the active ANSI code page and returns an empty string. Passing that
empty string to boost::format with a volume-name argument throws
boost::too_many_args and exits OrcaSlicer.
2026-08-07 17:13:25 +08:00
Ian Bassi
a684c6daf6 Bump Creality (#15157)
To apply https://github.com/OrcaSlicer/OrcaSlicer/pull/14654
2026-08-06 18:44:40 -03:00
TheLegendTubaGuy
7f10c73dce Fix redundant QIDI startup tool changes (#15096)
* Fix redundant QIDI startup tool changes

Guard Q2, X-Max 4, and X-Plus 4 filament-change G-code so same-tool startup selections do not run the full cut, unload, and purge sequence.

* Guard Q2C against redundant startup tool changes

Skip the complete filament-change sequence when the requested tool is already selected during startup.

* Bump Qidi profile version
2026-08-06 18:26:42 -03:00
yw4z
945520b827 QOL Add parent preset information next to detach preset checkbox and match checkbox style on Save Preset dialog (#15076)
init
2026-08-06 22:58:39 +08:00
Kiss Lorand
b281c91b99 Fix ignored filament-specific ironing speed override (#15082)
Fix overridden ironing speed

Use filament_ironing_speed for the active filament when configured, falling back to the process setting when unset.
2026-08-06 22:54:11 +08:00
Ian Bassi
b57d7a67e2 Regression version for Bug report (#15139) 2026-08-06 22:43:37 +08:00
SoftFever
18ca06ec6b Size the prime tower from the actual flush volumes (#15149)
# Description

<!--
> Please provide a summary of the changes made in this PR. Include
details such as:
  > * What issue does this PR address or fix?
  > * What new features or enhancements does this PR introduce?
> * Are there any breaking changes or dependencies that need to be
considered?
-->

The prime tower reserved its footprint from the prime volume alone,
ignoring the flush volumes it actually has to hold, so on a multi-colour
print the tower shown in Prepare and the space kept clear for it during
arrange could be far smaller than the tower that gets sliced — leaving
it overlapping objects or running off the plate. This sizes the estimate
from the configured flush volumes instead, for rib walls as well as
rectangle and cone, applies the same height-based minimum depth the
prime-volume estimate already used, and reads the flush matrix correctly
on multi-nozzle printers, where it holds one block per nozzle.

Only the pre-slice estimate changes: the generated tower is untouched,
and prints that do not purge into the prime tower keep their existing
size.

# Screenshots/Recordings/Graphs

<!--
> Please attach relevant screenshots to showcase the UI changes.
> Please attach images that can help explain the changes.
-->

## Tests

<!--
> Please describe the tests that you have conducted to verify the
changes made in this PR.
-->

<!--
> A guide for users on how to download the artifacts from this PR.
-->

[How to Download Pull Requests Artifacts for
Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts)
2026-08-06 18:17:05 +08:00
SoftFever
32a4e0fb37 Size the prime tower from the actual flush volumes
Prime towers reserved depth from the prime volume alone, ignoring the flush
matrix: rib-wall towers in both the engine and the preview, and rectangle and
cone towers in the preview, which never carried the flush-aware estimate the
engine already used. The preview also read the print preset, which does not
carry the printer- and filament-scope keys the estimate needs and so silently
fell back to defaults. On multi-nozzle printers the flush matrix, which holds
one block per nozzle, was additionally read as a single block. The tower could
come out too small for the purge it has to hold.

The flush-based estimate also skipped the height-based minimum depth that the
prime-volume one applies, so low-flush prints could estimate a tower shallower
than the one that actually gets built.
2026-08-06 17:58:41 +08:00
SoftFever
f9ed5843c0 Keep the prime tower and its approach travel on non-rectangular beds (#15146)
# Description

<!--
> Please provide a summary of the changes made in this PR. Include
details such as:
  > * What issue does this PR address or fix?
  > * What new features or enhancements does this PR introduce?
> * Are there any breaking changes or dependencies that need to be
considered?
-->

On delta, circular and custom bed shapes — and on multi-nozzle printers
where each carriage only reaches part of the plate — the prime tower was
positioned and clamped against the bed's bounding box, so it could be
parked in a corner the bed does not actually have. Neither the default
placement nor dragging the tower would pull it back onto the bed, and
slicing went ahead without complaint. The tower's default position, its
drag clamp and the slice-time validation now all follow the real
printable outline, and a tower that genuinely does not fit is reported
as "Prime Tower is partially outside the printable area" instead of
being sliced into a print that cannot be produced.

The travel that approaches the tower is planned against that same
outline. Previously the router gave up whenever its clearance box fell
outside the bed and drove the nozzle straight across the tower; a tower
parked near the bed edge now keeps its detour and enters through the
wall opening as intended.

This also corrects the footprint the prime tower validation uses for a
rotated tower, which was being rotated by the wrong amount and about the
wrong point, so proximity warnings and exclusion-area errors for rotated
towers were being computed against the wrong shape.

Prime tower placement on rectangular beds is unchanged. The new
printable-area validation and the tower-approach routing fix apply to
every bed shape.

# Screenshots/Recordings/Graphs

<!--
> Please attach relevant screenshots to showcase the UI changes.
> Please attach images that can help explain the changes.
-->

## Tests

<!--
> Please describe the tests that you have conducted to verify the
changes made in this PR.
-->

Added unit coverage for the placement clamp against a non-rectangular
outline (a regular hexagon standing in for the shipped delta beds),
covering the rectangular-bed path, single-axis clamping while dragging,
a footprint already inside the outline, one sitting in the bounding-box
corner but off the bed, an unresolved auto brim width arriving as a
negative margin, and a footprint too large for the bed. The `fff_print`
suite passes.

<!--
> A guide for users on how to download the artifacts from this PR.
-->

[How to Download Pull Requests Artifacts for
Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts)
2026-08-06 16:09:56 +08:00
SoftFever
7c73739e1a Keep the prime tower and its approach travel on non-rectangular beds
The placement clamps and the tower-approach router both stood in the bed's
bounding box for the bed itself, so on a delta or hexagonal bed the prime tower
could be parked in a corner that does not exist and the nozzle could be routed
across it. Both now test the real printable outline, slicing reports a tower
that does not fit instead of printing it off the bed, and a tower parked near an
edge is routed along the clamped side rather than falling back to a straight
line across the tower.

Also fixes the placement validation rotating the tower hull by degrees read as
radians about the plate origin, and never rotating the generated tower footprint
at all.
2026-08-06 15:48:40 +08:00