Commit Graph
31888 Commits
Author SHA1 Message Date
harrierpigeonandClaude Fable 5.1 798ca8272e Printer settings: build plate tilt is read-only on a belt printer
update_fff() derives build_plate_tilt_x/y from the belt tilt on a belt
printer, so a value typed into those fields was silently overwritten.
Disable the two fields while belt_printer is on.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 19:08:58 -05:00
harrierpigeonandClaude Fable 5.1 d5cfaae5dd Belt brim: adding or removing an object rebuilds the other objects' brims
A belt brim is clipped against the other objects on the plate and is
built with its object's support step.  When an object was added or
deleted only the print-level skirt/brim and export steps were
invalidated, so the remaining objects kept brims clipped against objects
that were no longer there, or overlapping ones that had arrived.
Invalidate posSupportMaterial on every object in that case on a belt
printer.  Also reword the comments that still described the global Z
offset as a minimum across all objects.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 19:08:58 -05:00
harrierpigeonandClaude Fable 5.1 9289fc4dd3 Leading-edge brim takes part in the outer-wall-first rule
The first-layer rule that prints the outer wall first when a brim is
attached to it, and the brim_type change rule that regenerates the
perimeters for it, only knew btOuterOnly.  btLeadingEdgeOnly, the belt
brim at the part's first contact, is an outer brim too.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 19:08:58 -05:00
harrierpigeonandClaude Fable 5.1 b2fb552e32 PrintObject: a re-slice invalidates posDetectOverhangsForLift
posSlice's invalidation list did not include posDetectOverhangsForLift.
A re-slice starts the layers over with empty overhang regions while the
step stayed done, so GCode::needs_retraction() had no overhangs to test
against until something else invalidated it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 19:08:58 -05:00
harrierpigeonandClaude Fable 5.1 febd82f6df Belt G-code: count only the layers that are written
collect_layers_to_print() drops the belt layers that print nothing (an
object's empty lead-in), but m_layer_count still counted every object
and support layer, so "total layers count", the total_layer_count
placeholder and the M73 progress disagreed with the layer changes in the
file.  Count with the same predicate, shared through
belt_object_layer_prints_something().  The by-object overload of
collect_layers_to_print() now drops those layers as well, so both print
sequences write the same layer changes.

Dropping the empty entries per object has one more effect on multi-
filament belt prints: a layer no longer selects a filament that it then
prints nothing with.  On belt_project.3mf (two filaments, belt purge
tower) the T commands go from 472 to 106 while the extruded length per
filament is unchanged; each of the removed tool changes was followed by
no extrusion.

The empty-layers test now runs for both print sequences and also checks
"total layers count" against the layer changes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 19:08:58 -05:00
harrierpigeonandClaude Fable 5.1 fba8b8b029 Belt G-code: reset the first-layer band state per object
In by-object printing the cooling buffer is reset for every object, but
m_belt_in_band, which tracks whether the extrusion is inside the band
along the belt where the part fan stays off, kept the previous object's
value.  If the previous object ended inside the band the next one never
emitted its band start marker.  Reset it with the cooling buffer.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 18:24:27 -05:00
harrierpigeonandClaude Fable 5.1 05e37d838c Belt G-code: the mixed-filament sub-layer pass rotates its origin too
process_layer()'s sub-layer pass (several filaments in one layer without
a purge tower) calls set_origin() per instance like the main instance
loop, but not on_set_origin(), which on a belt printer runs the origin
through the belt transform.  Add the call so both passes place the
instance the same way.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 18:24:27 -05:00
harrierpigeonandClaude Fable 5.1 4eaaf9a992 Belt G-code: first-layer speed test subtracts the instance offset only
The writer hands set_first_layer_point_test() a point with the plate
origin (its own XY offset) already removed, but the test subtracted the
whole of m_origin, which carries the plate origin as well as the
instance shift.  On a plate other than the first the point was moved by
the plate origin a second time and the band test looked at the wrong
spot.  Subtract only the part of m_origin that is not the writer's
offset.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 18:24:27 -05:00
harrierpigeonandClaude Fable 5.1 54e079ae25 Organic supports: restore the per-slice collision, bed and belt trim
dda58b07cd stripped debug instrumentation from TreeSupport3D.cpp with a
script, and that script also deleted the loop in organic_draw_branches()
that trims every branch slice against the collision volume, the bed and,
on a belt, the belt plane.  This is the generator every printer uses, not
a belt code path, and it is the one place where raistlin7447's export
fixtures differed from main with belt printing off.  Restore the loop as
it was on main, with the belt-floor clip.

The new test prints a cube carrying a 60 mm plate with organic supports
on a flat-bed printer and checks on every support layer that no support
extrusion comes within 0.2 mm of the part's slice.  It guards that
invariant; on this fixture the loop's own effect is a sub-millimetre
reshaping of one branch (verified by slicing the fixture with and
without the loop), below the asserted gap, so the test does not by
itself fail without the loop.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 18:24:27 -05:00
Joseph Robertson d0c2ada32a Belt printer: classic tree branches land on the belt instead of sliding down it (#16263)
Classic tree supports (tree hybrid / slim / strong) on a belt slid down
the belt plane ahead of the part instead of landing on it.
`TreeSupportData` added the belt surface to every layer's outlines, so
the belt fed the collision and avoidance maps, and a node that descends
onto an obstacle is pushed out of it; on a tilted surface that walks the
branch down the belt. This takes the belt out of the outlines. The belt
is where a branch ends, and that is already handled: `drop_nodes()`
stops a node once its whole circle is in the belt
(`belt_node_landed()`), and `draw_circles()` clips every layer's circles
to the belt plane, so the branch tapers to a tip on it. Organic got the
same treatment in #16236 (the belt is no longer a support blocker
there).

