From 2b02a8e3dd84af9f4c2e468067e347d11643ffc3 Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Thu, 20 Aug 2026 17:44:34 +0200 Subject: [PATCH] Design tab: move the CAD sources into their own folder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- docs/GAP_ANALYSIS_vs_ONSHAPE.md | 8 ++--- docs/design_tab.md | 14 ++++---- docs/design_tab_pr_description.md | 2 +- docs/ux/mockups/gen_offer_table.py | 4 +-- docs/ux/tool_atlas.json | 8 ++--- src/libslic3r/{ => CAD}/CadDocument.cpp | 8 ++--- src/libslic3r/{ => CAD}/CadDocument.hpp | 8 ++--- src/libslic3r/{ => CAD}/GeometryEngine.cpp | 2 +- src/libslic3r/{ => CAD}/GeometryEngine.hpp | 2 +- src/libslic3r/{ => CAD}/SketchConstraints.cpp | 2 +- src/libslic3r/{ => CAD}/SketchConstraints.hpp | 0 src/libslic3r/{ => CAD}/SketchEngine.cpp | 2 +- src/libslic3r/{ => CAD}/SketchEngine.hpp | 4 +-- src/libslic3r/{ => CAD}/SketchImport.cpp | 14 ++++---- src/libslic3r/{ => CAD}/SketchImport.hpp | 2 +- src/libslic3r/{ => CAD}/SketchInference.cpp | 2 +- src/libslic3r/{ => CAD}/SketchInference.hpp | 2 +- src/libslic3r/{ => CAD}/SketchSolver.cpp | 2 +- src/libslic3r/{ => CAD}/SketchSolver.hpp | 2 +- src/libslic3r/{ => CAD}/ThreadStandards.cpp | 2 +- src/libslic3r/{ => CAD}/ThreadStandards.hpp | 0 src/libslic3r/CMakeLists.txt | 32 +++++++++---------- src/slic3r/CMakeLists.txt | 18 +++++------ src/slic3r/GUI/{ => CAD}/DesignCanvas.cpp | 18 +++++------ src/slic3r/GUI/{ => CAD}/DesignCanvas.hpp | 6 ++-- src/slic3r/GUI/{ => CAD}/DesignOffer.hpp | 0 src/slic3r/GUI/{ => CAD}/DesignPanel.cpp | 26 +++++++-------- src/slic3r/GUI/{ => CAD}/DesignPanel.hpp | 2 +- src/slic3r/GUI/{ => CAD}/DesignSketchTool.cpp | 18 +++++------ src/slic3r/GUI/{ => CAD}/DesignSketchTool.hpp | 12 +++---- src/slic3r/GUI/{ => CAD}/McpControl.cpp | 14 ++++---- src/slic3r/GUI/{ => CAD}/McpControl.hpp | 0 .../GUI/{ => CAD}/SketchInlineEditor.cpp | 2 +- .../GUI/{ => CAD}/SketchInlineEditor.hpp | 0 src/slic3r/GUI/GLCanvas3D.cpp | 2 +- src/slic3r/GUI/Gizmos/GLGizmoPrimitive.hpp | 2 +- src/slic3r/GUI/Gizmos/GLGizmoSketch.hpp | 2 +- src/slic3r/GUI/MainFrame.cpp | 4 +-- tests/libslic3r/test_caddocument.cpp | 10 +++--- tests/libslic3r/test_sketchconstraints.cpp | 2 +- tests/libslic3r/test_sketchedit.cpp | 2 +- tests/libslic3r/test_sketchimport.cpp | 2 +- tests/libslic3r/test_sketchinference.cpp | 2 +- tests/libslic3r/test_slvs_constraints.cpp | 4 +-- 44 files changed, 135 insertions(+), 135 deletions(-) rename src/libslic3r/{ => CAD}/CadDocument.cpp (99%) rename src/libslic3r/{ => CAD}/CadDocument.hpp (99%) rename src/libslic3r/{ => CAD}/GeometryEngine.cpp (99%) rename src/libslic3r/{ => CAD}/GeometryEngine.hpp (99%) rename src/libslic3r/{ => CAD}/SketchConstraints.cpp (99%) rename src/libslic3r/{ => CAD}/SketchConstraints.hpp (100%) rename src/libslic3r/{ => CAD}/SketchEngine.cpp (99%) rename src/libslic3r/{ => CAD}/SketchEngine.hpp (99%) rename src/libslic3r/{ => CAD}/SketchImport.cpp (93%) rename src/libslic3r/{ => CAD}/SketchImport.hpp (97%) rename src/libslic3r/{ => CAD}/SketchInference.cpp (99%) rename src/libslic3r/{ => CAD}/SketchInference.hpp (98%) rename src/libslic3r/{ => CAD}/SketchSolver.cpp (99%) rename src/libslic3r/{ => CAD}/SketchSolver.hpp (97%) rename src/libslic3r/{ => CAD}/ThreadStandards.cpp (98%) rename src/libslic3r/{ => CAD}/ThreadStandards.hpp (100%) rename src/slic3r/GUI/{ => CAD}/DesignCanvas.cpp (99%) rename src/slic3r/GUI/{ => CAD}/DesignCanvas.hpp (99%) rename src/slic3r/GUI/{ => CAD}/DesignOffer.hpp (100%) rename src/slic3r/GUI/{ => CAD}/DesignPanel.cpp (99%) rename src/slic3r/GUI/{ => CAD}/DesignPanel.hpp (99%) rename src/slic3r/GUI/{ => CAD}/DesignSketchTool.cpp (99%) rename src/slic3r/GUI/{ => CAD}/DesignSketchTool.hpp (99%) rename src/slic3r/GUI/{ => CAD}/McpControl.cpp (99%) rename src/slic3r/GUI/{ => CAD}/McpControl.hpp (100%) rename src/slic3r/GUI/{ => CAD}/SketchInlineEditor.cpp (99%) rename src/slic3r/GUI/{ => CAD}/SketchInlineEditor.hpp (100%) diff --git a/docs/GAP_ANALYSIS_vs_ONSHAPE.md b/docs/GAP_ANALYSIS_vs_ONSHAPE.md index 07c6a212e1..05b8351c34 100644 --- a/docs/GAP_ANALYSIS_vs_ONSHAPE.md +++ b/docs/GAP_ANALYSIS_vs_ONSHAPE.md @@ -1,10 +1,10 @@ # SnapOrca-CAD vs Onshape — capability gap analysis Generated 2026-07-22 by enumerating the source, not from recollection: -`CadFeatureType` and `add_*` in `src/libslic3r/CadDocument.hpp`, `Tool` in -`src/slic3r/GUI/DesignPanel.hpp`, `Mode` in `src/slic3r/GUI/DesignSketchTool.hpp`, -`SketchConstraintType` + `SketchEntity::Type` in `src/libslic3r/SketchEngine.hpp`, -and the JSON-RPC dispatch in `src/slic3r/GUI/McpControl.cpp`. +`CadFeatureType` and `add_*` in `src/libslic3r/CAD/CadDocument.hpp`, `Tool` in +`src/slic3r/GUI/CAD/DesignPanel.hpp`, `Mode` in `src/slic3r/GUI/CAD/DesignSketchTool.hpp`, +`SketchConstraintType` + `SketchEntity::Type` in `src/libslic3r/CAD/SketchEngine.hpp`, +and the JSON-RPC dispatch in `src/slic3r/GUI/CAD/McpControl.cpp`. **Scope note.** Onshape is a cloud PLM platform; SnapOrca is a Design tab inside a slicer. A large share of Onshape's surface (release management, branching, real-time diff --git a/docs/design_tab.md b/docs/design_tab.md index 9c65df332b..1be0a2ea33 100644 --- a/docs/design_tab.md +++ b/docs/design_tab.md @@ -320,14 +320,14 @@ Being straight about the edges, so nobody discovers them the hard way: | Path | Role | |---|---| -| `src/libslic3r/CadDocument.*` | the feature recipe and its replay | -| `src/libslic3r/GeometryEngine.*` | OCCT wrapper — faces, edges, booleans, healing | -| `src/libslic3r/SketchEngine.*` | profile → wire → solid | -| `src/libslic3r/SketchSolver.*` | constraint solving, over the vendored solver | +| `src/libslic3r/CAD/CadDocument.*` | the feature recipe and its replay | +| `src/libslic3r/CAD/GeometryEngine.*` | OCCT wrapper — faces, edges, booleans, healing | +| `src/libslic3r/CAD/SketchEngine.*` | profile → wire → solid | +| `src/libslic3r/CAD/SketchSolver.*` | constraint solving, over the vendored solver | | `src/libslic3r/slvs/` | vendored 2D constraint solver (GPLv3) | -| `src/slic3r/GUI/DesignPanel.*` | the tab: toolbar, cards, feature tree | -| `src/slic3r/GUI/DesignCanvas.*` | viewport integration | -| `src/slic3r/GUI/DesignSketchTool.*` | in-canvas sketching | +| `src/slic3r/GUI/CAD/DesignPanel.*` | the tab: toolbar, cards, feature tree | +| `src/slic3r/GUI/CAD/DesignCanvas.*` | viewport integration | +| `src/slic3r/GUI/CAD/DesignSketchTool.*` | in-canvas sketching | Build with `-DSLIC3R_CAD=ON` (the default). With it OFF the tab is not compiled and the deps prefix matches upstream exactly — see [cad_dependency_weight.md](cad_dependency_weight.md). diff --git a/docs/design_tab_pr_description.md b/docs/design_tab_pr_description.md index 941d3bdac0..deea21d6fc 100644 --- a/docs/design_tab_pr_description.md +++ b/docs/design_tab_pr_description.md @@ -70,4 +70,4 @@ AGPLv3/GPLv3 compatibility argument; this point should be confirmed with upstrea See the [Where the code lives](docs/design_tab.md#where-the-code-lives) table in the user doc for the file-to-role mapping, and [docs/ux/tool_atlas.json](docs/ux/tool_atlas.json) as -the generated-from source of `src/slic3r/GUI/DesignOffer.hpp`. +the generated-from source of `src/slic3r/GUI/CAD/DesignOffer.hpp`. diff --git a/docs/ux/mockups/gen_offer_table.py b/docs/ux/mockups/gen_offer_table.py index 724d0309dc..4dc557b627 100644 --- a/docs/ux/mockups/gen_offer_table.py +++ b/docs/ux/mockups/gen_offer_table.py @@ -7,7 +7,7 @@ The map exists ONCE. The mockups and the shipping menu read the same rows in the order from the same file, so a drawing and the product cannot drift apart — which is the only way row constancy (charter 4.1) survives contact with a codebase. -Output: src/slic3r/GUI/DesignOffer.hpp, checked in and never hand-edited. +Output: src/slic3r/GUI/CAD/DesignOffer.hpp, checked in and never hand-edited. """ import json @@ -17,7 +17,7 @@ HERE = os.path.dirname(os.path.abspath(__file__)) UX = os.path.dirname(HERE) REPO = os.path.dirname(os.path.dirname(UX)) ATLAS = os.path.join(UX, "tool_atlas.json") -OUT = os.path.join(REPO, "src", "slic3r", "GUI", "DesignOffer.hpp") +OUT = os.path.join(REPO, "src", "slic3r", "GUI", "CAD", "DesignOffer.hpp") # selection id -> C++ enumerator ENUM = { diff --git a/docs/ux/tool_atlas.json b/docs/ux/tool_atlas.json index fb3399b14b..9aaf1400c4 100644 --- a/docs/ux/tool_atlas.json +++ b/docs/ux/tool_atlas.json @@ -3,11 +3,11 @@ "Source of truth for the object-driven tool offer (see docs/cad_ux_guidelines.md 4.1).", "Every verb, the selections it accepts, the document state it needs, and its fixed", "compass address. Extracted from the code, not from memory:", - " verbs + shortcuts + refusal messages -> src/slic3r/GUI/DesignPanel.cpp (feat_dropdown", + " verbs + shortcuts + refusal messages -> src/slic3r/GUI/CAD/DesignPanel.cpp (feat_dropdown", " call sites at 524/662/734/790/874/904, sk_key table at 369-400, m_keys_feature)", - " kernel coverage -> src/libslic3r/CadDocument.hpp (enum CadFeatureType)", - " headless coverage -> src/slic3r/GUI/McpControl.cpp (method == \"...\")", - " selection kinds -> src/slic3r/GUI/DesignCanvas.hpp (the on_*_selected callbacks)", + " kernel coverage -> src/libslic3r/CAD/CadDocument.hpp (enum CadFeatureType)", + " headless coverage -> src/slic3r/GUI/CAD/McpControl.cpp (method == \"...\")", + " selection kinds -> src/slic3r/GUI/CAD/DesignCanvas.hpp (the on_*_selected callbacks)", "gen_offer_mockups.py reads this file; the eventual C++ offer table is generated from it", "too, so the map exists once." ], diff --git a/src/libslic3r/CadDocument.cpp b/src/libslic3r/CAD/CadDocument.cpp similarity index 99% rename from src/libslic3r/CadDocument.cpp rename to src/libslic3r/CAD/CadDocument.cpp index d3e9bca72e..e95e36d954 100644 --- a/src/libslic3r/CadDocument.cpp +++ b/src/libslic3r/CAD/CadDocument.cpp @@ -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 diff --git a/src/libslic3r/CadDocument.hpp b/src/libslic3r/CAD/CadDocument.hpp similarity index 99% rename from src/libslic3r/CadDocument.hpp rename to src/libslic3r/CAD/CadDocument.hpp index 049ba43b3f..0927e85b05 100644 --- a/src/libslic3r/CadDocument.hpp +++ b/src/libslic3r/CAD/CadDocument.hpp @@ -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 #include diff --git a/src/libslic3r/GeometryEngine.cpp b/src/libslic3r/CAD/GeometryEngine.cpp similarity index 99% rename from src/libslic3r/GeometryEngine.cpp rename to src/libslic3r/CAD/GeometryEngine.cpp index ae8b4a1e64..ede3924056 100644 --- a/src/libslic3r/GeometryEngine.cpp +++ b/src/libslic3r/CAD/GeometryEngine.cpp @@ -1,4 +1,4 @@ -#include "GeometryEngine.hpp" +#include "libslic3r/CAD/GeometryEngine.hpp" #include #include diff --git a/src/libslic3r/GeometryEngine.hpp b/src/libslic3r/CAD/GeometryEngine.hpp similarity index 99% rename from src/libslic3r/GeometryEngine.hpp rename to src/libslic3r/CAD/GeometryEngine.hpp index 32d8d96ca6..f27a0f2f17 100644 --- a/src/libslic3r/GeometryEngine.hpp +++ b/src/libslic3r/CAD/GeometryEngine.hpp @@ -1,7 +1,7 @@ #ifndef slic3r_GeometryEngine_hpp_ #define slic3r_GeometryEngine_hpp_ -#include "TriangleMesh.hpp" +#include "libslic3r/TriangleMesh.hpp" #include #include diff --git a/src/libslic3r/SketchConstraints.cpp b/src/libslic3r/CAD/SketchConstraints.cpp similarity index 99% rename from src/libslic3r/SketchConstraints.cpp rename to src/libslic3r/CAD/SketchConstraints.cpp index ea41ba152e..003afb4d63 100644 --- a/src/libslic3r/SketchConstraints.cpp +++ b/src/libslic3r/CAD/SketchConstraints.cpp @@ -1,4 +1,4 @@ -#include "SketchConstraints.hpp" +#include "libslic3r/CAD/SketchConstraints.hpp" #include #include diff --git a/src/libslic3r/SketchConstraints.hpp b/src/libslic3r/CAD/SketchConstraints.hpp similarity index 100% rename from src/libslic3r/SketchConstraints.hpp rename to src/libslic3r/CAD/SketchConstraints.hpp diff --git a/src/libslic3r/SketchEngine.cpp b/src/libslic3r/CAD/SketchEngine.cpp similarity index 99% rename from src/libslic3r/SketchEngine.cpp rename to src/libslic3r/CAD/SketchEngine.cpp index 11d1907ecf..e544dce9c1 100644 --- a/src/libslic3r/SketchEngine.cpp +++ b/src/libslic3r/CAD/SketchEngine.cpp @@ -1,4 +1,4 @@ -#include "SketchEngine.hpp" +#include "libslic3r/CAD/SketchEngine.hpp" #include #include diff --git a/src/libslic3r/SketchEngine.hpp b/src/libslic3r/CAD/SketchEngine.hpp similarity index 99% rename from src/libslic3r/SketchEngine.hpp rename to src/libslic3r/CAD/SketchEngine.hpp index d4f230f348..26eac1130d 100644 --- a/src/libslic3r/SketchEngine.hpp +++ b/src/libslic3r/CAD/SketchEngine.hpp @@ -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 #include diff --git a/src/libslic3r/SketchImport.cpp b/src/libslic3r/CAD/SketchImport.cpp similarity index 93% rename from src/libslic3r/SketchImport.cpp rename to src/libslic3r/CAD/SketchImport.cpp index 0d6e2a93ad..7140776603 100644 --- a/src/libslic3r/SketchImport.cpp +++ b/src/libslic3r/CAD/SketchImport.cpp @@ -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 #include diff --git a/src/libslic3r/SketchImport.hpp b/src/libslic3r/CAD/SketchImport.hpp similarity index 97% rename from src/libslic3r/SketchImport.hpp rename to src/libslic3r/CAD/SketchImport.hpp index 7ac11b5a54..0873b0b861 100644 --- a/src/libslic3r/SketchImport.hpp +++ b/src/libslic3r/CAD/SketchImport.hpp @@ -1,7 +1,7 @@ #ifndef slic3r_SketchImport_hpp_ #define slic3r_SketchImport_hpp_ -#include "Point.hpp" // Vec2d +#include "libslic3r/Point.hpp" // Vec2d #include #include diff --git a/src/libslic3r/SketchInference.cpp b/src/libslic3r/CAD/SketchInference.cpp similarity index 99% rename from src/libslic3r/SketchInference.cpp rename to src/libslic3r/CAD/SketchInference.cpp index b2df50a3cb..d5b40581a5 100644 --- a/src/libslic3r/SketchInference.cpp +++ b/src/libslic3r/CAD/SketchInference.cpp @@ -1,4 +1,4 @@ -#include "SketchInference.hpp" +#include "libslic3r/CAD/SketchInference.hpp" #include diff --git a/src/libslic3r/SketchInference.hpp b/src/libslic3r/CAD/SketchInference.hpp similarity index 98% rename from src/libslic3r/SketchInference.hpp rename to src/libslic3r/CAD/SketchInference.hpp index ddbe2087eb..d520041ab7 100644 --- a/src/libslic3r/SketchInference.hpp +++ b/src/libslic3r/CAD/SketchInference.hpp @@ -1,7 +1,7 @@ #ifndef slic3r_SketchInference_hpp_ #define slic3r_SketchInference_hpp_ -#include "SketchEngine.hpp" +#include "libslic3r/CAD/SketchEngine.hpp" #include #include #include diff --git a/src/libslic3r/SketchSolver.cpp b/src/libslic3r/CAD/SketchSolver.cpp similarity index 99% rename from src/libslic3r/SketchSolver.cpp rename to src/libslic3r/CAD/SketchSolver.cpp index 861709ea56..7969b34098 100644 --- a/src/libslic3r/SketchSolver.cpp +++ b/src/libslic3r/CAD/SketchSolver.cpp @@ -1,4 +1,4 @@ -#include "SketchSolver.hpp" +#include "libslic3r/CAD/SketchSolver.hpp" #include diff --git a/src/libslic3r/SketchSolver.hpp b/src/libslic3r/CAD/SketchSolver.hpp similarity index 97% rename from src/libslic3r/SketchSolver.hpp rename to src/libslic3r/CAD/SketchSolver.hpp index edf9fe8690..dfd6ac0ff1 100644 --- a/src/libslic3r/SketchSolver.hpp +++ b/src/libslic3r/CAD/SketchSolver.hpp @@ -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 namespace Slic3r { diff --git a/src/libslic3r/ThreadStandards.cpp b/src/libslic3r/CAD/ThreadStandards.cpp similarity index 98% rename from src/libslic3r/ThreadStandards.cpp rename to src/libslic3r/CAD/ThreadStandards.cpp index d2909c5275..2d113d01e6 100644 --- a/src/libslic3r/ThreadStandards.cpp +++ b/src/libslic3r/CAD/ThreadStandards.cpp @@ -1,4 +1,4 @@ -#include "ThreadStandards.hpp" +#include "libslic3r/CAD/ThreadStandards.hpp" namespace Slic3r { diff --git a/src/libslic3r/ThreadStandards.hpp b/src/libslic3r/CAD/ThreadStandards.hpp similarity index 100% rename from src/libslic3r/ThreadStandards.hpp rename to src/libslic3r/CAD/ThreadStandards.hpp diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index 70774dec00..7241002295 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -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 () diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt index def3a4158b..54e2592b5f 100644 --- a/src/slic3r/CMakeLists.txt +++ b/src/slic3r/CMakeLists.txt @@ -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). diff --git a/src/slic3r/GUI/DesignCanvas.cpp b/src/slic3r/GUI/CAD/DesignCanvas.cpp similarity index 99% rename from src/slic3r/GUI/DesignCanvas.cpp rename to src/slic3r/GUI/CAD/DesignCanvas.cpp index e04f0d1b5f..e1d44b3ce5 100644 --- a/src/slic3r/GUI/DesignCanvas.cpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.cpp @@ -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 #include diff --git a/src/slic3r/GUI/DesignCanvas.hpp b/src/slic3r/GUI/CAD/DesignCanvas.hpp similarity index 99% rename from src/slic3r/GUI/DesignCanvas.hpp rename to src/slic3r/GUI/CAD/DesignCanvas.hpp index 3acb03f20e..e0c61cdc61 100644 --- a/src/slic3r/GUI/DesignCanvas.hpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.hpp @@ -8,10 +8,10 @@ #include #include -#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; diff --git a/src/slic3r/GUI/DesignOffer.hpp b/src/slic3r/GUI/CAD/DesignOffer.hpp similarity index 100% rename from src/slic3r/GUI/DesignOffer.hpp rename to src/slic3r/GUI/CAD/DesignOffer.hpp diff --git a/src/slic3r/GUI/DesignPanel.cpp b/src/slic3r/GUI/CAD/DesignPanel.cpp similarity index 99% rename from src/slic3r/GUI/DesignPanel.cpp rename to src/slic3r/GUI/CAD/DesignPanel.cpp index a2d65fa891..e806e46d39 100644 --- a/src/slic3r/GUI/DesignPanel.cpp +++ b/src/slic3r/GUI/CAD/DesignPanel.cpp @@ -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 #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" diff --git a/src/slic3r/GUI/DesignPanel.hpp b/src/slic3r/GUI/CAD/DesignPanel.hpp similarity index 99% rename from src/slic3r/GUI/DesignPanel.hpp rename to src/slic3r/GUI/CAD/DesignPanel.hpp index 3f0e113376..0ce6ccf4fa 100644 --- a/src/slic3r/GUI/DesignPanel.hpp +++ b/src/slic3r/GUI/CAD/DesignPanel.hpp @@ -10,7 +10,7 @@ #include #include -#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) diff --git a/src/slic3r/GUI/DesignSketchTool.cpp b/src/slic3r/GUI/CAD/DesignSketchTool.cpp similarity index 99% rename from src/slic3r/GUI/DesignSketchTool.cpp rename to src/slic3r/GUI/CAD/DesignSketchTool.cpp index a290336cbd..d1bca847dc 100644 --- a/src/slic3r/GUI/DesignSketchTool.cpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.cpp @@ -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 #include #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 diff --git a/src/slic3r/GUI/DesignSketchTool.hpp b/src/slic3r/GUI/CAD/DesignSketchTool.hpp similarity index 99% rename from src/slic3r/GUI/DesignSketchTool.hpp rename to src/slic3r/GUI/CAD/DesignSketchTool.hpp index df05085a8e..84a45d3486 100644 --- a/src/slic3r/GUI/DesignSketchTool.hpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.hpp @@ -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 #include #include diff --git a/src/slic3r/GUI/McpControl.cpp b/src/slic3r/GUI/CAD/McpControl.cpp similarity index 99% rename from src/slic3r/GUI/McpControl.cpp rename to src/slic3r/GUI/CAD/McpControl.cpp index 5a87fa37c8..9fd15e1ed4 100644 --- a/src/slic3r/GUI/McpControl.cpp +++ b/src/slic3r/GUI/CAD/McpControl.cpp @@ -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 #include // 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 diff --git a/src/slic3r/GUI/McpControl.hpp b/src/slic3r/GUI/CAD/McpControl.hpp similarity index 100% rename from src/slic3r/GUI/McpControl.hpp rename to src/slic3r/GUI/CAD/McpControl.hpp diff --git a/src/slic3r/GUI/SketchInlineEditor.cpp b/src/slic3r/GUI/CAD/SketchInlineEditor.cpp similarity index 99% rename from src/slic3r/GUI/SketchInlineEditor.cpp rename to src/slic3r/GUI/CAD/SketchInlineEditor.cpp index 1b4834a13a..c9a85e7ef7 100644 --- a/src/slic3r/GUI/SketchInlineEditor.cpp +++ b/src/slic3r/GUI/CAD/SketchInlineEditor.cpp @@ -1,4 +1,4 @@ -#include "SketchInlineEditor.hpp" +#include "slic3r/GUI/CAD/SketchInlineEditor.hpp" #include diff --git a/src/slic3r/GUI/SketchInlineEditor.hpp b/src/slic3r/GUI/CAD/SketchInlineEditor.hpp similarity index 100% rename from src/slic3r/GUI/SketchInlineEditor.hpp rename to src/slic3r/GUI/CAD/SketchInlineEditor.hpp diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 4afa7dfcf6..9924859d9f 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -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 diff --git a/src/slic3r/GUI/Gizmos/GLGizmoPrimitive.hpp b/src/slic3r/GUI/Gizmos/GLGizmoPrimitive.hpp index 013dc0d9c2..f78289a58d 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoPrimitive.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoPrimitive.hpp @@ -3,7 +3,7 @@ #include "GLGizmoBase.hpp" #include "GLGizmosCommon.hpp" -#include "libslic3r/GeometryEngine.hpp" +#include "libslic3r/CAD/GeometryEngine.hpp" namespace Slic3r { namespace GUI { diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSketch.hpp b/src/slic3r/GUI/Gizmos/GLGizmoSketch.hpp index 52f6cbedd2..5a4b59edfd 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSketch.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSketch.hpp @@ -3,7 +3,7 @@ #include "GLGizmoBase.hpp" #include "GLGizmosCommon.hpp" -#include "libslic3r/SketchEngine.hpp" +#include "libslic3r/CAD/SketchEngine.hpp" #include namespace Slic3r { diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 70b57451fe..21b6f01893 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -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" diff --git a/tests/libslic3r/test_caddocument.cpp b/tests/libslic3r/test_caddocument.cpp index 1fa72a2be8..2200bf4d04 100644 --- a/tests/libslic3r/test_caddocument.cpp +++ b/tests/libslic3r/test_caddocument.cpp @@ -12,11 +12,11 @@ do { const std::string _actual = (str); INFO("actual: " << _actual); \ CHECK(_actual.find(sub) != std::string::npos); } while (0) -#include "libslic3r/CadDocument.hpp" -#include "libslic3r/GeometryEngine.hpp" -#include "libslic3r/SketchEngine.hpp" -#include "libslic3r/SketchImport.hpp" -#include "libslic3r/ThreadStandards.hpp" +#include "libslic3r/CAD/CadDocument.hpp" +#include "libslic3r/CAD/GeometryEngine.hpp" +#include "libslic3r/CAD/SketchEngine.hpp" +#include "libslic3r/CAD/SketchImport.hpp" +#include "libslic3r/CAD/ThreadStandards.hpp" #include "libslic3r/Utils.hpp" #include diff --git a/tests/libslic3r/test_sketchconstraints.cpp b/tests/libslic3r/test_sketchconstraints.cpp index eb54540fee..e64b5d1ba9 100644 --- a/tests/libslic3r/test_sketchconstraints.cpp +++ b/tests/libslic3r/test_sketchconstraints.cpp @@ -1,5 +1,5 @@ #include // mainline OrcaSlicer ships Catch2 v3 (v2 was catch2/catch.hpp) -#include "libslic3r/SketchConstraints.hpp" +#include "libslic3r/CAD/SketchConstraints.hpp" using namespace Slic3r; diff --git a/tests/libslic3r/test_sketchedit.cpp b/tests/libslic3r/test_sketchedit.cpp index 6b65c8201b..eb99560d7d 100644 --- a/tests/libslic3r/test_sketchedit.cpp +++ b/tests/libslic3r/test_sketchedit.cpp @@ -1,5 +1,5 @@ #include // mainline OrcaSlicer ships Catch2 v3 (v2 was catch2/catch.hpp) -#include "libslic3r/SketchEngine.hpp" +#include "libslic3r/CAD/SketchEngine.hpp" #include using namespace Slic3r; diff --git a/tests/libslic3r/test_sketchimport.cpp b/tests/libslic3r/test_sketchimport.cpp index f94d52beb0..3e3f7c906e 100644 --- a/tests/libslic3r/test_sketchimport.cpp +++ b/tests/libslic3r/test_sketchimport.cpp @@ -1,6 +1,6 @@ #include // mainline OrcaSlicer ships Catch2 v3 (v2 was catch2/catch.hpp) -#include "libslic3r/SketchImport.hpp" +#include "libslic3r/CAD/SketchImport.hpp" #include "libslic3r/Utils.hpp" // resources_dir #include "test_utils.hpp" // ScopedTemporaryFile diff --git a/tests/libslic3r/test_sketchinference.cpp b/tests/libslic3r/test_sketchinference.cpp index 62b95940cd..dfbfefdbc3 100644 --- a/tests/libslic3r/test_sketchinference.cpp +++ b/tests/libslic3r/test_sketchinference.cpp @@ -1,7 +1,7 @@ #include // mainline OrcaSlicer ships Catch2 v3 (v2 was catch2/catch.hpp) using Catch::Approx; // v3 scopes Approx into the Catch namespace; v2 had it at global scope -#include "libslic3r/SketchInference.hpp" +#include "libslic3r/CAD/SketchInference.hpp" using namespace Slic3r; using K = InferenceSnap::Kind; diff --git a/tests/libslic3r/test_slvs_constraints.cpp b/tests/libslic3r/test_slvs_constraints.cpp index 07a4bcffd6..2692ae5ace 100644 --- a/tests/libslic3r/test_slvs_constraints.cpp +++ b/tests/libslic3r/test_slvs_constraints.cpp @@ -1,8 +1,8 @@ #include // mainline OrcaSlicer ships Catch2 v3 (v2 was catch2/catch.hpp) using Catch::Approx; // v3 scopes Approx into the Catch namespace; v2 had it at global scope -#include "libslic3r/SketchSolver.hpp" -#include "libslic3r/SketchEngine.hpp" +#include "libslic3r/CAD/SketchSolver.hpp" +#include "libslic3r/CAD/SketchEngine.hpp" using namespace Slic3r; using CT = SketchConstraintType;