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.
This commit is contained in:
Matthias Nott
2026-02-09 20:38:46 +01:00
parent 2317ba7e28
commit 6250fab6a4
57 changed files with 1817 additions and 204 deletions

View File

@@ -1,5 +1,7 @@
#include "MainFrame.hpp"
#include <boost/filesystem/directory.hpp>
#include <boost/filesystem/operations.hpp>
#include <wx/panel.h>
#include <wx/notebook.h>
#include <wx/listbook.h>
@@ -23,6 +25,7 @@
#include "libslic3r/PrintConfig.hpp"
#include "libslic3r/SLAPrint.hpp"
#include "libslic3r/PresetBundle.hpp"
#include "libslic3r/Utils.hpp"
#include "Tab.hpp"
#include "ProgressStatusBar.hpp"
@@ -2451,6 +2454,17 @@ void MainFrame::init_menubar_as_editor()
open_recent_project(file_id, filename);
}, wxID_FILE1, wxID_FILE1 + 49); // [5050, 5100)
std::vector<std::string> non_planar_projects;
for (auto &&entry : fs::directory_iterator(resources_dir() + "/nonplanar")) {
if (fs::is_regular_file(entry) && entry.path().extension() == ".3mf") {
non_planar_projects.push_back(entry.path().string());
}
}
std::sort(non_planar_projects.begin(), non_planar_projects.end());
for (auto &&path : non_planar_projects) {
m_recent_projects.AddFileToHistory(from_u8(path));
}
std::vector<std::string> recent_projects = wxGetApp().app_config->get_recent_projects();
std::reverse(recent_projects.begin(), recent_projects.end());
for (const std::string& project : recent_projects)