One file, +7/−12. Non-belt printers are untouched: the removed block
only ran when the belt floor context was active.

## Before / after

Cube with a fin whose underside is parallel to the layers, 20 mm ahead
of the cube, tree hybrid, Left view:

| | support footprint along the belt | filament for support |
|---|---|---|
| before | belt Z 43–139 (sweeps 72 mm ahead of the part) | 2403 mm |
| after | belt Z 60–139, columns parallel to the up direction | 1606 mm
|

Organic on the same model: belt Z 74–139 (unchanged). Before/after
screenshots follow in a comment.

## Tests

- *Belt supports reach the belt under a leading overhang* passes for
normal, organic and tree_hybrid; all `[belt]` tests pass;
`fff_print_tests` 355 and `libslic3r_tests` 1116 pass on the branch.
- `scripts/clang_tidy_diff.py --base upstream/belt-printer`: no
findings.
- Fork CI (Build all) on this change: unit tests green on Linux x86_64,
Linux aarch64 and macOS arm64
(https://github.com/HarrierPigeon/OrcaSlicer/actions/runs/37601644023;
its Windows and slice-check failures are the ones #16262 fixes).
- Scripted GUI pass on belt-printer + this change: tree hybrid, organic
and normal supports at Y≈120 all reach the belt (lowest 0.17–0.19 mm);
with the part within its height of Y = 0 all three generators now behave
the same (support before the belt start, plate-boundary error shown),
where tree hybrid used to be the odd one out (clipped, hanging 9.5 mm
above the belt).
- Written with Claude Code; reviewed and run by me.
2026-10-07 14:21:34 -05:00
harrierpigeonandClaude Fable 5.1 d527db6bdf Belt printer: classic tree branches land on the belt instead of sliding down it
TreeSupportData added the belt surface to every layer's outlines, so the
belt fed the classic tree's collision and avoidance maps.  A node that
descends onto an obstacle is pushed out of it, and on a belt that walked
the branch down the tilted surface, ahead of the part, before it could
end: tree hybrid/slim/strong supports swept far along the belt where
organic supports dropped straight down.  Take the belt out of the
outlines.  The belt is where a branch ends, and that is already handled:
drop_nodes() stops a node once its whole circle is in the belt
(belt_node_landed()) and draw_circles() clips every layer's circles to
the belt plane, so the branch tapers to a tip on it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 14:15:14 -05:00
Joseph Robertson e39d6cc089 Merge branch 'main' into belt-printer 2026-10-07 14:14:20 -05:00
Joseph Robertson 827efc3bc2 Belt printer: get the branch CI green (Windows Polyline clash, validator belt slice) (#16262)
Two one-file fixes that get `belt-printer`'s CI green again after
#16236; both failures are mine.

## Changes

1. **Tests: qualify `Polyline` in the belt overhang test for Windows.**
Both Windows builds fail at `tests/fff_print/test_print.cpp:1398`
("reference to 'Polyline' is ambiguous"): the GDI function of the same
name, like the `Polygon` fix in #16196. `Slic3r::Polyline`.
2. **Profile validator: slice belt printers with two cubes along the
belt.** The slice check (`-s`) prints one cube per printer with a height
range 4–10 on filament 2 and, on belt printers, expects a plain `T1`.
Since #16236 a belt object's slicing Z starts at the belt below its
leading end, well below the part's first printed layer, so that range
falls into the empty lead-in and filament 2 is never used; all six belt
printers reported "the filament change never fired". Belt printers are
now sliced with two cubes one behind the other along the belt, the
second on filament 2. Other printers are unchanged.

## Tests

- Root cause for both confirmed in the upstream logs (run 37583336264
and the push run on 0b11311d40) and reproduced locally with the rebuilt
validator.
- `OrcaSlicer_profile_validator -s -l 2`: Printcepts 8/8, IdeaFormer
8/8, Custom 20/20 (the four MyBeltPrinter nozzles included), Prusa 95/95
as a non-belt control.
- `fff_print_tests` and `libslic3r_tests` pass;
`scripts/clang_tidy_diff.py --base upstream/belt-printer`: no findings.
- A fork run of Build all with these two commits on top of belt-printer
(plus a pending belt change) was green on every job: Windows x64 and
arm64 builds, Slice check, unit tests on Linux x86_64, Linux aarch64,
macOS arm64, Windows x64, Windows arm64 and both Flatpaks:
https://github.com/HarrierPigeon/OrcaSlicer/actions/runs/37607869527
- Written with Claude Code; reviewed and run by me.
2026-10-07 14:14:06 -05:00
harrierpigeonandClaude Fable 5.1 006a9377c3 Profile validator: slice belt printers with two cubes along the belt
The slice check (-s) prints one 10 mm cube per printer with a height
range on filament 2 and expects the filament change to fire.  Since
#16236 a belt object's slicing Z starts at the belt below its leading
end, well below the part's first printed layer, so the range 4-10 falls
into the empty lead-in and filament 2 is never used: every belt printer
reported "the filament change never fired" and the Slice check job on
belt-printer went red.  A height range in slicing Z does not map onto a
part on a belt in any case.  Slice belt printers with two cubes one
behind the other along the belt, the second on filament 2, which gives
the one plain T1 the check looks for.  Other printers are unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 14:11:15 -05:00
harrierpigeonandClaude Fable 5.1 ef6d4a71de Tests: qualify Polyline in the belt overhang test for Windows
Windows headers declare a global Polyline, so the unqualified name in
test_print.cpp is ambiguous there (both Windows builds of belt-printer
fail at tests/fff_print/test_print.cpp:1336), as Polygon was in #16196.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 14:11:15 -05:00
Joseph Robertson 0b11311d40 Belt printer: no layer changes that print nothing, and a preview that survives them (#16245)
Fixes the preview layer bar on belt prints with several parts along the
belt (reported with a cube on filament 1 and a 3DBenchy on filament 2,
no purge tower): the top slider layer held nearly the whole print, the
slider jumped every other layer through the single-colour stretch before
the second part, and with the belt purge tower the whole print greyed
out while dragging.

## Cause

Since #16236 the slicing frame of a belt object starts at the belt below
its leading end, so its first layers are empty. On a single part they
carry the brim bands. With several parts along the belt the later parts'
empty layers fall between the earlier parts' printing layers and were
written to the G-code as layer changes with no moves at all. The preview
numbers its layers (`libvgcode::Layers`) from the vertices it is given
and expects consecutive ids, so at the first such gap it stopped
creating layers and folded everything after it into the last one.

## Fix

- `GCode::collect_layers_to_print` drops the belt layers that print
nothing (no object, support or brim content): no layer change without
moves in the file.
- `libvgcode::convert` renumbers the layers consecutively over the moves
that exist, so a file with empty layers from any source still previews
correctly.
- The layer slider labels each belt layer with its print Z (the slicer's
layer Z, which increases along the belt) instead of libvgcode's toolpath
height, which on a tilted layer is wherever its last extrusion happened
to end; the slider assumes the list increases, so the labels showed "0 /
max" on alternate layers. The processor reads that print Z from the
`;Z:` tag non-BBL printers write (it only knew `; Z_HEIGHT:`), on belt
printers only, so nothing changes for other printers.

## Verification

- New regression test *Belt G-code has no layer that prints nothing*
(two cubes 60 mm apart along the belt): fails on the previous code with
one empty layer, passes now.
- `fff_print_tests` 356 passed, `libslic3r_tests` 1116 passed;
`scripts/clang_tidy_diff.py --base upstream/belt-printer`: no findings.
- The reported project sliced through the CLI: 595 layers, none without
an extrusion, Z strictly increasing.
- Scripted GUI pass on the reported project with and without the purge
tower: the slider has one entry per G-code layer, each step shows a thin
tilted strip advancing along the belt, the top layer alone is a thin
strip, nothing greys out while dragging, the slider opens at the top
after slicing, and every label reads the layer number and the print Z
matching the G-code's `;Z:` (checked at the top, mid-print and through
the two-part stretch); raw-view toggle and slider retention unchanged.

Left as is: the lower handle at the bottom still reads `1 / 0.00` rather
than the first layer's Z (index correct); pre-existing.
2026-10-07 12:01:20 -05:00
SoftFever e027f8b225 Remove the CAD Primitive and Sketch gizmos from Prepare 2026-10-07 21:20:05 +08:00
SoftFever 6d02a945e0 Speed up the Linux incremental rebuild (optimizes packaging step) (#16244)
## Speeds up OrcaSlicer incremental rebuild on Linux

Profiled `build_linux_image.sh`: 96 s, of which 51 s in the dependency
audit.

**`appimage_is_elf_file()`** ran `file` and `grep` per candidate. An
AppDir holds ~9.6k of them, 4.8k being the bundled Python runtime and
none of them ELF: ~19k processes, 14 s. Reads the four-byte magic
instead. Checked against the old result on 4000 files, no disagreement.

**The dependency walk** popped its queue with `"${queue[@]:1}"`, which
rebuilds the whole array each time. At ~4.8k entries that was 22 s of
copying an array around. Uses a read index.

Audit still passes. `shellcheck` v0.11.0, the version CI uses, is clean.

## Notes
The 96 s -> 12.7 s. Measured on a 32-core / 48 GB machine, but the audit
is a serial bash loop, so cores and RAM is not the bottleneck. On slower
hardware the saving should be larger

## Images
<img width="1987" height="782" alt="Screenshot_20261007_092516"
src="https://github.com/user-attachments/assets/96fcb917-38e5-49e7-8cbe-b37be1a2f23a"
/>
<img width="1807" height="742" alt="Screenshot_20261007_092621"
src="https://github.com/user-attachments/assets/4a65ffae-4d59-41f0-a1c7-ee5b49f3c4be"
/>
2026-10-07 19:07:22 +08:00
SoftFever 01afd3b5b9 Use multiswitch for extruders instead new tabs on printer settings & publish dialog (#16162)
# CHANGES / TESTS
• Uses "Extruders" as tab name if it has multiple or it uses "Extruder" for single ones
• Keeps selected extruder while switching between "Extruders" and "Motion ability" tab
• Revert functions are working
• New extruders generated with values so they will shown in "Unchanged values" dialog if you try to change preset while its edited. revert functions not works properly without this
• BBL printers visible as Left / Right while normal printers visible as T1 / T2. i think there should be a separate option for how many toolheads and how many extruders it has. we might see 4 nozzles on same toolhead if one brand is brave enough :)
• Sidebar and other sections updates itself properly


<img width="751" height="173" alt="Screenshot-20261005173918" src="https://github.com/user-attachments/assets/3be0a6bd-84bd-4d15-822c-ed34acd98a9f" />
<img width="768" height="184" alt="Screenshot-20261005173905" src="https://github.com/user-attachments/assets/46164926-e385-4482-9fd1-41325eb9f61d" />
<img width="755" height="289" alt="Screenshot-20261005175318" src="https://github.com/user-attachments/assets/4550fa51-4c71-4a0a-b15e-9ca82dd0f1ad" />

# FIXES
• Extruders count on parameters section not updated when extruder count changed on printer settings. fixed on this PR
<img width="800" height="478" alt="Screenshot-20261005174702" src="https://github.com/user-attachments/assets/734e53df-f23f-4f83-8f87-2ecfeb6c162c" />

• New extruders gets randomly modifed parameters. fixed on this PR
<img width="871" height="87" alt="Screenshot-20261005174840" src="https://github.com/user-attachments/assets/254dae2a-fcfa-44ed-b3b0-038faf019abb" />

• Changed parameters not triggers revert / modified on extruder tabs. fixed on this PR

• Multi switch on motion ability tab not updated on extruder count change. fixed on this PR
<img width="813" height="184" alt="Screenshot-20261005174929" src="https://github.com/user-attachments/assets/f4f33f8f-b1bd-4a30-b91b-6ff632d08c2a" />
2026-10-07 19:05:37 +08:00
SoftFever b805f2ffd6 Fill a new extruder's machine limits the same way as its other settings 2026-10-07 18:42:09 +08:00
SoftFever 6b2b200f50 Merge branch 'main' into pr/yw4z/16162 2026-10-07 18:40:37 +08:00
yw4z a38e6c61f2 Show dummy image for printers without cover on printer selectiondialog (#16235)
init
2026-10-07 12:57:28 +03:00
SoftFever cc3769453f Merge branch 'main' into pr/yw4z/16162 2026-10-07 17:25:29 +08:00
harrierpigeonandClaude Fable 5.1 f64b49ab52 Belt printer: no layer changes that print nothing, and a preview that survives them
Since the slicing frame of a belt object starts at the belt below its
leading end, its first layers are empty.  On a single part they carry
the brim bands; with several parts along the belt the later parts'
empty layers fall between the earlier parts' printing layers and were
written to the G-code as layer changes with no moves at all.  The
preview numbers its layers (libvgcode::Layers) from the vertices it is
given and expects consecutive ids, so at the first such gap it stopped
creating layers and folded everything after it into the last one: the
top slider layer held nearly the whole print, the slider jumped every
other layer through the single-colour stretch before a second part on
another filament, and with the belt purge tower the whole print greyed
out while dragging.

Drop the belt layers that print nothing (no object, support or brim
content) in GCode::collect_layers_to_print, and renumber the layers
consecutively over the moves that exist when converting a result for
libvgcode, so a file with empty layers from any source still previews
correctly.  The layer slider labels a belt layer with its print Z (the
slicer's layer Z, which increases along the belt) instead of libvgcode's
toolpath height, which on a tilted layer is wherever its last extrusion
ended; the slider assumes that list increases and showed "0 / max" on
alternate layers.  The processor reads that print Z from the ";Z:" tag
non-BBL printers write (it only knew "; Z_HEIGHT:"), on belt printers
only, so nothing changes elsewhere.  Regression test: two cubes 60 mm apart along the
belt produce no layer without an extrusion and the header's layer count
matches.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 03:50:51 -05:00
HanifKoh f9ddb23804 Keep Each Filament's Device Drying Values When the CLI Merges Filaments (#16157)
The device drying options hold several values per filament, as many as
the filament preset gives, and a project stores them as the filaments'
values one after another. The CLI filament merge wrote them like an
option with one value per filament, putting each preset's first value at
the filament's own index, so a project with three filaments whose preset
gives "1", "0" was exported with 1;1;1;0;1;0 where the GUI writes
1;0;1;0;1;0.

The merge now leaves these options out of the per-filament pass and
rebuilds them afterwards from every filament's values in slot order.
Without a fixed number of values per filament one slot cannot be
replaced in place, so the stored values are kept when any slot has no
config to rebuild from.
2026-10-07 15:54:53 +08:00
HanifKoh ff8aebe76f Allow Unsigned Executable Memory in the macOS Entitlements (#16203)
The Bambu network plug-in's code protector rewrites one page of its own signed __TEXT after loading. The hardened runtime tolerates that until the page is evicted; the next read of it then kills OrcaSlicer with CODESIGNING Invalid Page. Bambu Studio signs with allow-unsigned-executable-memory for this reason; with it added, the same build survives critical memory pressure that killed it in 30 s without.
2026-10-07 15:52:18 +08:00
HanifKoh a56d1bf33e Keep a Project's Changed Values on Extruder Variants It Doesn't List (#16107)
A project's listed settings are carried onto its base preset by update_non_diff_values_to_base_config, which matched variants by exact name and id. A variant the base gained after the project was saved got the base's value, while the same value in a user preset now falls back to the preset's first variant of that extruder. So an old project opened with its printer preset already modified, and saving it wrote the base's values into the 3MF.

The function now maps variants with map_variant_indices, as update_diff_values_to_child_config does: a base variant the project does not list takes the project's first variant of the same extruder. The variant lists themselves stay the base's, so a fallback never writes one variant's name over another's.
2026-10-07 15:51:49 +08:00
HanifKoh 662a8e340d Support the 02.08.04 Bambu Network Plug-in Series (#16202)
The 02.08.02 series appended queue_plate_id to PrintParams and nothing
after it changed the ABI OrcaSlicer calls, so adding the field brings
the current layout up to 02.08.04. Make 02.08.04 the latest series and
drop 02.08.01 from the whitelist: its PrintParams no longer matches, and
its malformed bind table is refused by dyld on macOS 27, so it cannot
load there. A stored 02.08.01 falls back to the latest series through
the existing unsupported-version path.
2026-10-07 15:51:21 +08:00
ExPikaPaka bd0ef35b90 Speed up the Linux image build
Profiling build_linux_image.sh: 96 s, of which 51 s in the dependency audit.

appimage_is_elf_file() ran file(1) and grep per candidate. An AppDir holds ~9.6k
of them, 4.8k being the bundled Python runtime, none of them ELF: ~19k processes
for 14 s. Read the four-byte magic instead; checked against the old result on
4000 files, no disagreement.

The dependency walk popped its queue with "${queue[@]:1}", which rebuilds the
whole array each time. At ~4.8k entries that was 22 s of copying. Use a read
index.

96 s -> 12.7 s. The audit still passes.
2026-10-07 09:25:19 +02:00
HanifKoh 6639a32b0c Remove using namespace std from json_diff.hpp (#16222)
The directive sat at global scope in a header that DeviceManager.hpp
includes, so most of the GUI compiled with all of std in the global
namespace. 42 files had come to rely on it, mostly for string, vector
and unordered_map, four of them for the ""sv and ""ms literals.

Those sites are qualified. GCodeViewer.cpp spelled the type as
std::vector<::string>, which only resolved through the directive. The
files that use the ""sv and ""ms literals get a file-scope
"using namespace std::string_view_literals;" or
"using namespace std::chrono_literals;", as other sources already do.
2026-10-07 14:58:49 +08:00
Joseph Robertson 6927475499 Belt printer: bring back the raw G-code view in the canvas view menu (#16241)
The *Show raw G-code (belt only)* toggle retired in #16236 returns, as
an item of the Preview canvas view menu (the eye-icon popup, after
*Labels*) with its `B` shortcut, and only there: no legend checkbox.
Unlit, the preview shows the designed (upright) view; lit, the raw
machine-frame G-code, which is what to look at when checking the machine
frame transforms. The item only appears on a belt printer in Preview.

The toggle is view only (exported G-code is byte-identical either way),
and the layer slider now keeps its layer index across the reload (the
layer Z values differ between the two views, so the old keep-by-Z lost
the position).

## Verification
- Scripted GUI pass: item present only in the belt Preview menu (absent
in Prepare and on a non-belt printer), toggles from the menu and from
`B` with the eye following the state, legend has no belt entry, exported
G-code identical with the view on and off, slider stays at its layer
through toggles, 3MF reopen and printer switch unaffected.
- `fff_print_tests` 355 passed, `libslic3r_tests` 1116 passed;
`scripts/clang_tidy_diff.py --base upstream/belt-printer`: no findings.

Wiki: OrcaSlicer/OrcaSlicer_WIKI#374 documents the menu item and
shortcut with screenshots.
2026-10-07 01:45:53 -05:00
Joseph Robertson 0f86115eb6 Profile tool: list the retired belt keys as obsolete (#16240)
Gets the `belt-printer` CI green again after #16236:

- **Check profiles**: the profile tool's unit test
`test_obsolete_keys_match_the_loader_ignore_set` compares
`OBSOLETE_KEYS` with the loader's ignore set in
`PrintConfigDef::handle_legacy()`, which gained the twelve retired belt
keys. Adds them to the tool's list.
- **clang-tidy**: `tests/fff_print/test_print.cpp` used `std::sqrt`
without `<cmath>` (misc-include-cleaner).

Verification:
- `python3 -m unittest discover -s scripts/tests -t scripts`: 281 tests
pass.
- `scripts/orca_profile_tool.py check`: no errors.
- `scripts/clang_tidy_diff.py -p build-tidy --base upstream/main` on
this head, i.e. every line the belt branch changes against `main` (100
files, the same check the *Merge Belt Printing Into Upstream* PR runs):
no findings.
2026-10-07 01:45:38 -05:00
SoftFever b0da039eae Merge branch 'main' into pr/yw4z/16162 2026-10-07 14:44:59 +08:00
SoftFever 1ec195a221 Update build commands in AGENTS.md to use Release configuration 2026-10-07 14:44:04 +08:00
harrierpigeonandClaude Fable 5.1 e34f4aa0e5 Belt printer: bring back the raw G-code view in the canvas view menu
The "Show raw G-code (belt only)" toggle, retired in #16236, returns as
an item of the Preview canvas view menu (with its B shortcut), and only
there: no legend checkbox.  Unlit, the preview shows the designed,
upright view; lit, the raw machine-frame G-code, which is what to look
at when checking the machine frame transforms.  The toggle is view
only; exported G-code is the same either way.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 01:43:56 -05:00
Ian Chua e5324ae319 Fix Orca Cloud API requests to use HTTPS (#15391)
# Description

The default Orca Cloud API URL omits its scheme, so libcurl interprets
it as HTTP and follows the server redirect to HTTPS. Recent libcurl
versions intentionally do not forward the `Authorization` header across
protocol/port-changing redirects, causing Orca Cloud profile sync to
receive HTTP 401 `missing_authorization` responses and eventually log
the user out.

Use the HTTPS API URL directly. Besides restoring sync with current
libcurl versions, this improves security by preventing the bearer access
token from being sent in the initial unencrypted HTTP request.

# Screenshots/Recordings/Graphs

N/A — no UI changes.

## Tests

- `git diff --check`
- Confirmed with current libcurl that the scheme-less URL redirects and
loses the authorization header, while the direct HTTPS URL retains it
2026-10-07 14:30:07 +08:00
harrierpigeonandClaude Fable 5.1 cd155f07ae Tests: include <cmath> for std::sqrt in the belt overhang test
clang-tidy (misc-include-cleaner) flagged it on belt-printer.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 01:29:53 -05:00
HanifKoh 559ad3e2b7 Flag Global Usings in Headers with clang-tidy (#16225)
A using-directive or using-declaration in the global namespace of a
header reaches every file that includes it, and a using-declaration also
makes the include checker treat that header as the one to include for
the name. google-global-names-in-headers reports both, on changed lines
like the existing check, so headers that still have one are not held to
it until the line is touched.

The check does not see a using inside a namespace.

clang_tidy_diff.py's closing message assumed every finding was a missing
include; it now says other findings need a manual fix.
2026-10-07 14:23:11 +08:00
HanifKoh de6b0b9f2d Remove Header Usings and Aliases Nothing Depends On (#16224)
- ClipperUtils.hpp imported jtMiter, jtRound and jtSquare into the
  global namespace for every includer. No code names them there.
- BBLStatusBar.hpp, BBLStatusBarBind.hpp, BBLStatusBarPrint.hpp,
  BBLStatusBarSend.hpp and ProgressStatusBar.hpp re-exported their class
  into Slic3r::GUI. Nothing refers to the class through that namespace.
- Jobs/SendJob.hpp, Jobs/BindJob.hpp, Jobs/UpgradeNetworkJob.hpp and
  AuxiliaryDataViewModel.hpp declared "namespace fs = boost::filesystem;"
  at global scope without using it.
2026-10-07 14:23:00 +08:00
HanifKoh f02292f163 Stop Exporting Names Through Usings in GUI and Voronoi Headers (#16223)
Each of these headers put a using or namespace alias at global or
namespace scope, which every includer inherited:

- BBLTopbar.hpp: "using namespace Slic3r::GUI;" at global scope, reached
  through MainFrame.hpp. Seven source files used GUI names unqualified
  outside the namespace because of it, one of them as "::RadioBox".
- IMSlider.hpp and TickCode.hpp: "using namespace CustomGCode;" inside
  Slic3r.
- ProjectTask.hpp, Jobs/PrintJob.hpp and ConfigWizard_private.hpp:
  "namespace fs = boost::filesystem;". PresetBundle.cpp and GUI_App.cpp
  had no alias of their own.
- VoronoiUtils.hpp: "using VD = Slic3r::Geometry::VoronoiDiagram;" at
  global scope.

The headers now spell the names out. Source files that used them get
the qualifier, or a using of their own where there are many uses.
2026-10-07 14:22:45 +08:00
HanifKoh 23546e71ce Remove Unused Usings and the Includes Kept Only for Them (#16220)
151 using-directives, using-declarations, type aliases and namespace
aliases in source and test files that nothing refers to: the name is
never used, it duplicates a using already in scope, or the code sits
inside the namespace it names. Each one was removed on its own and the
file still compiled, both as it is and with every header-level using
taken away, so none of them was only redundant because a header leaks
the same name.

With the using gone, 28 #include lines and one forward declaration had
no other reference left in their file (boost/optional.hpp without any
optional, property_tree headers without any ptree) and go with it.

No header is touched.
2026-10-07 14:22:32 +08:00
HanifKoh 73d32d4791 Stop Leaking json Through Headers and Drop Includes Kept Only for the Name (#16221)
* Stop Leaking json Through Headers and Drop Includes Kept Only for the Name

AppConfig.hpp, DeviceManager.hpp and UserManager.hpp carried a global
"using namespace nlohmann;", json_diff.hpp a global "using json =
nlohmann::json;" and PrinterFileSystem.h a global "using nlohmann::json;".
Every file that included one of them, directly or not, could write a
bare json, and 63 did without declaring it.

The last two also made the include checker treat json_diff.hpp and
PrinterFileSystem.h as the headers that provide json, so they were
included from files that use nothing else from them: 57 of the 59
includers of json_diff.hpp never name json_diff.

The five statements are removed. Headers that use the type now spell
nlohmann::json, source files declare their own "using json =
nlohmann::json;", and the includes that only supplied the name are
dropped or replaced by <nlohmann/json.hpp>.

Eight files reached json_diff.hpp only through an include that is now
gone and with it lost that header's "using namespace std;". The std
names they used unqualified are qualified.

* Declare json in OrcaSlicer.cpp on Every Platform

OrcaSlicer.cpp had its "using namespace nlohmann;" and the json include
inside the Linux-only include block, so on Windows and macOS it took
json from AppConfig.hpp's global directive, which is gone. The include
and a "using json = nlohmann::json;" now sit outside the block.
2026-10-07 14:22:16 +08:00
harrierpigeonandClaude Fable 5.1 314e227cee Profile tool: list the retired belt keys as obsolete
The loader's ignore set in PrintConfigDef::handle_legacy() gained the
belt options retired in #16236, and the profile tool's unit test checks
that its OBSOLETE_KEYS matches that set, so the Check profiles job
failed on belt-printer.  Add the twelve keys.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 00:53:05 -05:00
Joseph Robertson ef3c47135f Belt printer: retire the redundant and unused options (#16236)
Follow-up to #16195 and the review discussion on #14394 (yw4z's note
about the third column on the *Belt tilt* row). Removes the belt options
that are redundant or unused before the branch ships, so they never need
compatibility handling after a release, and fixes supports under a
leading overhang. Every removed key is on `handle_legacy()`'s ignore
list, so existing profiles and 3MFs load silently.

## Removed

- **`belt_slice_rotation_global`**, **`preslice_remap_global`**,
**`belt_preslice_global`** (*Global mesh transforms*) and
**`gcode_back_transform`** — the global mode and the back-transform are
what belt printing is; they are presumed on wherever the flags were
consulted (`PrintObjectSlice`, `BeltBackTransform`, `BeltGCode`,
`Print::process`, `PrintApply`, `GCodeViewer`). The *Belt tilt* row is
axis + angle only; the three `fdm_belt_common.json` drop the keys.
- **`preslice_remap_x/y/z`** — no profile used the pre-slice axis remap;
the belt tilt axis plus the G-code axis remap cover the machines that
exist, and its implementation only agreed with itself for a plain swap.
The forward transform is the rotation.
- **`belt_support_z_offset_mode`** and **`belt_support_floor_mode`** —
the first was never read by a generator; the second's only shipped value
(*Generator only*) is now the behaviour.
- **`first_layer_plane`**, **`first_layer_plane_offset`**,
**`first_layer_plane_thickness`** and `FirstLayerPlane.{cpp,hpp}` — the
first-layer band is measured from the belt surface and is one first
layer height thick.
- `belt_brim_instances_compatible()` and its validation warning:
instances along the belt get their brim.

## Supports under a leading overhang (the clipping at the object's local
Z = 0)

The slicing frame of a belt object started at its lowest vertex, but the
belt under the leading end of an overhang lies below that, so no
generator could reach it: normal supports stopped at the object's lowest
layer, and both tree generators carried extension hacks sized from the
pre-rotation bbox and capped at global Z = 0 (right only for the
trailing half of the belt). The frame now starts at the lowest
belt-floor point under the footprint, less a 10 mm margin along the belt
for the base of a support column, and the extensions are gone:

- **Normal supports** run in the object frame and get the global belt Z
offset shifted onto the result (as organic already did). With the offset
on the object layers, a top contact at negative Z turned the
intermediate-layer count negative and the generator allocated layers
until the kernel killed it — any overhang in the leading half of the
belt did this. The first-layer flange expansion is skipped on a belt
(the first support layer is the leading tip, not a flange).
- **Classic tree** nodes keep dropping until their whole circle is in
the belt, so a branch tapers to a tip on the belt instead of stopping a
radius above it.
- **Organic**: the belt is no longer a support blocker. A blocker is a
collision, and a branch descending onto one slides off it, down the belt
and ahead of the part; the belt is where branches end, which the
per-layer floor clipping already does.

Regression test *Belt supports reach the belt under a leading overhang*:
a cube with a fin whose underside is parallel to the layers, 20 mm ahead
of the cube and up to 41 mm of slicing Z above the belt, for normal,
organic and classic tree supports; the lowest support layer must sit on
the belt beneath its own lines.

The belt object height (the layer range) is now estimated from the box
of the mesh as placed on the bed. `raw_bounding_box()` has the
instance's Z offset removed, which was harmless for the old
rotated-extent estimate but not for one anchored at the belt floor (a
point's rotated z and the floor under it move in opposite directions
under a Z shift): with the first version of this change every part came
out as a wedge, sliced only up to its diagonal, in the GUI and CLI
alike. Caught by a GUI test pass; the leading-overhang test now also
checks that the whole part is sliced.

## Belt brim after the parallel support step

`belt_brim_obstacles()` reads every object's layers and support layers,
which another object's support step rebuilds (and now shifts) at the
same time. The brim is generated sequentially once the parallel step is
over (`PrintObject::generate_belt_brim()`). This is the race behind the
Windows arm64 segfault in *Belt brim of each object precedes its
perimeters on its own filament*.

## UI

- *Belt tilt* is two rows: the angle (Advanced) and the axis (Developer;
a profile-level kinematics choice). A shared line is shown by its first
option's mode, so they cannot share one.
- *Machine frame transforms* is five single-option rows (G-code remap X
/ Y / Z, Decouple machine-frame tilt, Machine-frame tilt angle — the
angle row only appears when decoupled) instead of two multi-column
lines; the remap fields got full labels since they stand alone now.
- The gravity indicator on the bed is a plain line along the up
direction (no cone, 60 % of the axes' length), per yw4z.
- The *Show raw G-code (belt only)* legend/canvas toggle and its `B`
shortcut are gone; the preview is the designed view.

Also carries the two-line `phong.fs` fix from #16226 (merges as a
no-op).

## Verification

- `libslic3r_tests` 1116 passed (92 648 assertions); `fff_print_tests`
351 passed (561 696 assertions).
- `scripts/clang_tidy_diff.py --base upstream/belt-printer`: no
findings.
- `scripts/orca_profile_tool.py check`: no profile references a removed
key.
- GUI target builds; a scripted GUI pass (xdotool) checked the settings
groups in every mode, slicing, export, instances, the purge tower,
calibration dialogs, the wizard, printer switching and 3MF round-trip.

The wiki pages (OrcaSlicer/OrcaSlicer_WIKI#374) get a follow-up dropping
the removed sections once this is in.
2026-10-07 00:44:41 -05:00
SoftFever ba5ecc5470 Edit the selected extruder's machine limits on the Motion ability page 2026-10-07 13:41:42 +08:00
SoftFever 82349e1ba4 Give each extruder its own machine limits 2026-10-07 13:41:42 +08:00
harrierpigeonandClaude Fable 5.1 a2f5a8ce2b Belt printer: size the layer range from the on-bed box
The belt object height is estimated from a bounding box swept through
the tilt rotation.  raw_bounding_box() has the instance's Z offset
removed, which did not matter while the estimate was the box's rotated
Z extent (a Z shift moves every corner alike), but the frame now starts
at the lowest belt-floor point under the footprint, and a point's
rotated z and the floor under it move in opposite directions under a Z
shift: the offset box under-estimated the height by twice the object's
height above the bed, so the layers stopped at the part's diagonal and
every part came out as a wedge (GUI and CLI alike; the unit tests never
checked the top).  Use the box of the mesh in the frame it is sliced in
(trafo_centered(), Z as placed on the bed), and have the leading
overhang test check that the whole part is sliced.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 00:10:29 -05:00
harrierpigeonandClaude Fable 5.1 dda58b07cd Belt printer: supports reach the belt under a leading overhang
The slicing frame of a belt object started at its lowest vertex, but the
belt under the leading end of an overhang lies below that, by the
overhang's length times the tilt's shear.  Every support generator works
in layers at z >= 0, so none of them could reach it: normal supports
stopped at the object's own lowest layer, and the two tree generators
each carried a stack of hacks to extend themselves below it (a post-hoc
copy of the lowest base area in TreeSupport, "virtual belt raft layers"
in TreeSupport3D/TreeModelVolumes), sized from the pre-rotation bbox
and capped at global z = 0, which is only right for the trailing half
of the belt.

Start the frame at the lowest belt-floor point under the footprint
instead, less a 10 mm margin along the belt for the base of a support
column (BeltSliceStrategy::apply_preslice_transforms and
BeltTransformPipeline::compute_belt_height_and_floor agree on it).  The
layers between it and the first vertex come out empty, which belt
slicing already tolerates, and the generators need no extension at all:

- normal supports: the generator anchors its layer grid at the frame
  origin, so run it in the object frame and shift the global belt Z
  offset onto the result afterwards, as organic supports already did.
  With the offset on the object layers a top contact at negative z
  turned the intermediate-layer count negative and the generator
  allocated layers until the kernel killed it (any overhang in the
  leading half of the belt).  Drop the first-layer flange expansion on a
  belt: the first support layer is the leading tip of the support, not
  a flange, and inflating it put lines in the air ahead of the belt.
- classic tree: a node now keeps dropping until its whole circle is in
  the belt, so the branch tapers to a tip on the belt instead of
  stopping, a radius above it, when its centre crosses.
- organic: the belt is no longer a support blocker.  A blocker is a
  collision, and a branch descending onto one slides off it, down the
  tilted belt and ahead of the part; the belt is where branches end,
  which the per-layer m_belt_floor clipping already does.

The belt brim is generated after the parallel support step instead of
inside it: belt_brim_obstacles() reads every object's layers and support
layers, which another object's support step rebuilds (and, now, shifts)
at the same time.  This is the race behind the Windows arm64 segfault
in "Belt brim of each object precedes its perimeters on its own
filament".

Also: the belt tilt axis moves to Developer mode as its own row (a
shared line is shown by its first option's mode), first_layer_plane
band thickness, belt_support_floor_mode, belt_preslice_global and
gcode_back_transform are retired and presumed on, the gravity arrow is
a plain line along the up direction, and the "Show raw G-code (belt
only)" preview toggle is gone.

Regression test: "Belt supports reach the belt under a leading
overhang" slices a cube with a fin whose underside is parallel to the
layers, 20 mm ahead of the cube and up to 41 mm of slicing Z above the
belt, for normal, organic and classic tree supports, and checks that
the lowest support layer sits on the belt beneath its own lines.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-06 22:14:25 -05:00
Joseph Robertson 7f749ee02b Merge branch 'main' into belt-printer 2026-10-06 18:27:21 -05:00
harrierpigeonandClaude Fable 5.1 8039d4d2ac Belt printer: retire the redundant and unused options
Removed, with the keys added to handle_legacy()'s ignore list so saved
profiles and 3MFs keep loading:

- belt_slice_rotation_global and preslice_remap_global. Both were only
  consulted when belt_preslice_global ("Global mesh transforms") was off,
  which no profile does; belt_preslice_global is now the single global
  mode and is presumed on everywhere the old flags were ORed in
  (PrintObjectSlice, BeltBackTransform, BeltGCode, Print::process,
  PrintApply). The Belt tilt row is axis + angle only.
- preslice_remap_x/y/z. No profile used the pre-slice axis remap; the belt
  tilt axis plus the G-code axis remap cover the machines that exist, and
  its implementation only agreed with itself for a plain swap (matrix
  columns vs remap_bbox rows). BeltTransformPipeline::build_preslice_remap,
  remap_bbox and has_preslice_remap are gone, the forward transform is the
  rotation, and the G-code header no longer carries the remap.
- belt_support_z_offset_mode. Saved and invalidated steps, but no support
  generator read it.
- first_layer_plane and first_layer_plane_offset, with FirstLayerPlane.cpp.
  On every shipped configuration the band is measured from the belt
  surface (GCode::belt_height_above_floor) and the evaluator was only
  reached for an explicit XY/YZ/XZ choice or a non-zero offset, which
  nobody set. first_layer_plane_thickness stays as the band unit,
  relabelled "First layer band thickness".

UI: the Machine frame transforms group is five single-option rows (G-code
remap X / Y / Z, Decouple machine-frame tilt, Machine-frame tilt angle;
the angle row is shown only when decoupled) instead of two multi-column
lines, and the remap fields carry full labels.

Also carries the phong.fs struct fix from #16226 so the worktree build
links its shaders.

libslic3r_tests and fff_print_tests pass; clang-tidy diff check clean;
orca_profile_tool.py check clean.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-06 18:14:34 -05:00