Commit Graph

30215 Commits

Author SHA1 Message Date
SoftFever
38d51783ae Refresh the mixed filament list when a component preset changes 2026-08-23 22:11:49 +08:00
SoftFever
af5397d678 Close the single-extruder mixed filament warning by type 2026-08-23 22:11:49 +08:00
SoftFever
9985688b5b Blend mixed slots in the machine-send and AMS-sync thumbnails 2026-08-23 22:11:49 +08:00
SoftFever
d27766aff0 Reject a mixed filament as the wipe tower filament 2026-08-23 22:11:49 +08:00
SoftFever
cfeca9b9ff Hide mixed slots from the support and wipe tower filament dropdowns 2026-08-23 22:11:49 +08:00
SoftFever
716bba53df Refuse to slice a broken mixed filament 2026-08-23 22:11:49 +08:00
SoftFever
8965b0be21 Skip mixed slots in flush volume auto-calculation
Mixed-colour slots are virtual and never flushed. Guard auto_calc_flushing_volumes_internal against them as BambuStudio does, and make the flushing dialog's default matrix and the sidebar 'modified' comparison physical-only so the untouched mixed rows no longer count as a user edit and the Re-calculate result matches the physical-only table.
2026-08-23 22:11:49 +08:00
SoftFever
0c3d7c6ed1 Expand mixed slots in by-object filament bookkeeping 2026-08-23 22:11:49 +08:00
SoftFever
2131ef0560 Keep mixed filaments across app restarts 2026-08-23 22:11:49 +08:00
SoftFever
6745a33d53 Fix deleting mixed filaments from the sidebar 2026-08-23 22:11:49 +08:00
SoftFever
b2e1870a14 Restore sublayer prompt when enabling gradient mixing 2026-08-23 22:11:49 +08:00
SoftFever
6e52c091f3 Initialize parse output in string_to_double_decimal_point 2026-08-23 22:11:49 +08:00
SoftFever
1b5b8fce54 Port mixed filament dialog fixes from BambuStudio 2026-08-23 22:11:49 +08:00
SoftFever
b1e3cdc666 Port colored OBJ import pipeline from BambuStudio 2026-08-23 22:11:49 +08:00
SoftFever
94a1cd6c93 Port color decompose recipe data and interpolation from BambuStudio 2026-08-23 22:11:49 +08:00
SoftFever
fcdfcae427 Port mixed filament engine fixes from BambuStudio 2026-08-23 22:11:49 +08:00
SoftFever
9d733e50f9 Fix prime tower and by-object brim with mixed filaments 2026-08-23 22:11:48 +08:00
Ian Bassi
3c37bf9ca4 Import project 2026-08-23 22:11:48 +08:00
Ian Bassi
42f708bbb6 Fixes from Full spectrum port
https://github.com/OrcaSlicer/OrcaSlicer/pull/14383
2026-08-23 22:11:48 +08:00
Ian Bassi
86a7e93a48 Layer subdivision fix 2026-08-23 22:11:48 +08:00
Ian Bassi
72a68e9a0f assimp 2026-08-23 22:11:48 +08:00
Ian Bassi
ccd34ab03a sublayers and more 2026-08-23 22:11:48 +08:00
Ian Bassi
76f23396ea Use expand_mixed_slots_in_unprintables 2026-08-23 22:11:48 +08:00
Ian Bassi
51bc06a68a USe is_mixed_slot 2026-08-23 22:11:48 +08:00
Ian Bassi
8b20a4b066 Using resolve mixed 2026-08-23 22:11:48 +08:00
Ian Bassi
8fea099d99 BBL Port Color Mix Base 2026-08-23 22:11:48 +08:00
Anthony Cox
550e234a37 Newer GCCs are bitching about in-class initialisation. Lets fix that! (#15292) 2026-08-22 19:23:59 -03:00
Noisyfox
3b4e65d8a9 Fix thin wall fuzzy (#14309)
Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-08-22 18:46:01 -03:00
Kris Austin
4b397fc2cc fix: slice the same model to the same lightning infill every time (#15311) 2026-08-21 22:24:39 -03:00
Kris Austin
90f76fa28c fix: restore compile parallelism for clang-cl builds with the Visual Studio generator (#15324) 2026-08-21 15:59:16 -03:00
Valerii Bokhan
f05444dc94 Fix unstable contours from triangulated planar faces (redone) (#15316) 2026-08-21 10:50:58 -03:00
ExPikaPaka
5ed56eb876 Cache system presets to eliminate startup and wizard load times (#14217)
* Add caching system for presets

* Removing user\bundle serialization and keeping it only for system presets

* Integrate caching into WebGuideDialog which speeds up time of SetupWizzard and PrinterSelection dialog

* Add CI\CD step to prepare cache file in ahead of time so user does not need to wait

* Add partial cache generation when only one of the vendros is changed to speed up recalculation time

* Handle corrupted files

* Add cache to GuideDialog as previos version didn't work as expected

* Add inspecting tool and fix CI cache generation

* Generate cache per vendor

* Simplify code by mergin it in PresetBundle

* Simplify code a bit more

* Add cereal serialize() to VendorProfile, PrinterModel, Preset, and Semver

* Remove CachedPrinterModel/VendorProfile/Preset mirror structs from VendorCache

* Fix use-after-free in CallAfter lambda; replace raw thread pointer with unique_ptr

* Use get_vendor_cache_key() to match cache keys written by the app

* Remove BOM added by VSC

* Skip invalid vendors

* Remove leftover cache file

* Fix build for windows arm64

* Revert json cache back

* Update check for stale cache

* Serealize all value fields for Preset class to minimize regression later

* Minimize field duplication by moving Cache thing into PresetBundle

* Add tests for Cache system

* Add a bit more tests

* Merge branch 'main' into feature/cache_profiles_and_optimize_loading_speed

* Rvert from per-verndor to single cache file

Replace N per-vendor .cache files with a single system_presets.cache
that holds all vendors and presets in one serialized blob.

Cache load is now all-or-nothing: on hit all vendors are applied from
the bundle (sub-second); on miss all vendors are parsed from JSON and
a fresh bundle is written to the user cache dir.

Invalidation is driven by bundle_key - a sorted concatenation of all
vendor JSON version strings. Any vendor update invalidates the whole
cache and triggers re-parse on next launch.

Guide wizard (WebGuideDialog) loads the bundled cache into a plain
PresetBundle instead of a separate VendorGuideData struct, removing
the duplicate data model.

generate_system_cache simplified from a per-vendor loop to a single
save_system_presets_cache() call producing one output file.

* Transfer all Preset fields from cache via move assignmet

apply_vendor_preset_group was copying fields manually and missed
bundle_id, user_id, base_id, sync_info, updated_time, key_values,
ini_str. Replace field-by-field copy with move assignment of the
fully-deserialized Preset, then restore the vendor pointer which
is excluded from serialization.

* Ignore cache for future

* Remove not used files

* Ship one preset cache per vendor in place of the profile JSONs

Each vendor's system presets serialize into a single <vendor>.opc built at
package time, and a shipped build carries that file alone — the profile JSON
and its sub-file tree are pruned. The vendor loader, the setup wizard's profile
list and the resource installer all read a vendor through its cache, falling
back to parsing whenever one is absent, stale or unreadable, so the cache stays
an optimization and never a source of truth. Caches hold presets in source form
and resolve inheritance at load, through the same code the JSON path uses.

* Make the preset cache self-describing and load each vendor from the system folder alone

The cached DynamicPrintConfig is keyed by name, through a per-file dictionary of the
distinct opt_keys, the type each was written as, and the distinct enum value names,
instead of by serialization_key_ordinal — a position assigned by declaration order at
static init, where inserting one option shifts every later ordinal and the lookup then
succeeds on the wrong option. Because a name-keyed payload drops the options this build
cannot place rather than being rejected wholesale, the schema fingerprint goes, and with
it the two fallbacks that existed only because an installed cache died on every app
upgrade: the second lookup tier into resources/profiles and the parse fallback to the
same place. A vendor is loaded from <data_dir>/system/ and nowhere else, as on main —
which is what makes the app write its .opc files there again.

* Simplify the preset cache internals after review

* Use the shared temp-dir helper in the preset bundle loading test

* Bound stamp string reads in the preset cache

* Speed up the setup wizard with a profile-data cache

The wizard's per-vendor fast path threw on vendors present only in
resources, falling back to a ~29 s raw JSON scan on every open. Each
vendor now loads from the directory it was found in, and the derived
model/machine/filament/process catalog is cached whole in
<data_dir>/cache/wizard_profile_data.json, stamped by each vendor's
name and version - a fresh cache makes an open one file read, with no
bundle built and no presets installed (~0.2 s vs ~2 s).

* Remove debug SVG dump from a geometry test

* Move the per-vendor cache file format into PresetCacheFormat

* Move the vendor install helpers from PresetBundle into Utils

* rename

* fix flatpak

* change cache version to 1

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-08-21 16:56:52 +08:00
Rodrigo Faselli
6ef02a67db Revert "Fix unstable contours from triangulated planar faces" (#15315) 2026-08-20 22:35:28 -03:00
Ian Bassi
ca65f0fd8e Normalize the junction direction vector over XYZE (#15308)
* Normalize the junction direction vector over XYZE

calc_vmax_junction_deviation() treats the dot product of two jd_unit_vec as a
cosine, but the vectors were scaled by 1 / block.distance, which is the XYZ
length. On an extruding move the E component then pushes the 4D norm above 1 and
the dot product below -1, so the corner reads as straighter than it is and is
planned too fast -- the more so the higher the flow. Measured on a 6 degree
corner at scv 5: 86.9mm/s with no extrusion, 94.4mm/s at 0.029mm/mm, 150.0mm/s
at 0.1mm/mm.

Neither firmware does that. Marlin normalizes over XYZE for any extruding move
(planner.cpp: `if (... || esteps > 0) normalize_junction_vector(unit_vec)`) and
Klipper leaves E out of the cosine entirely, dotting only axes_r[0..2]
(toolhead.py::Move.calc_junction). Normalizing satisfies both: with E normalized
in, the cosine differs from the XYZ-only one by ~1e-5 at printing flow rates.

This is a deliberate divergence from PrusaSlicer, which still scales by
1 / distance -- it carries an older Marlin's behaviour.

Travel moves are unaffected, their vector was already unit length.

Reported by Copilot in review of #15304.

* Test that extrusion rate does not change corner planning

The junction deviation tests were all travel-only, which is exactly why the E
component of the junction vector went unchecked. Cover it: the same corner has
to be planned the same whether nothing, an ordinary 0.42 x 0.2 line, or a fat
large-nozzle line is extruded through it, on both Klipper and Marlin 2.

Reported by Copilot in review of #15304.
2026-08-20 18:50:23 -03:00
Valerii Bokhan
87ca2bc42e Fix unstable contours from triangulated planar faces (#15313) 2026-08-20 18:03:38 -03:00
pbannykh
aa233a82a5 fix: pass douglas_peucker tolerance in scaled units so the cancel-object outline is actually simplified (#15291)
Co-authored-by: bannykh <baza182@proton.me>
2026-08-20 17:47:38 -03:00
Ian Bassi
aaa8e98bb0 Time estimator fixes (#15304)
* Plan corners with junction deviation where the firmware uses it

The time estimator only ever had the classic per-axis jerk model, which limits a
corner by the largest single-axis component of the velocity change. That is
anisotropic: the same corner is allowed sqrt(2) more speed on a diagonal than on
an axis, which paints a four-lobed ripple around every circular wall in the
actual speed and actual flow views, worst on small parts whose walls are made of
short segments.

Klipper has no classic jerk at all and Marlin 2 has none while M205 J is in use;
both plan corners with junction deviation, which sees only the corner angle. Add
that model and use it for those machines:

  - Klipper: derived from the square corner velocity, as the firmware does
    (jd = scv^2 * (sqrt(2) - 1) / max_accel), reading the scv from
    machine_max_jerk_x, where process_SET_VELOCITY_LIMIT() already stores
    SQUARE_CORNER_VELOCITY.
  - Marlin 2: machine_max_junction_deviation, which was already loaded into the
    machine limits but never reached the planner.
  - Every other flavor keeps the classic jerk path unchanged.

The model has no per-axis jerk floor, so this also drops the hard slow spot the
estimator drew at the start of every loop from machine_max_jerk_e.

Toolpaths are unaffected: on a full export the only lines that change are M73.

The junction deviation maths, including Marlin's JD_HANDLE_SMALL_SEGMENTS arc
approximation, is ported from PrusaSlicer's src/libslic3r/GCode/GCodeProcessor.cpp.
The Klipper mapping is not in PrusaSlicer, which ignores SET_VELOCITY_LIMIT.

* Add tests for junction deviation corner planning

Cover the three properties the change rests on:

  - a right angle on Klipper is planned at exactly the square corner velocity,
    the identity that makes the scv to junction deviation mapping correct, and a
    shallow corner is planned far faster than per-axis jerk allows;
  - junction deviation gives the same speed whatever the corner's orientation,
    while classic jerk keeps its sqrt(2) spread, which is the four-lobed ripple;
  - machines that do not plan with junction deviation are provably untouched,
    including a Marlin 2 printer that has it disabled.
2026-08-20 09:16:02 -03:00
Ian Chua
dc75ce6811 feat: printer agent isolation across devices (#15147)
# Description

Printers discovered/bound under one printer agent (e.g. built-in BBL)
were leaking into another, independent agent's "My Device"/"Other
Device" lists and inheriting its saved access code, since neither the
device list nor bind state was ever scoped by which agent found them.

- Add printer_agent_id to MachineObject/BBLocalMachine, stamped at
  discovery/bind time; filter get_my_machine_list(),
  get_my_cloud_machine_list(), and update_other_devices() by it.
- clear_other_devices() now drops entries stamped by the outgoing
  agent on swap, so the incoming agent's own discovery re-inserts and
  re-stamps them fresh instead of leaving them stale-tagged forever.
- Scope access_code by (dev_id, printer_agent_id) on BBLocalMachine
  (LAN only since cloud's userMachineList is always refreshed live from
  the account API, so it isn't at risk the same way), with a
  BBL-only legacy fallback to the old flat access_code/user_access_code
  keys so existing bindings keep working.

# 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-20 16:08:17 +08:00
Rodrigo Faselli
ba22973919 Revert "Fix assembly parts omitted by height range modifiers" (#15301) 2026-08-19 16:34:12 -03:00
Ian Bassi
f5f3d2221d AI Translation update (#15300) 2026-08-19 14:47:34 -03:00
Kris Austin
8047141981 test: fix the flaky multiline lightning smoothing assertion (#15294) 2026-08-19 11:28:58 -03:00
SoftFever
872c660cb3 feat: Plugin pages (#14992)
# Description

This PR introduces native tabs as plugins.

The pages are webViews, and function similar to the existing plugin html
dialogs.
One per-requesite of this is to refactor the existing tab/notebook
architecture to be string based rather than index based.
The current implementation is still in early development stages and are
more meant for showcasing the vision rather than a final product.

The plugins used in the screenshots below:

[orca_pages_showcase_plugin_any.py](https://github.com/user-attachments/files/30459615/orca_pages_showcase_plugin_any.py)

[orca_pages_plugin_example_any.py](https://github.com/user-attachments/files/30459616/orca_pages_plugin_example_any.py)


# Screenshots/Recordings/Graphs

<!--
> Please attach relevant screenshots to showcase the UI changes.
> Please attach images that can help explain the changes.
-->
<img width="3384" height="1431" alt="image"
src="https://github.com/user-attachments/assets/68cd7a00-25fc-4e0e-91d7-c9b287f32b81"
/>
<img width="3384" height="1431" alt="image"
src="https://github.com/user-attachments/assets/81474441-e00a-4dea-b961-89dcdc462d55"
/>
<img width="3384" height="1431" alt="image"
src="https://github.com/user-attachments/assets/9504c5d7-25f7-47ed-9c77-b2cdc5507a87"
/>

## 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-19 14:31:57 +08:00
SoftFever
35db2cd89b Merge branch 'main' into feat/plugin-pages 2026-08-19 14:08:59 +08:00
SoftFever
1e87d56482 Micro-refactor 2026-08-19 14:08:19 +08:00
Ian Chua
1c90ba78a5 fix: recursive include between HMS.hpp and GUI_App.hpp (#15285)
# Description

Break the recursive include dependency by moving GUI_App.hpp from
HMS.hpp into HMS.cpp. Add the required standard headers and use explicit
std/nlohmann types to remove reliance on transitive includes.

This prevents recursive header inclusion while preserving HMS
functionality.

# 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-19 13:01:19 +08:00
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
SoftFever
7c55b07736 Merge branch 'main' into feat/plugin-pages 2026-08-19 11:15:20 +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