SoftFever 91ad6954ea Faster slicing of layers cut into many pieces (#15985)
# Description

Slicing performance work, split out of #14662 so it can be reviewed on
its own. No new features and no behaviour change: the same G-code,
produced faster. Nothing here knows about texture displacement.

The trigger was a plate that took about 24 min to slice at 0.1 mm once a
colour texture was baked onto it. The cause is general, not
texture-specific: ClipperLib's sweep line costs grow with the number of
edges crossing a scan line, and any layer cut into tens of thousands of
small pieces (fine relief, dense colour painting, heavily fragmented
models) makes several per-piece loops redo whole-layer work.

## What changed

**Restrict whole-layer work to the neighbourhood that needs it**
- `make_fills`: clip the layer's no-overlap area to each expolygon's box
before intersecting.
- `discover_vertical_shells`: the small-piece filter compares only
against the nearby part of the layer.
- `bridge_over_infill`: whole-layer union/diff/intersection restricted
to the candidate's neighbourhood; fill boundary expanded once per
spacing; anchor tree built only from lines crossing the scan range; bbox
pre-check in the collision test.

**Batch booleans by tile instead of per piece.**
`ClipperUtils::tile_expolygons` groups a layer's pieces into tiles, so a
huge clip contour is clipped once per tile rather than once per piece.
`detect_surfaces_type` at 0.1 mm went from about 145 s to about 50 s.

**Parallelize what is already independent:** a layer's regions in
`detect_surfaces_type`, `process_external_surfaces` and
`discover_vertical_shells`; wall generation and solid infill splitting;
colour segmentation and vertical shells.

**Stop copying polygons on move.** `MultiPoint` had no `Points &&`
constructor, so every derived move constructor passing
`std::move(points)` copied them. Added it, marked the moves `noexcept`,
and made `append(vector&&)` move its elements. Note the consequence: a
moved-from `Polygon` or `Polyline` is now really empty where it used to
silently keep its points.

**Seam placement.** `visit_nearby_points` visits candidates as the k-d
tree finds them instead of collecting them into a vector first.

**Travel ordering and sharp-tail detection** test only the pairs whose
boxes can meet, through a uniform grid and a bbox pre-filter, instead of
every pair.

## Results

| | before | after |
|---|---|---|
| Painted plate, 0.1 mm, 2000k triangles | 1447 s | 587 s |
| Same plate, default 750k | 99.5 s | 85.6 s |
| Unpainted, 0.1 mm | 523 s | 430 s |

## Tests

**179 of 179 G-code outputs byte-identical** across 11 models and 17
configurations (default, fine layers, zero and dense infill, no shells,
normal and tree supports, extra bridge layers, interface shells, three
`ensure_vertical_shell_thickness` modes, thick walls, spiral mode, five
seam modes), comparing full library builds of this branch against its
merge base. The painted plate is part of that matrix, and it is the case
whose layers reach the tiling threshold at all.

New unit tests:
- `test_kdtree.cpp`: the visiting and collecting searches return the
same points in the same order, and a radius search returns exactly the
points inside the radius.
- `test_clipper_utils.cpp`: the tiled and plain `diff_ex` and
`intersection_ex` return the same rings with the same coordinates, with
and without the safety offset, compared after rotating each ring to its
lowest point and sorting. The fixture asserts it really is split into
more than one tile, so it cannot quietly stop covering the tiled path.
2026-10-21 12:31:43 +08:00
2024-12-12 22:21:17 +08:00
2025-08-22 20:02:26 +08:00
2026-09-29 12:49:54 +08:00
2023-08-20 20:02:54 +08:00
2026-07-19 00:33:53 +08:00

OrcaSlicer logo

OrcaSlicer%2FOrcaSlicer | Trendshift

GitHub Repo stars Build all

OrcaSlicer: an open source Next-Gen Slicing Software for Precision 3D Prints.
Optimize your prints with ultra-fast slicing, intelligent support generation, and seamless printer compatibility—engineered for perfection.

Official links and community

Official Website:

OrcaSlicer.com

Github Repository:

GitHub Logo

Follow us:

X Logo
YouTube Logo

Join our Discord community:

discord logo

⚠️ CAUTION:
Several clickbait and malicious websites, such as orca-slicer[.]com and orcaslicer[.]net, are pretending to be the official OrcaSlicer site. These sites may redirect you to dangerous downloads or contain misleading information.
Our only official website is www.orcaslicer.com.

If you come across any of these in search results, please report them as unsafe or phishing to help keep the community secure with:
- Google Safe Browsing
- Microsoft Security Intelligence
- IPThreat

Main features

Wiki

The wiki aims to provide a detailed explanation of the slicer settings, including how to maximize their use and how to calibrate and set up your printer.

Download

Stable Release

📥 Download the Latest Stable Release
Visit our GitHub Releases page for the latest stable version of OrcaSlicer, recommended for most users.
Windows release binaries are code signed; see our Code signing policy.

Nightly Builds

🌙 Download the Latest Nightly Build
Explore the latest developments in OrcaSlicer with our nightly builds. Feedback on these versions is highly appreciated.

How to install

Windows

Download the Windows Installer exe for your preferred version from the releases page. Both x64 and arm64 installers are published — pick the one matching your CPU.

Microsoft Store

Install from the Microsoft Store when you prefer a Store-signed package (helps on Windows 11 Smart App Control).

Windows Package Manager

winget install --id=SoftFever.OrcaSlicer -e

Mac

  1. Download the universal DMG, which runs on both Apple Silicon and Intel Macs.

  2. Drag OrcaSlicer.app to Application folder.

  3. If you want to run a build from a PR, you also need to follow the instructions below:

    Quarantine
    • Option 1 (You only need to do this once. After that the app can be opened normally.):

      • Step 1: Hold cmd and right click the app, from the context menu choose Open.
      • Step 2: A warning window will pop up, click Open
    • Option 2: Execute this command in terminal:

      xattr -dr com.apple.quarantine /Applications/OrcaSlicer.app
      
    • Option 3:

      • Step 1: open the app, a warning window will pop up
        mac_cant_open
      • Step 2: in System Settings -> Privacy & Security, click Open Anyway:
        mac_security_setting

Homebrew Cask

brew install --cask orcaslicer

The Homebrew cask installs the official macOS DMG from GitHub Releases.

Linux

OrcaSlicer is available through FlatHub:

Download on Flathub

Install from the command line:

flatpak install flathub com.orcaslicer.OrcaSlicer
flatpak run com.orcaslicer.OrcaSlicer

It can also be installed through graphical software managers (KDE Discover, GNOME Software, etc.) when Flathub is enabled. Search for OrcaSlicer in your software center.

AppImage

AppImages are published for both x86_64 and aarch64 (ARM64). Pick the file matching your CPU — the ARM64 build has aarch64 in its name (e.g. OrcaSlicer_Linux_AppImage_Ubuntu2404_aarch64_*.AppImage).

  1. Download App image from the releases page.

  2. Double click the downloaded file to run it.

  3. If you run into trouble executing it, try this command in the terminal: chmod +x /path_to_appimage/OrcaSlicer_Linux.AppImage

How to Compile

All updated build instructions for Windows, macOS, and Linux are now available on the official OrcaSlicer Wiki - How to build page.

Please refer to the wiki to ensure you're following the latest and most accurate steps for your platform.

Klipper Note

If you're running Klipper, it's recommended to add the following configuration to your printer.cfg file.

# Enable object exclusion
[exclude_object]

# Enable arcs support
[gcode_arcs]
resolution: 0.1

Supports

OrcaSlicer is an open-source project, and we're deeply grateful to all our sponsors and backers.
Their generous support helps fund filaments and other essential 3D printing materials for the project.
Thank you! :)

