Commit Graph

6 Commits

Author SHA1 Message Date
NiJingzhe 8ffc8c0d4d bindings: one vocabulary for signature types (Renamed<T, Tag>, AnyOf<Tag> and the meanings built from them); every operation's parameters are typed
The three branches had each grown a helper header (Typed/Shown, Renamed/Named, TypedObject/Choice/...); they are one
semantic_types.hpp now, with Length, Angle, Point3, Direction3, Vector3, Count, Choice and the plain-double/Vec3 variants as
names over the two tools. test_catalog now requires that no parameter of any operation reads "object". Stubs and API pages
regenerated. Full suite: 2494 passed, 63 skipped (the 7 collection errors are the untracked stale test files that predate
this work).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 05:20:44 +08:00
NiJingzhe 7556a4a059 bindings: geometry and feature operations say what each parameter means (Length, Angle, Point3, Direction3, Vector3, Count, Literal choices, selections) instead of object
The selections, sections, enum strings and paths keep loading exactly what they loaded (a named object caster prints the
honest union); the bodies are unchanged. SDK_DEFECTS 21: the angle arc takes radians, the chamfer angle a plain float.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 05:01:45 +08:00
NiJingzhe 99d34d9522 catalog: the meaning of a parameter is its type in the binding (Length, Angle, Point3, Direction3, Vector3); simplecadapi.catalog reads every operation from the signatures
Bindings declare scad::pybind::Length etc. (thin wrappers that convert to the Scalar the kernel takes, so binding bodies do not change);
pybind writes simplecadapi.types.Length into the signature, the stubs and the API pages show it, and simplecadapi.catalog parses the
signatures of every *_r<kind> operation (and the standard library's Python ones) into typed parameters. Box and cylinder are the
pilot; test_catalog.py keeps the list of operations that still take untyped parameters, which only shrinks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 04:26:12 +08:00
NiJingzhe b4f8067f26 refactor: name the tolerances (scad::tol) instead of repeating their numbers
include/scad/core/tolerance.hpp holds 38 constants, each named for what it is a tolerance for, with a how-to-choose
comment and a table. 116 sites in 56 files use them; every constant has exactly the value of the literal it replaces,
so nothing computes differently (ctest and the golden parity tests unchanged). About 110 literals stay where they
are on purpose: OCCT mirror bindings, solver constants that already have local names, relative-times-floor
combinations, raster/render epsilons.

Six ambiguous sites are listed in the CHANGELOG-free note of the commit for the owner:
extrude_until.cpp:68 (1e-8 sine test), :193 (extent below 1e-12 uses kDegenerateNorm), probes.cpp:207,228,
bind_surface.cpp:75 (interpolation default 1e-5 vs kSplineInterpolation 1e-6), tracking.hpp:148 (tracked_shell tol),
BuildCurves3d at 1e-6 (kernel/curves.cpp:177) and 1e-7 (tracking_lofts.cpp:254).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 16:58:17 +08:00
NiJingzhe 7edd550f29 style: add .clang-format and format the C++ tree with it
One mechanical pass (clang-format 18.1.8, Google base, 120 columns, T& x, includes untouched). Nothing but whitespace and
line breaks moves; tools/check_format.sh lists what would change and CI runs it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 16:28:29 +08:00
NiJingzhe 8971279494 feat: the geometry engine is C++ on OpenCASCADE, one package, prebuilt wheels
The modeling API (shapes, operators, sketches, products, queries, the reactive graph) is implemented in
C++20 on OpenCASCADE (src/cpp) and ships inside the wheel as simplecadapi._cpp.  The Python layers that stay
Python (runtime, build, artifacts, editor, inspect, exporter, translators, scene) run on it unchanged; the
previous Python test suite passes on the new engine.

Layout: src/cpp and src/simplecadapi side by side, one distribution built by scikit-build-core.
simplecadapi.core, .operators.*, .ql, .std.* and the other legacy modules are real forwarding modules; the
Python adapter layer is simplecadapi/_glue.  OCP is no longer a dependency and nothing imports it.

Release: .github/workflows/release.yml builds wheels for Linux x86_64 and aarch64, macOS arm64 and Windows
x86_64 (Python 3.10-3.13) against one static OCCT, runs the test suite on the Linux wheels and publishes to
GitHub and PyPI; ci.yml caches the static OCCT for the test jobs.

Errors: every message the library writes is English; the tag-validation and semantic-query errors render in
full with possible causes and fixes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 02:55:35 +08:00