Commit Graph

536 Commits

Author SHA1 Message Date
Rodrigo Faselli
eeb2ec7871 Added Junction Deviation support to time estimation (#12417)
# Description

This PR enhances the GCodeProcessor's time estimation by incorporating Junction Deviation (JD) into the jerk calculations, providing more accurate print time predictions for firmwares that use JD (like modern Marlin).

Key Changes:
- Added JD support to time estimation

- Reads machine_max_junction_deviation (machine limits) and default_junction_deviation (print profile)

- When JD is enabled (>0), replaces traditional X/Y jerk values with JD-based calculation:
$Jerk = \sqrt{2.5\cdot JD \cdot acceleration }$

- Falls back to traditional jerk when JD is not used

# Test:
JD:0.0256mm   Accel.: 1000 mm/s²
<img width="2560" height="1392" alt="image" src="https://github.com/user-attachments/assets/f0e95294-bfca-400e-bffc-8d615d051b70" />

Jerk: 8mm/s  (equivalent)
<img width="2560" height="1392" alt="image" src="https://github.com/user-attachments/assets/8508727e-70f6-49ed-ac19-002db73e957b" />

JD:0.0128mm (4mm/s jerk)
<img width="2560" height="1392" alt="image" src="https://github.com/user-attachments/assets/91b04d3b-1b9e-48f4-b4b4-5addda2eff57" />
2026-02-23 22:48:24 +08:00
SoftFever
e7d2bbd6a9 Fix preheat regression bugs (#12438)
Fix preheat regression bugs
revert 769fc137c7
2026-02-23 21:48:11 +08:00
SoftFever
c085eb845c 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
SoftFever
859f401df5 Fix time estimation using wrong machine limits due to broken extruder_id indexing (#12411)
The extruder_id*2 offset in get_axis_max_feedrate/get_axis_max_acceleration
was cherry-picked from BambuStudio's per-nozzle limit system, which OrcaSlicer
never ported. Without that system the limit arrays only have 2 values
([0]=Normal, [1]=Stealth), so any extruder_id > 0 or the uninitialized
value (255) would overshoot the array and fall back to values.back(),
always returning stealth-mode limits and producing incorrect time estimates.

Revert to indexing by time mode only (matching v2.3.1 behavior) and simplify
the M201/M203 handlers to write only the two mode slots they actually use.
2026-02-22 13:08:23 +08:00
minicx
7e1b2d99d3 Add Pressure Advance visualization support (#11673)
* Add Pressure Advance visualization support

Signed-off-by: minicx <minicx@disroot.org>

* Port Pressure Advance visualization to libvgcode architecture

Adapt PA visualization (originally in commit e3a77259) to work with
the new libvgcode library introduced by upstream PR #10735.

Changes across the libvgcode stack:
- PathVertex: add pressure_advance field
- Types.hpp: add PressureAdvance to EViewType enum
- ViewerImpl: add ColorRange, color mapping, range updates for PA
- LibVGCodeWrapper: pass pressure_advance from MoveVertex to PathVertex

GCodeViewer UI integration:
- Add "Pressure Advance" to view type dropdown
- Add PA color range in legend (3 decimal places)
- Add PA value display in sequential view marker tooltip
- Add PA row in position properties table

The GCodeProcessor PA parsing (M900, M572, SET_PRESSURE_ADVANCE)
is preserved from the original implementation.

* Tag Pressure Advance visualization changes with ORCA comments

Signed-off-by: minicx <minicx@disroot.org>

---------

Signed-off-by: minicx <minicx@disroot.org>
Co-authored-by: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-02-21 13:10:08 +00:00
Argo
769fc137c7 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
Argo
ed3f0e2898 Fix issue #10971 (#12108)
Sorry had to re-create the PR as I did some chaos in my repo with CLI. xD

Fixes issue https://github.com/OrcaSlicer/OrcaSlicer/issues/10971

Description:
Fix wipe tower filament selection and clean up tool ordering. Added wipe_tower_filament handling to WipeTower2 (store config, mark non-selected tools as “soluble,” and use it in toolchange selection) and ensured the configured wipe‑tower extruder is included in the extruder list for ordering. Removed duplicated/merged tool‑ordering code (extra insert_wipe_tower_extruder definition, duplicate declaration, and redundant reorder block) so the tool order logic runs only once.

<img width="1819" height="799" alt="image" src="https://github.com/user-attachments/assets/cef39026-cf6a-46da-a87a-ef895774699f" />
2026-02-10 10:56:38 +08:00
davyd
2f2f0df6af 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
Kiss Lorand
ecc2c91e32 Fix aligned back seam positioning for mirrored objects (#12028)
* Fix aligned back seam positioning for mirrored objects

This change makes “Aligned back” seams behave the same on mirrored models as on normal models.
Mirroring flips the model’s surface directions, so the slicer treated the back as the front.
Now it corrects those directions when calculating seam visibility, so seams still line up on the back after mirroring.

* Comments

Add comments to the changes
2026-01-21 16:00:32 -03:00
SoftFever
779f4a890d QoL: improve gcode marker (#11881)
QoL: Improve gcode marker
2026-01-09 11:52:30 +08:00
Ioannis Giannakas
4af168bac7 Fix erroneous interpolation on speed, flow rate in speed and flow views (#11848)
# Description

Reverts to default orca behaviour of showing the gcode speeds and flow values instead of an interpolation to the next segment.

The existing behaviour incorrectly shows the next G1 XY command following a bridge or overhang as interpolated when using the speed and flow views. This is inconsistent with both actual speed (as its limited to a single segment) and gcode view (as it shows a speed gradient where there is none in the gcode).

Before / after
![image](https://github.com/user-attachments/assets/f3dc1130-40cf-48e6-8da4-ef4b7df15721)
![image](https://github.com/user-attachments/assets/a14c88f7-07dd-4076-be82-dbc13b05ad00)

![image](https://github.com/user-attachments/assets/7876e297-2f59-4adf-bd13-c1da75117d33)


Actual speed and flow views are unaffected

![image](https://github.com/user-attachments/assets/c71d6361-9190-4bb4-8b44-40131b1c4b8f)
![image](https://github.com/user-attachments/assets/e97bf6cc-e2ab-4aed-8130-b41f3e4a7ed2)
2026-01-08 23:14:46 +08:00
SoftFever
1b355be432 Merge branch 'main' into libvgcode 2026-01-06 11:09:09 +08:00
Rodrigo Faselli
ef876fe577 Wipe Tower Auto Brim bug-fix (Non BBL printers) (#11831)
# Description

Fix application freeze when Prime Tower brim is set to Auto

This PR fixes an issue where enabling Auto brim width for the Prime Tower caused the application to freeze and consume unbounded amounts of memory.

Root cause
0c5f6c9865/src/libslic3r/GCode/WipeTower2.cpp (L2036-L2039)
When Auto brim is selected, the brim width was not being computed and the raw configuration value (-1) was used directly.
This resulted in an effectively infinite loop during Prime Tower brim generation, leading to runaway memory allocation instead of a controlled failure or a crash.

Solution

The Auto brim width is now properly computed based on the Prime Tower height, matching the intended behavior and existing logic used in other slicer implementations.
2026-01-05 20:15:23 +08:00
SoftFever
32cf44fc0a Don't emit the preheat command if ooze_prevention is disabled. (#11791) 2025-12-31 23:36:32 +08:00
Ian Bassi
81dd153798 Small area flow compensator improvements (#11716)
* Replace spline with PchipInterpolatorHelper in flow compensator

Swapped out the tk::spline implementation for PchipInterpolatorHelper in SmallAreaInfillFlowCompensator. Updated member types and method calls to use the new interpolator for improved flow compensation modeling.

* Enforce strictly increasing flow compensation factors

Added a check to ensure that flow compensation factors in SmallAreaInfillFlowCompensator strictly increase with extrusion length, throwing an exception if this condition is not met. This improves input validation and prevents invalid compensation models.

* Add context to Small Area Flow Compensation errors

Prefixed error messages in SmallAreaInfillFlowCompensator with 'Small Area Flow Compensation' for improved clarity and debugging. Also rethrows exceptions after logging to ensure proper error propagation.

* Remove spline library from dependencies

Eliminated the spline header-only library from the project by deleting its CMake configuration and header file, and updating documentation and build scripts to remove references to spline. This streamlines the dependencies and build process.
2025-12-30 13:34:14 +00:00
Ioannis Giannakas
0f397492e7 Fix non bambu wipe tower issues (skirt overlapping with tower, extreme travel moves outside plate boundary) (#11748)
* Fix prime/purge tower extreme travel for non BBL printers
* Fix wipe tower skirt not generating correctly for non bambu printers
2025-12-30 09:28:09 +00:00
Andrew Sun
e4d354b673 Merge remote-tracking branch 'upstream/main' into libvgcode
# Conflicts:
#	src/libslic3r/GCode/GCodeProcessor.cpp
2025-11-18 20:22:57 -05:00
Andrew Sun
6e9fbc90e7 Fix incorrect display of flow rate changes 2025-11-15 11:11:25 -05:00
Lukáš Hejl
bdbeb34158 Accumulate the total estimated print in doubles instead of floats.
Because total print time is typically a big floating point number and the time of trapezoid is typically a small number, summing those numbers leads to a loss in precision. Switching to doubles reduces the loss of precision.

(cherry picked from commit c5982f40196c178bd824c556ac11e8c6f67d5e7a)
2025-11-15 11:11:25 -05:00
Lukáš Hejl
bec883e667 SPE-2441: Fix discontinuity between the processed blocks' exit speed and the new first block's entry speed.
This discontinuity affected both time estimation and actual speed visualization.

(cherry picked from commit 90073dce70fb05bda80421158175b851855f0a8f)
2025-11-15 11:11:25 -05:00
enricoturri1966
acd3c94955 SPE-2397: Fixed order of traversing time blocks in GCodeProcessor::TimeMachine::calculate_time() to match what is done in firmware
(cherry picked from commit 9b7961ddcb824c5b18cb414ed5b975d999a24641)
2025-11-15 11:11:25 -05:00
Andrew Sun
7814605906 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
5197358183 Merge branch 'main' into dev/p2s-pr 2025-11-09 20:47:51 +08:00
Noisyfox
8f5a5a9b16 Fix extrusion rate smoothing unnecessarily slowing down the entire line (#11249)
* Fix typo & code style

* Fix calculation of the min acc time

* Avoid slowing down the entire line if both end of a single line has been slowed down
2025-11-09 12:47:50 +08:00
Noisyfox
763bdb5dee Fix gcode viewer wrong layer count when selected printer model is BBL while gcode is not 2025-11-03 23:53:12 +08:00
weizhen.xie
c93d345d2a 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
9f7ff97be6 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
xin.zhang
934f32bd8c FIX: remove some warnings
jira: [none]
Change-Id: I0e74b7316d0efe38c65e1f695b2a09eb09103552
(cherry picked from commit 766c6e004145325bcc7a6addfce27842ee9504de)
2025-10-28 15:29:56 +08:00
jiangkai.zhao
b9cd05dc86 FIX:When a smaller negative number is entered for the primer_tower_extra_rib_length, the program crashes.
jira: STUDIO-14677
Change-Id: I67477535ce2e88a2bded23959195ba9b95abf75a
(cherry picked from commit 21e01c87b678bc4f639293363591142fc9884f2d)
2025-10-28 15:29:55 +08:00
jiangkai.zhao
6923230495 Fix:path conflictcheck
Coincident lines are considered as intersecting
jira:STUDIO-14085

Change-Id: I1487e6e2479e2488a3fd55651b8b4fb1bc1f4ced
(cherry picked from commit 2348328a96a8d805c35cae8f03ebaa0869b1313e)
2025-10-28 15:29:55 +08:00
songwei.li
eafe57d8c6 ENH: TimelapsePosPicker, make timelapsePos far away from the camera
By using Manhattan distance, a penalty function is constructed by weighting the distance from the safe position to the camera and the distance from the current position, incentivizing safe positions to move away from the camera. The isometric line of the integrated Manhattan distance changes from a circle to a trapezoidal shape, with the Euclidean distance toward the camera being half that away from the camera. This ensures that when selecting a safe position, points with the same Euclidean distance from the current position receive a smaller penalty if they are farther away from the camera.

jira: none
Change-Id: I3c256cfc0c33cecade86c254613063adeac59f91
(cherry picked from commit f86ca36b471dd99d4c1bd21c4e6db3ee10eb5a6d)
2025-10-28 15:29:51 +08:00
qing.zhang
3bd9fe995b 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
Noisyfox
9e889afb53 Fix issues with non-bbl multi-head printers 2025-10-19 22:54:48 +08:00
Noisyfox
3a5a49b23d Merge branch 'main' into dev/h2d-2
# Conflicts:
#	src/slic3r/GUI/PartPlate.hpp
2025-10-14 19:43:33 +08:00
Rodrigo Faselli
ac75c69ddf BUG-FIX avoid crossing perimeters ingonore holes <=2mm (#10942)
Fix avoid crossing perimeters 2
2025-10-13 19:41:07 +08:00
Azi
6feb99bd2d bugfix for Invalid speed "G1 F-2147483648" (#10944)
added non zero safety check for feedrate calculation
2025-10-12 22:03:38 +08:00
Noisyfox
da2934d02a Revert "ENH:instead of prime_volume by filament_prime_volume"
This reverts commit e7e6405ad3.
2025-10-05 19:16:05 +08:00
zhimin.zeng
811060aabb FIX: the wipe tower should not show for printer which is not support clumping
jira: none
Change-Id: Ife535adb406224252fe8b0b3e7807a3e84752cc2
(cherry picked from commit 2f2bc935bfeb325de548e4cf867eb2d3a5d67879)
2025-10-03 23:08:56 +08:00
songwei.li
1a34765856 ENH: Improved safe position calculation for delayed photography
In the safe position calculation for time-lapse photography in traditional mode of piece-by-piece printing, for parts not currently being printed, the maximum expansion radius is used for parts higher than the current layer, and half of the expansion radius is used for parts lower than the current layer height; half of the expansion radius is used for the parts themselves. This reduces unnecessary avoidance.

jira: STUDIO-13194
Change-Id: Id6ce03af29c9ebba974ea57ec41cca757067027a
(cherry picked from commit 68c7f41900049e64d37d792503653ce5302759d8)
2025-10-03 22:19:23 +08:00
Noisyfox
a932821168 Rename wipe tower ribs related options 2025-10-02 22:56:54 +08:00
songwei.li
4e1ec6d354 FIX: Increased the tolerance of printable area detection to 2mm
In gcode processor, the result check, increased the tolerance of printable area detection to 2mm, to adaption to the requirement of command line slicing.

jira: none
Change-Id: I5be4d6396989c35ae394339376c1133c8862c075
(cherry picked from commit 2f09c98caa9d2afc3e33a0bf17c6a6bb39992e0c)
2025-10-02 18:26:40 +08:00
zhimin.zeng
6d463ed8b4 FIX: do not check wrapping area
jira: none
Change-Id: I57e5f0049825c263d4822ce5a0b6b942dc9ff0bc
(cherry picked from commit 58ef9e2f04b5952d8e25c5d734ee5d050fec9bcd)
2025-10-02 17:59:38 +08:00
songwei.li
885a078747 FIX: 0-sized path cause wrong detection of gcode_check_result
0-sized  extrusion path are now excluded from the heated bed range check to avoid false positive detection.

jira: none
Change-Id: Ia4bfff77880d107ce6b9542ef770050201ff0d90
(cherry picked from commit 00d9aedabed7e6b25767ddfe9871488f629c0dde)
2025-10-02 17:59:37 +08:00
songwei.li
120c9b41e2 FIX: erCustom check results in gcode_check_result
erCustom extrusions are now excluded from the heated bed range check to avoid initial routing issues.

jira: STUDIO-13885
Change-Id: I706a85113fe7b6f5e1a3b67f5bc16d674ad85577
(cherry picked from commit c8b4f3c778a3c1a023693b9b4961da261507ae8f)
2025-10-02 17:59:37 +08:00
shan.chang
bd066e7f96 ENH: add new arrangement features for wrapping detection area
Jira: STUDIO-13735

Change-Id: I198d19f5e6ef70f0adfa6370269290c81d21a557
(cherry picked from commit dc83637652526111611d0833d5f5798aaa3e7be7)
2025-10-02 17:41:41 +08:00
songwei.li
aa9fb1fd34 FIX: Printable area check results in gcode_check_result
Added a check for Gcode traces outside the printable area after the backend slicer, allowing command-line slicers to detect abnormal results. The GCodeProcessor's m_result.gcode_check_result.error_code now includes not only dual-head print range checks, but also checks for the machine's plate print range, wrapping detection area, and height violations.

jira: none
Change-Id: I44072ece3b4b525c77328cec2f76e205eb559cc4
(cherry picked from commit 054f936243968687f536170374a233ec912e8e42)
2025-10-02 17:07:21 +08:00
zhimin.zeng
1ccdf7b43b ENH: add wrapping detection
jira: STUDIO-13192
Change-Id: I0fb5692b18cdb3b7af624a831dcfb0f635b165f0
(cherry picked from commit 89a8b6ea5e34340cba3750416ce3100dcc39f5c2)
(cherry picked from commit 50bc8c10a7b4ddc0b2dfe9cbab438b9d307b7fc0)
2025-09-30 15:32:44 +08:00
weizhen.xie
04f0b96029 FIX:Fix the crash that occurred when importing G-code file
Jira:STUDIO-13408

(cherry picked from commit 3810f4edfe086b9500860e59baf35e5568b56977)
2025-09-30 11:02:32 +08:00
zhimin.zeng
4a3fa5141c FIX: error wipe tower gcode
jira: STUDIO-13101
Change-Id: Ic1e2aa294c290e208074a6a65d6f80c705ab7dc6
(cherry picked from commit d4deb67dda0a6a92622f0126706110518b90a8bd)
2025-09-29 23:44:50 +08:00
jiaxi.chen
9982eaa036 FIX: supports use filaments that aren't designated for this layer
jira: STUDIO-13216
Change-Id: I17272f45475eb281dfb0aa731b55363e0dde7427
(cherry picked from commit 209878dbc9d257675c8c638d141cebfc9858ed71)
2025-09-29 20:43:07 +08:00