Sponsors

QIDI BIGTREE TECH

Backers:

Ko-fi supporters ☕: Backers list

Support the project



Some Background

Open-source slicing has always been built on a tradition of collaboration and attribution. Slic3r, created by Alessandro Ranellucci and the RepRap community, laid the foundation. PrusaSlicer by Prusa Research built on Slic3r and acknowledged that heritage. Bambu Studio in turn forked from PrusaSlicer, and SuperSlicer by @supermerill extended PrusaSlicer with community-driven enhancements. Each project carried the work of its predecessors forward, crediting those who came before.

OrcaSlicer began in that same spirit, drawing from BambuStudio, PrusaSlicer, and ideas inspired by CuraSlicer and SuperSlicer. But it has since grown far beyond its origins. Through relentless innovation — introducing advanced calibration tools, precise wall and seam control, tree supports, adaptive slicing, and hundreds of other features — OrcaSlicer has become the most widely used and actively developed open-source slicer in the 3D printing community. Many of its innovations have been adopted by other slicers, making it a driving force for the entire industry.

The OrcaSlicer logo was designed by community member Justin Levine.

Code Signing Policy

Free code signing provided by SignPath.io, certificate by SignPath Foundation.

Windows release binaries are built by GitHub Actions from this repository and signed through the SignPath Foundation program. Every signing request is manually approved.

Team roles: SoftFever is the committer, reviewer and approver for all signed releases.

Privacy policy: See the OrcaSlicer privacy policy.

License

  • OrcaSlicer is licensed under the GNU Affero General Public License, version 3.
  • The GNU Affero General Public License, version 3 ensures that if you use any part of this software in any way (even behind a web server), your software must be released under the same license.
  • OrcaSlicer includes a pressure advance calibration pattern test adapted from Andrew Ellis' generator, which is licensed under GNU General Public License, version 3. Ellis' generator is itself adapted from a generator developed by Sineos for Marlin, which is licensed under GNU General Public License, version 3.
  • The Bambu networking plugin is based on non-free libraries from BambuLab. It is optional to the OrcaSlicer and provides extended functionalities for Bambulab printer users.
Languages
C++ 85.7%
C 8.3%
Python 1.7%
HTML 1.4%
JavaScript 0.9%
Other 1.7%