Design tab: move the CAD sources into their own folder

Review request on PR #15238: "Place CAD-related files (e.g. CadDocument/
GeometryEngine) into a separate folder."

  src/libslic3r/CAD/     the kernel — CadDocument, GeometryEngine, the four
                         Sketch* units, SketchSolver, ThreadStandards
  src/slic3r/GUI/CAD/    the tab — DesignPanel, DesignCanvas, DesignSketchTool,
                         SketchInlineEditor, McpControl, generated DesignOffer

Pure relocation: no line of logic changes. Two include rewrites follow from it —
files that moved re-spell their own neighbours against src/ (already on the
include path), and files that did not move pick up the new folder. docs and
docs/ux/mockups/gen_offer_table.py follow the same paths.

Verified: libslic3r, libslic3r_gui and libslic3r_tests all build, CAD suite green
at 2518 assertions in 194 test cases, and the sibling fork builds identically —
17 shared sources still byte-identical, 8 diverging by their expected counts.
This commit is contained in:
Tommaso Bianchi
2026-08-20 17:44:34 +02:00
parent 5d120921d5
commit 2b02a8e3dd
44 changed files with 135 additions and 135 deletions
@@ -1,7 +1,7 @@
#include "CadDocument.hpp"
#include "SketchConstraints.hpp"
#include "SketchSolver.hpp"
#include "SketchImport.hpp" // transform_regions for imported art
#include "libslic3r/CAD/CadDocument.hpp"
#include "libslic3r/CAD/SketchConstraints.hpp"
#include "libslic3r/CAD/SketchSolver.hpp"
#include "libslic3r/CAD/SketchImport.hpp" // transform_regions for imported art
#include <array>
@@ -1,10 +1,10 @@
#ifndef slic3r_CadDocument_hpp_
#define slic3r_CadDocument_hpp_
#include "TriangleMesh.hpp"
#include "SketchEngine.hpp"
#include "GeometryEngine.hpp" // FaceGroup
#include "Color.hpp" // ColorRGBA (per-body display colour override)
#include "libslic3r/TriangleMesh.hpp"
#include "libslic3r/CAD/SketchEngine.hpp"
#include "libslic3r/CAD/GeometryEngine.hpp" // FaceGroup
#include "libslic3r/Color.hpp" // ColorRGBA (per-body display colour override)
#include <TopoDS_Shape.hxx>
#include <TopoDS_Wire.hxx>
@@ -1,4 +1,4 @@
#include "GeometryEngine.hpp"
#include "libslic3r/CAD/GeometryEngine.hpp"
#include <BRepMesh_IncrementalMesh.hxx>
#include <BRep_Tool.hxx>
@@ -1,7 +1,7 @@
#ifndef slic3r_GeometryEngine_hpp_
#define slic3r_GeometryEngine_hpp_
#include "TriangleMesh.hpp"
#include "libslic3r/TriangleMesh.hpp"
#include <BRepPrimAPI_MakeBox.hxx>
#include <BRepPrimAPI_MakeCylinder.hxx>
@@ -1,4 +1,4 @@
#include "SketchConstraints.hpp"
#include "libslic3r/CAD/SketchConstraints.hpp"
#include <Eigen/Dense>
#include <cmath>
@@ -1,4 +1,4 @@
#include "SketchEngine.hpp"
#include "libslic3r/CAD/SketchEngine.hpp"
#include <algorithm>
#include <cmath>
@@ -1,9 +1,9 @@
#ifndef slic3r_SketchEngine_hpp_
#define slic3r_SketchEngine_hpp_
#include "TriangleMesh.hpp"
#include "libslic3r/TriangleMesh.hpp"
#include "libslic3r/Point.hpp"
#include "GeometryEngine.hpp"
#include "libslic3r/CAD/GeometryEngine.hpp"
#include <gp_Pln.hxx>
#include <gp_Ax3.hxx>
@@ -1,11 +1,11 @@
#include "SketchImport.hpp"
#include "libslic3r/CAD/SketchImport.hpp"
#include "Emboss.hpp"
#include "NSVGUtils.hpp"
#include "ExPolygon.hpp"
#include "TextConfiguration.hpp" // FontProp
#include "libslic3r.h" // SCALING_FACTOR
#include "Utils.hpp" // resources_dir
#include "libslic3r/Emboss.hpp"
#include "libslic3r/NSVGUtils.hpp"
#include "libslic3r/ExPolygon.hpp"
#include "libslic3r/TextConfiguration.hpp" // FontProp
#include "libslic3r/libslic3r.h" // SCALING_FACTOR
#include "libslic3r/Utils.hpp" // resources_dir
#include <algorithm>
#include <limits>
@@ -1,7 +1,7 @@
#ifndef slic3r_SketchImport_hpp_
#define slic3r_SketchImport_hpp_
#include "Point.hpp" // Vec2d
#include "libslic3r/Point.hpp" // Vec2d
#include <string>
#include <vector>
@@ -1,4 +1,4 @@
#include "SketchInference.hpp"
#include "libslic3r/CAD/SketchInference.hpp"
#include <cmath>
@@ -1,7 +1,7 @@
#ifndef slic3r_SketchInference_hpp_
#define slic3r_SketchInference_hpp_
#include "SketchEngine.hpp"
#include "libslic3r/CAD/SketchEngine.hpp"
#include <vector>
#include <optional>
#include <cmath>
@@ -1,4 +1,4 @@
#include "SketchSolver.hpp"
#include "libslic3r/CAD/SketchSolver.hpp"
#include <slvs.h>
@@ -6,7 +6,7 @@
// hand-rolled SketchConstraints: full constraint set, real DoF counting, and
// over-constrained (bad-constraint) detection. Solves on a fixed 2D XY workplane.
#include "SketchEngine.hpp"
#include "libslic3r/CAD/SketchEngine.hpp"
#include <vector>
namespace Slic3r {
@@ -1,4 +1,4 @@
#include "ThreadStandards.hpp"
#include "libslic3r/CAD/ThreadStandards.hpp"
namespace Slic3r {
+16 -16
View File
@@ -489,22 +489,22 @@ set(lisbslic3r_sources
# vendored SolveSpace solver; both are pulled in only when SLIC3R_CAD is ON.
if (SLIC3R_CAD)
list(APPEND lisbslic3r_sources
GeometryEngine.cpp
GeometryEngine.hpp
SketchEngine.cpp
SketchEngine.hpp
SketchConstraints.cpp
SketchConstraints.hpp
SketchSolver.cpp
SketchSolver.hpp
SketchInference.cpp
SketchInference.hpp
SketchImport.cpp
SketchImport.hpp
CadDocument.cpp
CadDocument.hpp
ThreadStandards.cpp
ThreadStandards.hpp
CAD/GeometryEngine.cpp
CAD/GeometryEngine.hpp
CAD/SketchEngine.cpp
CAD/SketchEngine.hpp
CAD/SketchConstraints.cpp
CAD/SketchConstraints.hpp
CAD/SketchSolver.cpp
CAD/SketchSolver.hpp
CAD/SketchInference.cpp
CAD/SketchInference.hpp
CAD/SketchImport.cpp
CAD/SketchImport.hpp
CAD/CadDocument.cpp
CAD/CadDocument.hpp
CAD/ThreadStandards.cpp
CAD/ThreadStandards.hpp
)
endif ()
+9 -9
View File
@@ -763,15 +763,15 @@ set(SLIC3R_GUI_SOURCES
# All of it sits behind SLIC3R_CAD and links the CAD kernel in libslic3r.
if (SLIC3R_CAD)
list(APPEND SLIC3R_GUI_SOURCES
GUI/DesignPanel.cpp
GUI/DesignPanel.hpp
GUI/DesignCanvas.cpp
GUI/DesignCanvas.hpp
GUI/DesignSketchTool.cpp
GUI/SketchInlineEditor.cpp
GUI/SketchInlineEditor.hpp
GUI/McpControl.cpp
GUI/McpControl.hpp
GUI/CAD/DesignPanel.cpp
GUI/CAD/DesignPanel.hpp
GUI/CAD/DesignCanvas.cpp
GUI/CAD/DesignCanvas.hpp
GUI/CAD/DesignSketchTool.cpp
GUI/CAD/SketchInlineEditor.cpp
GUI/CAD/SketchInlineEditor.hpp
GUI/CAD/McpControl.cpp
GUI/CAD/McpControl.hpp
GUI/Gizmos/GLGizmoSketch.cpp
GUI/Gizmos/GLGizmoSketch.hpp
# Needs GeometryEngine (make_primitive / apply_fillet / tessellate).
@@ -1,15 +1,15 @@
#include "DesignCanvas.hpp"
#include "slic3r/GUI/CAD/DesignCanvas.hpp"
#include "SketchInlineEditor.hpp"
#include "GLCanvas3D.hpp"
#include "OpenGLManager.hpp"
#include "3DBed.hpp"
#include "GUI_App.hpp"
#include "Plater.hpp"
#include "slic3r/GUI/CAD/SketchInlineEditor.hpp"
#include "slic3r/GUI/GLCanvas3D.hpp"
#include "slic3r/GUI/OpenGLManager.hpp"
#include "slic3r/GUI/3DBed.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/Plater.hpp"
#include "libslic3r/Model.hpp"
#include "libslic3r/TriangleMesh.hpp"
#include "3DScene.hpp"
#include "MeshUtils.hpp" // ClippingPlane (section view)
#include "slic3r/GUI/3DScene.hpp"
#include "slic3r/GUI/MeshUtils.hpp" // ClippingPlane (section view)
#include "libslic3r/Config.hpp"
#include <boost/algorithm/string/predicate.hpp>
#include <algorithm>
@@ -8,10 +8,10 @@
#include <memory>
#include <string>
#include "3DBed.hpp"
#include "slic3r/GUI/3DBed.hpp"
#include "libslic3r/Model.hpp"
#include "libslic3r/SketchEngine.hpp"
#include "DesignSketchTool.hpp"
#include "libslic3r/CAD/SketchEngine.hpp"
#include "slic3r/GUI/CAD/DesignSketchTool.hpp"
class wxGLCanvas;
class wxFrame;
@@ -1,8 +1,8 @@
#include "DesignPanel.hpp"
#include "DesignCanvas.hpp"
#include "DesignSketchTool.hpp"
#include "DesignOffer.hpp" // generated offer table — see docs/ux/tool_atlas.json
#include "libslic3r/GeometryEngine.hpp" // face_by_index for face-extrude gizmo anchor
#include "slic3r/GUI/CAD/DesignPanel.hpp"
#include "slic3r/GUI/CAD/DesignCanvas.hpp"
#include "slic3r/GUI/CAD/DesignSketchTool.hpp"
#include "slic3r/GUI/CAD/DesignOffer.hpp" // generated offer table — see docs/ux/tool_atlas.json
#include "libslic3r/CAD/GeometryEngine.hpp" // face_by_index for face-extrude gizmo anchor
#include "libslic3r/TriangleMesh.hpp" // mesh import: STL/OBJ -> indexed_triangle_set
#include "libslic3r/Format/OBJ.hpp"
@@ -45,14 +45,14 @@
#include <atomic>
#include "slic3r/GUI/wxExtensions.hpp" // ScalableButton, create_scaled_bitmap
#include "Widgets/Label.hpp" // HarmonyOS Sans fonts (Head_*/Body_*) shared with the rest of Orca
#include "Widgets/DropDown.hpp" // Orca-themed combo dropdown (white/teal selector) for the tool flyouts
#include "Widgets/Button.hpp" // Orca-styled Button (ButtonStyle/ButtonType) — same look as Prepare
#include "Widgets/CheckBox.hpp" // Orca teal check (label lives in the row's left column)
#include "Widgets/ComboBox.hpp" // Orca dropdown — replaces wxChoice in every Design card
#include "Widgets/StaticBox.hpp" // Prepare's rounded white card frame around each tool dialog
#include "libslic3r/SketchImport.hpp" // text_to_regions / svg_to_regions
#include "libslic3r/ThreadStandards.hpp" // ISO metric / Unified imperial thread tables
#include "slic3r/GUI/Widgets/Label.hpp" // HarmonyOS Sans fonts (Head_*/Body_*) shared with the rest of Orca
#include "slic3r/GUI/Widgets/DropDown.hpp" // Orca-themed combo dropdown (white/teal selector) for the tool flyouts
#include "slic3r/GUI/Widgets/Button.hpp" // Orca-styled Button (ButtonStyle/ButtonType) — same look as Prepare
#include "slic3r/GUI/Widgets/CheckBox.hpp" // Orca teal check (label lives in the row's left column)
#include "slic3r/GUI/Widgets/ComboBox.hpp" // Orca dropdown — replaces wxChoice in every Design card
#include "slic3r/GUI/Widgets/StaticBox.hpp" // Prepare's rounded white card frame around each tool dialog
#include "libslic3r/CAD/SketchImport.hpp" // text_to_regions / svg_to_regions
#include "libslic3r/CAD/ThreadStandards.hpp" // ISO metric / Unified imperial thread tables
#include "libslic3r/Model.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/Plater.hpp"
@@ -10,7 +10,7 @@
#include <functional>
#include <map>
#include "libslic3r/CadDocument.hpp"
#include "libslic3r/CAD/CadDocument.hpp"
class ComboBox; // Orca dropdown (Widgets/ComboBox.hpp) — replaces wxChoice everywhere here
class StaticBox; // Orca rounded card frame (Widgets/StaticBox.hpp)
@@ -1,16 +1,16 @@
#include "DesignSketchTool.hpp"
#include "GLCanvas3D.hpp"
#include "GUI_App.hpp"
#include "ImGuiWrapper.hpp"
#include "Plater.hpp"
#include "slic3r/GUI/CAD/DesignSketchTool.hpp"
#include "slic3r/GUI/GLCanvas3D.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/ImGuiWrapper.hpp"
#include "slic3r/GUI/Plater.hpp"
#include <imgui/imgui.h>
#include <imgui/imgui_internal.h>
#include "libslic3r/BuildVolume.hpp"
#include "Camera.hpp"
#include "3DScene.hpp"
#include "GLShader.hpp"
#include "libslic3r/GeometryEngine.hpp"
#include "slic3r/GUI/Camera.hpp"
#include "slic3r/GUI/3DScene.hpp"
#include "slic3r/GUI/GLShader.hpp"
#include "libslic3r/CAD/GeometryEngine.hpp"
#include "libslic3r/TriangleMesh.hpp"
#include <GL/glew.h>
@@ -2,12 +2,12 @@
#define slic3r_DesignSketchTool_hpp_
#include "libslic3r/Point.hpp"
#include "libslic3r/SketchEngine.hpp"
#include "libslic3r/CadDocument.hpp" // CadBody for per-body solid picking
#include "libslic3r/SketchInference.hpp"
#include "libslic3r/SketchSolver.hpp"
#include "GLModel.hpp"
#include "GLSelectionRectangle.hpp" // left-drag rubber band over the committed bodies
#include "libslic3r/CAD/SketchEngine.hpp"
#include "libslic3r/CAD/CadDocument.hpp" // CadBody for per-body solid picking
#include "libslic3r/CAD/SketchInference.hpp"
#include "libslic3r/CAD/SketchSolver.hpp"
#include "slic3r/GUI/GLModel.hpp"
#include "slic3r/GUI/GLSelectionRectangle.hpp" // left-drag rubber band over the committed bodies
#include <functional>
#include <vector>
#include <string>
@@ -1,4 +1,4 @@
#include "McpControl.hpp"
#include "slic3r/GUI/CAD/McpControl.hpp"
#ifndef _WIN32 // POSIX Unix-domain-socket transport only (slice 1)
@@ -21,13 +21,13 @@
#include <boost/log/trivial.hpp>
#include <Standard_Failure.hxx> // OCCT base error (not a std::exception)
#include "GUI_App.hpp"
#include "MainFrame.hpp"
#include "DesignPanel.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/MainFrame.hpp"
#include "slic3r/GUI/CAD/DesignPanel.hpp"
#include "libslic3r/CadDocument.hpp"
#include "libslic3r/SketchEngine.hpp"
#include "libslic3r/GeometryEngine.hpp"
#include "libslic3r/CAD/CadDocument.hpp"
#include "libslic3r/CAD/SketchEngine.hpp"
#include "libslic3r/CAD/GeometryEngine.hpp"
#include "libslic3r/TriangleMesh.hpp"
#include "libslic3r/Format/OBJ.hpp"
#include <boost/algorithm/string/case_conv.hpp>
@@ -1,4 +1,4 @@
#include "SketchInlineEditor.hpp"
#include "slic3r/GUI/CAD/SketchInlineEditor.hpp"
#include <wx/display.h>
+1 -1
View File
@@ -1,7 +1,7 @@
#include "libslic3r/libslic3r.h"
#include "GLCanvas3D.hpp"
#ifdef SLIC3R_CAD
#include "DesignSketchTool.hpp" // SnapOrca Design: interactive 2D sketch tool
#include "slic3r/GUI/CAD/DesignSketchTool.hpp" // SnapOrca Design: interactive 2D sketch tool
#endif
#include <igl/unproject.h>
+1 -1
View File
@@ -3,7 +3,7 @@
#include "GLGizmoBase.hpp"
#include "GLGizmosCommon.hpp"
#include "libslic3r/GeometryEngine.hpp"
#include "libslic3r/CAD/GeometryEngine.hpp"
namespace Slic3r {
namespace GUI {
+1 -1
View File
@@ -3,7 +3,7 @@
#include "GLGizmoBase.hpp"
#include "GLGizmosCommon.hpp"
#include "libslic3r/SketchEngine.hpp"
#include "libslic3r/CAD/SketchEngine.hpp"
#include <imgui/imgui.h>
namespace Slic3r {
+2 -2
View File
@@ -38,8 +38,8 @@
#include "GLCanvas3D.hpp"
#include "Plater.hpp"
#ifdef SLIC3R_CAD
#include "DesignPanel.hpp"
#include "McpControl.hpp"
#include "slic3r/GUI/CAD/DesignPanel.hpp"
#include "slic3r/GUI/CAD/McpControl.hpp"
#endif
#include "WebViewDialog.hpp"
#include "../Utils/Process.hpp"