Commit Graph

5 Commits

Author SHA1 Message Date
NiJingzhe a69d1ef431 3D curves drawn in the viewport (W: lines, arcs, splines on workplanes, snapped to vertices, edge midpoints, workplane origins; a point on a workplane follows it, a snapped vertex is a scad.ref), wires and edges drawn from kernel samples; a failing step previews the model before it; independent spline handles, anchors added while drawing, Shift+A anchor mode; sketch regions (make_faces_from_sketch_rfacelist: outer loops with their holes); a tag on several entities names a set and keeps its pieces; exact surface normals in preview meshes (smooth shading, shared vertices); SimpleWorkplane.point; scad.ref.of a vertex
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 04:30:26 +08:00
NiJingzhe c6f01eb568 sdk: workplanes are recorded values (make_workplane_*_rworkplane); sketch plane=wp; replay follows the geometry
A SimpleWorkplane is now a value: copyable, entered again (`with wp:` in later
cells), picklable for the cell cache (exact frame + metadata/runtime, so it
keeps its graph lineage), with origin/normal/x_dir/y_dir/plane.

Six recorded constructors (C++ ops/geometry/workplanes.cpp, typed bindings):
make_workplane_rworkplane (origin/normal/x_dir in the current system),
_from_face_ (centre or projected origin, outward normal, x along an edge / a
direction / the face's own x, offset, flip), _from_points_ (Vertex or point),
_from_axis_ (straight edge or circle axis, turned by an angle, optional start
face), _midplane_ (two parallel faces), _normal_to_curve_ (edge or wire, at a
fraction of its length). Inputs are recorded as ordered input_refs; replay
(serializer) rebuilds the frame from the replayed geometry.

make_sketch_rsketch(plane=wp) uses the workplane's world frame, records
plane={workplane: true, frame} and the workplane node as an input; replay
takes the frame from the replayed workplane. Inside `with wp:` every recorded
node's context names the workplane node; replay orders it after that node and
uses the replayed frame. types.Plane includes SimpleWorkplane; catalog kind
"workplane".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 13:25:07 +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