Commit Graph

450 Commits

Author SHA1 Message Date
Aleksandr Dobkin
47b7a1ec6d Avoid extra z travel moves 2026-03-26 06:25:04 -07:00
Aleksandr Dobkin
e9fd3da7e9 Various ZAA fixes.
- Handle z contouring in variable speed flow when emitting GCode
- Add logic to restore nominnal z height for regular extrusions
- preserve z_contoured flag when splitting extrusion paths
2026-03-24 09:18:38 -07:00
Aleksandr Dobkin
0d9c19e759 Fix contour extrusion path logic and improve GCode extrusion handling 2026-03-19 01:32:51 -07:00
SoftFever
2447069f82 Merge branch 'main' into zaa 2026-03-18 18:10:35 +08:00
SoftFever
534dee4d0e Add wipe_tower_type printer setting to replace vendor-based wipe tower selection
Previously, wipe tower behavior was determined by checking if the printer
  was a QIDI vendor. This introduces a configurable enum (Type 1 / Type 2)
  so any printer can select its wipe tower implementation. BBL printers
  remain hardcoded to Type 1. Qidi profiles default to Type 1.
2026-03-15 22:19:53 +08:00
Aleksandr Dobkin
705e9a74e9 Fix scarf seams 2026-03-13 01:56:51 -07:00
Aleksandr Dobkin
d1bcc78d14 Merge branch 'main' into zaa 2026-03-11 01:04:44 -07:00
Alexandre Folle de Menezes
7605b81d4e Standardize strings (#12665)
* Standardize view actions

* Standardize the term for "first layer"

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-03-09 20:36:36 +08:00
Olof Larsson
883377c9ae fix: round flush_volumes_matrix values to integers (#12672)
When flush_multiplier is applied to flush_volumes_matrix values, the
result can be a decimal (e.g., 272 * 1.3 = 353.6). Some printer firmware
metadata parsers (notably Creality K2) crash when parsing decimal values
in flush_volumes_matrix, causing prints to get stuck at "File selected".

This fix rounds the multiplied values to integers, ensuring compatibility
with firmware that expects integer values in this field.

Fixes compatibility with Creality K2 and potentially other Klipper-based
printers that parse the CONFIG_BLOCK metadata.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-09 20:35:56 +08:00
SoftFever
e6f6095834 Fix crash when slicing multi-material print with wipe tower (#12682)
The WipeTower2 code path never called construct_mesh(), leaving
wipe_tower_mesh_data as std::nullopt. GCode export then dereferenced
it unconditionally, triggering an assertion failure / crash.
2026-03-09 13:31:11 +08:00
Argo
f0e5c76e5e Wipe tower "infinite out of bed line" fix (#12267)
Fix wipe tower out-of-bed moves

Co-authored-by: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com>
2026-02-26 16:11:13 +08:00
Derrick
a2e7978f3a Fix Intra-layer "As Object List" not working. (#12368)
Added checks in ByLayer print sequence to handle ordering for Intra-layer ordering option. Prevents new ordering setup when "As object list" is enabled.
2026-02-23 22:05:47 +08:00
SoftFever
a203235903 Fix machine envelope G-code emitting wrong limits due to broken extruder_id indexing (#12414)
print_machine_envelope() used get_extruder_id(extruder_id)*2 to index
machine limit arrays that only hold [Normal, Stealth] (2 entries).
For multi-extruder setups this went out-of-bounds, causing wrong M201/M203
values in the G-code which then override the estimator's correct limits.

Same class of bug as c6d1c11ebb but on the G-code writer side.

Changes:
- Remove unused extruder_id param from print_machine_envelope()
- Use .values.front() for M201/M203, matching M204/M205 in same function
- Change get_option_value() fallback from .back() to .front() so any
  future out-of-bounds index returns Normal mode instead of Stealth
2026-02-22 16:13:06 +08:00
Argo
a80257eb7e Ported Bambu Studio wipe tower interface features (with improved preheat and cooldown behaviour) - NEW (#12266)
Wipe tower interface features and preheat fixes

Fresh PR branch rebuilt on upstream/main (squash of origin/BBL-studio-wipe-tower-merge) to avoid merge-history issues.
2026-02-13 22:53:25 +08:00
Dipl.-Ing. Raoul Rubien, BSc
69807ffc2f Fixes 1 Bug and 8 Compiler Warnings (#10654)
* fixes: keys_map is initialized with itself [-Winit-self]

* fixes: operation on repeats may be undefined [-Wsequence-point]

* fixes: warning: suggest parentheses around && within || [-Wparentheses]

* fixes: moving brim_points to itself [-Wself-move]

* fixes: operation on unprintability may be undefined [-Wsequence-point]

* fixes: extra tokens at end of #endif directive [-Wendif-labels]

* fixes: converting to non-pointer type int from NULL [-Wconversion-null]

* review result: simplifies fix 'operation on repeats may be undefined'
2026-02-12 08:41:35 +08:00
Matthias Nott
6250fab6a4 feat: Add Z Anti-Aliasing (ZAA) contouring support
Port Z Anti-Aliasing from BambuStudio-ZAA (https://github.com/adob/BambuStudio-ZAA)
to OrcaSlicer. ZAA eliminates stair-stepping on curved and sloped top surfaces
by raycasting each extrusion point against the original 3D mesh and micro-adjusting
Z height to follow the actual surface geometry.

Key changes:
- Add ContourZ.cpp raycasting algorithm (~330 lines)
- Extend geometry with 3D support (Point3, Line3, Polyline3, MultiPoint3)
- Template arc fitting for 2D/3D compatibility
- Change ExtrusionPath::polyline from Polyline to Polyline3
- Add 5 ZAA config options (zaa_enabled, zaa_min_z, etc.)
- Add posContouring pipeline step in PrintObject
- Update GCode writer for 3D coordinate output
- Add ZAA settings UI in Print Settings > Quality
- Add docs/ZAA.md with usage and implementation details

ZAA is opt-in and disabled by default. When disabled, the slicing pipeline
is unchanged.
2026-02-09 20:42:26 +01:00
davyd
59ea4746b1 feat: Add File header G-code option and print_time_sec/filament_length_m placeholders (#12186)
## Problem

Some Creality printers (e.g. Ender-3 V3 SE) rely on metadata comments in the first lines of G-code files to display print info on the screen (estimated time, filament usage, layer height). This follows a format originally used by Cura/Creality Print:
```
;FLAVOR:Marlin
;TIME:3708.97
;Filament used:6.21m
;Layer height:0.2
```

OrcaSlicer currently has no way to write content before the `HEADER_BLOCK` in the G-code output, and does not expose `print_time_sec` or `filament_length_m` as usable placeholders. As a result, these printers show zeroed-out print info on screen.

## Changes

### 1. New placeholders (post-processing)
Added two new G-code placeholders resolved during post-processing:
- `{print_time_sec}` — total estimated print time in seconds (double)
- `{filament_length_m}` — total filament length in meters (double)

These values are only available after G-code generation, so they use inline marker replacement (`@PRINT_TIME_SEC@`, `@FILAMENT_LENGTH_M@`) that `GCodeProcessor::run_post_process()` substitutes with actual computed values — the same pattern used by existing M73 and layer count placeholders.

### 2. New "File header G-code" option (`machine_top_gcode`)
Added a new G-code field in **Printer Settings > Machine G-code** that writes content at the very top of the output file, before `HEADER_BLOCK_START`. This allows users to add firmware-specific metadata that must appear in the first lines.

### 3. Creality Ender-3 V3 SE profile update
Pre-configured the Ender-3 V3 SE profiles (all 4 nozzle variants) with a default `machine_top_gcode` value matching the Cura-compatible header format, so print info displays correctly out of the box.

# Screenshots

| Before (current OrcaSlicer) | After (this PR) |
|---|---|
| ![IMG_5285](https://github.com/user-attachments/assets/fdd2cc96-6593-4108-83f4-e272d5547467) | ![IMG_5286](https://github.com/user-attachments/assets/6cb4091a-4560-4596-93d9-49f2ff8f0a2b) |

## Tests

- Sliced test model with Ender-3 V3 SE profile
- Verified G-code output contains correct values in first lines:
  - `;TIME:` with actual print time in seconds
  - `;Filament used:` with filament length in meters
  - `;Layer height:` with correct layer height
- Verified `{print_time_sec}` and `{filament_length_m}` work in both Machine Start G-code and File header G-code fields
- Verified empty `machine_top_gcode` produces no extra output
- Built and tested on macOS (arm64)
2026-02-08 23:56:28 +08:00
SoftFever
be0a5dd7d2 Merge branch 'main' into libvgcode 2026-01-06 11:09:09 +08:00
Ian Bassi
70b5b5748b Emit Disable Power Loss Recovery (#11616)
* Emit Disable Power Loss Recovery

Now only works if it's enabled but the goal it's to force disable it.
With this change it will always emit the command for BBL or Marlin 2.

Co-Authored-By: Michael Rook <54159303+michaelr0@users.noreply.github.com>

* Refactor power loss recovery G-code comments

* Return empty power loss recovery when no compatible printer

* Update power loss recovery comments

Update label and tooltip for power loss recovery

* Add enum for power loss recovery mode

Refactored power loss recovery configuration to use a new PowerLossRecoveryMode enum instead of a boolean. Updated GCodeWriter and related logic to handle the new enum, allowing for 'printer_configuration', 'enable', and 'disable' options. Updated config handling, legacy value conversion, and default values accordingly.

* Update PrintConfig.cpp

---------

Co-authored-by: Michael Rook <54159303+michaelr0@users.noreply.github.com>
Co-authored-by: SoftFever <softfeverever@gmail.com>
2025-12-31 00:16:47 +08:00
SoftFever
8873385e56 fix a build error 2025-12-23 19:48:21 +08:00
Kuran Kaname
b94e868878 Adjust resonance avoidance speed calculation (#11462)
* Adjust resonance avoidance speed calculation

 * Only adjust if it's strictly below max
 * If the speed is over half of the set speed range,
   use the max speed to prevent slowdowns

Signed-off-by: Kuran Kaname <celtare21@gmail.com>

* update comment

---------

Signed-off-by: Kuran Kaname <celtare21@gmail.com>
Co-authored-by: SoftFever <softfeverever@gmail.com>
2025-12-23 12:55:55 +08:00
scaiper
d73baabeaf fix probe count for adaptive bed mesh (#11491)
fix probe_count in adaptive bed mesh
2025-12-22 17:41:50 +02:00
Kiss Lorand
8d57b15cd9 Fix: Timelapse Z-hop logic used when timelapse was disabled (#11444)
No timelapse gcode if no timelapse
2025-12-18 14:34:32 +00:00
Ioannis Giannakas
c4374ae5ad Merge branch 'main' into libvgcode 2025-12-18 12:55:11 +00:00
Michael Rook
14b755ce5e Add ability to disable Power Loss Recovery on BBL machines (#11582)
* Add ability to disable Power Loss Recovery

* Fix typo in PrintConfig.hpp for power loss recovery

* Attempt to resolve Unknown option exception: disable_power_less_recovery

Add disable_power_loss_recovery property to any json which had scan_first_layer

* Revert "Attempt to resolve Unknown option exception: disable_power_less_recovery"

This reverts commit ddaf34b317f8797540235b8f7d179b1c9b6d10f8.

* Fix typo

* Change attribution from BBS to Orca in PrintConfig.cpp

* Mini refactor power loss recovery handling in GCode export

- Moved power loss recovery G-code generation to a new method in GCodeWriter.
- Support Marlin 2

* Update comments and power loss recovery handling

* Implement power loss recovery G-code commands

Added functions to start and end power loss recovery with appropriate G-code commands and comments.

* Add power loss recovery methods to GCodeWriter

* refactor and fix build errors

---------

Co-authored-by: Michael Rook <michael@rook.id.au>
Co-authored-by: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com>
Co-authored-by: SoftFever <softfeverever@gmail.com>
2025-12-10 23:19:57 +08:00
Andrew Sun
4e5f1b1d6f Merge branch 'main' into libvgcode 2025-11-21 08:47:25 -05:00
Kiss Lorand
9a50266ece Reduce artifacts from short travel moves before external perimeters (#10722)
Accel to extloop

Co-authored-by: SoftFever <softfeverever@gmail.com>
2025-11-20 22:11:12 +08:00
Andrew Sun
f9a144a34e Merge remote-tracking branch 'upstream/main' into libvgcode
# Conflicts:
#	src/libslic3r/GCode/GCodeProcessor.cpp
2025-11-18 20:22:57 -05:00
Andrew Sun
ca639f001f Merge remote-tracking branch 'upstream/main' into libvgcode
# Conflicts:
#	src/slic3r/GUI/GLCanvas3D.cpp
2025-11-16 22:53:04 -05:00
Andrew Sun
2ddf9d92a2 Merge remote-tracking branch 'upstream/main' into libvgcode
# Conflicts:
#	src/libslic3r/GCode/GCodeProcessor.cpp
#	src/libslic3r/GCode/GCodeProcessor.hpp
#	src/slic3r/CMakeLists.txt
#	src/slic3r/GUI/GCodeViewer.cpp
#	src/slic3r/GUI/GCodeViewer.hpp
#	src/slic3r/GUI/GLCanvas3D.cpp
#	src/slic3r/GUI/GLCanvas3D.hpp
#	src/slic3r/GUI/GUI_Preview.cpp
2025-11-15 11:11:20 -05:00
Noisyfox
e3f3414691 Merge remote-tracking branch 'upstream/main' into dev/p2s-pr
# Conflicts:
#	src/libslic3r/GCode.cpp
2025-11-14 18:48:32 +08:00
Noisyfox
cc3fe720eb Fix initial filament loading (#11350)
* Fix initial filament loading for non-bbl printers (SoftFever/OrcaSlicer#11218)

* Add missing initial PA for bbl printers

* Reset APA after toolchange
https://github.com/SoftFever/OrcaSlicer/pull/5609#issuecomment-3532029620
2025-11-14 18:46:34 +08:00
xun.zhang
f2116a4f1c ENH: add eager lift function
1.Immediate do lift in eager_lift function

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I931d22e901e2123bb886c31d8d1a5788fddeed42
(cherry picked from commit 6cea772d4f3b2f7e2a43c35a2271e4bdbba9eadd)
2025-11-14 11:08:08 +08:00
Noisyfox
87c8dba713 Fix filament end gcode missing for non-bbl machines 2025-11-13 22:33:26 +08:00
Noisyfox
484f9e222f Merge branch 'main' into dev/p2s-pr 2025-11-04 10:26:47 +08:00
Noisyfox
e9f6051d5b Fix initial filament loading for non-bbl printers (SoftFever/OrcaSlicer#11218) 2025-11-03 23:53:13 +08:00
HYzd766
a6bffacba1 Multi-color code compatible with QIDI models (#11185)
* The 0.30mm layer height configuration for the 0.4 nozzle of the QIDI model has been removed

* Merge branch 'main' into main

* Merge branch 'SoftFever:main' into main

* Revert "The 0.30mm layer height configuration for the 0.4 nozzle of the QIDI model has been removed"

This reverts commit 8d296720b8de58b1bfa4f008a24cee841a8472c6.

* Update Qidi Q2 0.4 nozzle.json

修改Q2打印高度

* Merge branch 'SoftFever:main' into main

* Merge branch 'SoftFever:main' into main

* change machine_gcode

* Merge branch 'main' of https://github.com/HYzd766/OrcaSlicer

* Merge branch 'SoftFever:main' into main

* Multi-color code compatible with QIDI models

* Merge branch 'main' into main

* toggle axis visibility on canvas (#9666)

* toggle axis visibility on canvas

* set show_axes config on toggle

* fix: Add pause and filament change to machine gcodes for Sovol SV08 MAX (#11214)

* Add fixed Ironing Angle setting for uniform surface finish (#11195)

* Initial working fixed ironing angle implemented with new Fixed ironing angle setting

* update documentation

* Combine Fill.is_using_template_angle and Fill.alternate_fill_direction into Fill.fixed_angle

* Rename SurfaceFillParams.is_using_template_angle to SurfaceFillParam.fixed_angle.
2025-11-03 21:34:11 +08:00
Noisyfox
f57de3b5fa Hardcode first_x_layer_fan_speed to 0 when parsing gcode template 2025-10-31 09:30:23 +08:00
weizhen.xie
72b262447d ENH: Support skipping flushing when skipping object in sequential (by-object) printing.
Jira: O1-16971

Change-Id: I6b80f062f69bf02a77b2f8a3f9fa300a40b23e26
(cherry picked from commit 1679f0dd6121d6198b01e020799b3352579504f9)
2025-10-28 15:30:06 +08:00
weizhen.xie
9b667f3acf Fix: Modify the method of obtaining the first_layer_time.
Jira: None

Change-Id: I0ef83d8f47f9d7b235b88caaa8b895367729f3e9
(cherry picked from commit 1de8d5c0d3bb6742219963bd7297286a937e0ed5)
2025-10-28 15:30:05 +08:00
weizhen.xie
0f58c56023 ENH: add initial layer time to plate_x.json and slice_info.config
Jira: STUDIO-14504
Change-Id: I32460f1c19cce7c729806e35370e8b4b57aa069e
(cherry picked from commit 04a487d210134c28245c1f0f7d0986266a1c66f2)
2025-10-28 15:30:05 +08:00
weizhen.xie
187280646d FIX: Bug caused by passing an empty ordering to process_layer in sequential (per-object) printing mode.
Jira: STUDIO-14550
Change-Id: I22a24f674370b3c04fb92b48cb9f229123e41e8a
(cherry picked from commit 7597a4a95e19d882eabb404f20f98955752b5730)
2025-10-28 15:30:05 +08:00
weizhen.xie
bcc3c21498 ENH:Object skipping supports skipping flushing of filament change
Jira:[STUDIO-12781]

Change-Id: Ia21d07b0ef107867cce55631d99bd03caebd6387
(cherry picked from commit d74849d499078f87d14282e92f48b2c02355d96c)
2025-10-28 15:30:05 +08:00
songwei.li
e8808278e5 FIX: The retract error generated by the travel
When the retraction setting is larger than the retraction during the material change, the travel triggered during the material change will make up for the retraction interpolation, but the retracted extruder head will be the wrong one. By moving the travel part in the extruder switch Gcode to after the traditional head change (where m_curr_extruder_id in writer() is updated), the old ID is avoided during travel.

jira: STUDIO-14764
Change-Id: I8af8f66af180f01de2fef5760601ee54e73548c4
(cherry picked from commit 008c436803cdf48d3bdcf6fcd85596fc91b3fc70)
2025-10-28 15:29:59 +08:00
weizhen.xie
1d681a8869 Fix: Fix the issue of inconsistent initial_layer_flow_ratio across multiple objects
Jira: STUDIO-14795
Change-Id: I202bdaa70ea7d997e617e757ea95f759a9bb18de
(cherry picked from commit 3da903e492216685d74b621cb4966f5a06ff885e)
2025-10-28 15:29:56 +08:00
zhimin.zeng
8a3e109e21 FIX: Some unnecessary timelapse photography commands
jira: STUDIO-14775
Change-Id: I301508b3b25ae9d43fbf93bc976d1f8c3556bc52
(cherry picked from commit cfeaa7257b156ea395c905fe797bd7e1052700ff)
2025-10-28 15:29:55 +08:00
songwei.li
41d1a7ba33 NEW: Add temperature-hold flag to machine_start_gcode
Description:By calculating the total area of the first layer (object, support, wipe tower), the flag is true when the area is greater than 200 and the height is less than 0.3 mm. machine_start_code placeholder: "hold_chamber_temp_for_flat_print"

jira: STUDIO-13370
Change-Id: If5982da28afb57e9bbb8a0a1ba69bc45f5cc1c7c
(cherry picked from commit eb942df30e6779acbdf1d330cae5c6ebe0010abf)
(cherry picked from commit 47a242ecd639cc630f70d9b6cf4d1fd91fd511d4)
(cherry picked from commit 87f4741d9caaf33699d647a2ce5b4f60d535f7b1)
2025-10-28 15:29:48 +08:00
qing.zhang
a9094ff45b ENH: get max additional fan
Jira: none

Signed-off-by: qing.zhang <qing.zhang@bambulab.com>
Change-Id: Idffeb2000936e0b72d2d4cfd2c397eea03cd0319
(cherry picked from commit 772780bcca58300a02546605db414e41731c45f6)
(cherry picked from commit 0aa3a4a215c11d3ed20d968f65e1c51938fee7d2)
(cherry picked from commit 7f6eae184eb296deea96f700af03e5902cf59992)
(cherry picked from commit f86b6a19585199b24848a49b50ca6ccd46f3381d)
2025-10-28 15:29:48 +08:00
Ian Bassi
beeca44065 Calibration Cornering Jerk Test + Generic interpolator + Fix (#10962) 2025-10-26 20:44:19 +08:00
Noisyfox
c94e6a8afd Merge branch 'main' into dev/h2d 2025-10-20 23:15:29 +08:00