An agent-native CAD SDK for language models to create, inspect, and reconstruct complex, editable 3D models.
Repo PhySpace/SimpleCADAPI, read from GitHub 18 h ago. PhySpace has not joined Take My Repo.
2.3.0.post1 follows 2.3.0. It is the editor fix below, plus everything merged to dev after 2.3.0 (the drawing engine rework and
the parallel wheel build); nothing in the geometry kernel changed.
sca cell used os.kill(pid, 0) on the pid in .sca-editor/server.json and took "no such process" for a dead editor. A sandbox
with its own pid namespace cannot see the editor's process while the editor answers, so every editor started outside it was
"stale" and the agent lost it ("editor not reached: stale record ... (pid N is gone)").
Now /api/health is the truth, and the workspace it answers for must be the record's directory:
sca cell says |
it means |
|---|---|
... does not answer |
no editor listens at that url; start one (a pid that is gone only sharpens this message) |
answers for workspace X, not Y |
that port belongs to another project's editor; nothing is sent to it |
N editors serve ... |
several are live; none is chosen for you |
/api/health) and its own record, .sca-editor/editors/<instance>.json, written atomicallyserver.json is gone; code that read it reads this directory.--editor URL --instance ID or SCA_EDITOR_URL and SCA_EDITOR_INSTANCE (both are needed) on any sca cell,sca feature, sca sketch or sca new command. A pinned editor is used wherever the command runs and is checked against itssca cell, sca feature and sca sketch reports say which editor answered: editor: {url, workspace, instance}.sca snapshot and sca viewport still read per-workspace files, so two editors on one workspace overwrite each other there.sca edit picks the port--port now defaults to 0: the system picks a free port and the editor serves on the socket it bound, so nothing can take the
port in between. Once it listens, one line goes to stdout:
SCA_EDITOR_READY {"url": "http://127.0.0.1:41233", "instance": "3f9c2a7d41b0", "workspace": "/work/proj", "pid": 812}
--port N keeps a fixed port and fails with a message when it is taken. The default was 7180.
dev)DimDecl(of=...), between=(a, b),extent=) and the sheet number is the measurement; one issue list; native DXF DIMENSION entities. See the changelog.2.3.0 follows 2.2.7. 2.2.8 was withdrawn (yanked on PyPI, its GitHub release deleted) and a 2.2.9 that replaced it was prepared
but never published, so everything of both is in 2.3.0. It is a minor version because it removes interface of the withdrawn
2.2.8, adds keywords, and changes what cut_rsolid and intersect_rsolid return by default.
2.2.8 let a Part hold several bodies, and a Part like that could not take part in an assembly. In 2.3.0 a Part holds exactly
one solid again, and the editor keeps what it needed from the change: several solids can sit side by side in a notebook while a
model is built.
The editor has to let several solids exist in one notebook with no assembly constraint between them: to pattern a tool and then
cut, there is a moment where more than one tool and the body exist together. In 2.2.8 that was solved inside the Part. But a
Part is the unit an assembly places, mates and gives connectors to, and a Part of several bodies could do none of that:
explode_rassembly raised TypeError on any assembly that held one;The solids side by side are intermediate values of a notebook, not product items. So they are notebook values now, and the
Part is one solid. The full account is in design-docs/part-holds-one-solid.md.
make_part_rpart(part_id, body, name=None) takes one Solid, a Body (a solid with a display name, colour and opacity), orValueError, which says what to do: one Part per solid inbodies= argument, Part.multi_body, scad.part_shape,inspect_body_overlaps_rlist, BodyOverlap, BodyOverlapWarning, and the part definition profilesimplecad-part-definition-3 with solid_cache.bodies. A model JSON recorded with several solids in one Part is refused onSeveralOpenBodiesError, which names the solids; make the Part from the one that is the partscad.make_part_rpart(part_id=scad.notebook_id(), body=...)), or make a Part of each and an Assembly of them.use_as_product makes the Partcut_rsolid and intersect_rsolid clean their resultunion_rsolid always unified the faces and edges that lie on one surface; cut_rsolid, cut_rsolid_list and
intersect_rsolid did not. A cut through the side of a box with a cylinder leaves the cylinder wall split along its seam, and
OCCT fillets an edge along such a split face wrongly: it returned an invalid solid with a wrong volume and no error (issue #88),
or refused with a message that blamed the radius.
cut_rsolid, cut_rsolid_list, intersect_rsolid take clean=True (the default) and unify what they leave split. Tagsclean=False returns the rawfillet_rsolid and chamfer_rsolid check their result: a solid OCCT calls invalid (while the input was valid) is anclean is a recorded parameter of make_cut_rsolid, make_cut_rsolid_list and make_intersect_rsolid..scadpkg file, and running where the source is read-onlyexport_product_package_to_step / stl / obj / mjcf and the FreeCAD translator@scad.part / @scad.assemble (or its definition) as well as a package, bytes or a path, and packagescad.exporter.export_product_package_to_step(build_part(), "part.step"); the 120 x 120 x 10 plate of issue #89 takes 0.26 srun_notebook(path, cache=False) leaves the source directory alone. It no longer writes __marimo__/.../deps.json or:ro). A run with the cache still writes its state there, and fails if it cannot.domains/export-and-translation.md.A body's geometry fingerprint quantizes every measured value to 1e-7 mm. A design value such as -3.34690815 mm lies exactly on a
boundary of that rounding, and one unit in the last place of computation noise (a BREP round trip) sent it to the neighbouring
integer, so the fingerprint changed and restoring a topology snapshot raised geometry_mismatch (issue #87). The quantizer now
snaps the value to a grid far coarser than the noise and far finer than a quantum before rounding. Fingerprints change once for a
body with a value on a boundary; a snapshot recorded before that does not restore and has to be captured again.
sca cell no longer kills the editor it talks to: the editor's process id is probed without signalling itos.kill(pid, 0) on Windows terminates the process).operators_promote.cpp includes <algorithm>), MinGW (_USE_MATH_DEFINES, andbuild_occt.py picks Ninja when a MinGW g++ is the compiler), and the macOS wheels are built on macos-15 (the wheels stilluv sync builds the package on Windows. Without Visual Studio the build used to fall to the NMake generator andCMAKE_GENERATOR, CC, CXX and CMAKE_ARGS by hand. The build backendtools/build_backend/scad_build.py) now picks Ninja and the gcc on the path when Visual Studio is absent, finds OpenCASCADESCAD_OCCT_PREFIX, C:/occt, or a per-user cache it builds once) and limits the jobs by memory. Anything you set yourselfuv rebuilds only when src/cpp changes ([tool.uv] cache-keys), not on a version bump.AGENT.md records how to rebuild the C++ module on Windows and how commits are organised: one decision per commit, with theThe first stable release of the C++ engine (2.2.7b1 was the beta): the geometry engine is C++ on OpenCASCADE, shipped inside
prebuilt wheels, and pip install simplecadapi needs no cadquery-ocp and no OpenCASCADE on the machine. This release makes
the editor much faster, lets Var and Expr be used like numbers, and fixes what the beta left out.
Linux x86_64 and aarch64 (manylinux_2_28), macOS arm64 (14+) and Windows x86_64, each for Python 3.10, 3.11, 3.12 and 3.13, all
linked against the same OpenCASCADE 7.9.3. There are no wheels for macOS Intel, musl Linux or Windows on ARM; there the source
distribution builds the module and needs a C++20 toolchain and OpenCASCADE >= 7.8.
Measured on the six-axis arm (sandbox-envs/desktop_arm_sources) in the editor, same machine:
| 2.2.6.post2 | 2.2.7b1 | 2.2.7 | |
|---|---|---|---|
| cold start | 64.5 s | 48.8 s | 34.9 s |
| start with nothing changed | 4.1 s | 2.1 s | 1.6 s |
| a joint angle never seen before | 4.4 s | 5.7 s | 2.7 s |
| a joint angle seen before | 6.2 s | 5.5 s | 0.6 s |
| idle memory | 1038 MB | 322 MB | 617 MB |
preview event itself, with no second request.use() returned, and a saved parameter's digest follows what a cellOPEN_STROKE on the arm takes 5.8 s (2.2.6.post2: 4.7 s; the beta:Var and Expr behave like numbersint(r), round(r, 2), r > 3, max(r, 3), sorted([...]), range(n), [0] * n, lst[n - 1], r // 2, r % 3,
f"{r:.2f}" and str(r) now work and read the value the variable has now; arithmetic still builds the formula that keeps
the link to the parameters. r == 5.0 is True (it was False), and a ql predicate with a value computed from a Var
(ql.prop("geom.length", ">=", 2 * math.pi * radius)) now matches, where 2.2.6 matched nothing.
Still errors: bool(var) (write if r > 0:) and json.dumps(var); numpy needs float(var). A notebook that relies on the new
behaviour does not run unchanged on 2.2.6; float(var) makes it portable.
shape.wrapped is an OCP shapeWith OCP installed (pip install "simplecadapi[verify]"), shape.wrapped is an OCP shape of the class of its kind
(TopoDS_Solid, TopoDS_Face, ...), so verifier scripts written with the OCCT API run as written. It is a copy: every access
makes a new one, and a change made to it does not reach the SDK's shape. simplecadapi.verify.to_ocp / from_ocp are the
explicit forms. SCA_WRAPPED=native|ocp chooses. Without OCP it stays the SDK's own OCCT shape. The fem extra is gone.
exactly(), attach their picture again (2.2.7b1 drew one for booleans only).400), not as missing parts.use, the arm's gripper) takes 0.8 s instead of 3-6 s.[sca] line on stderr.shape.wrapped is a copy when OCP is installed (above).docs/environment.md.discipline/notebook-cell-design.md states where the cell boundaries go, when a number is a scad.var, and why, with the error
you get when a rule is broken.
The C++ tree is formatted (.clang-format, checked in CI), has a CONTRIBUTING.md, a reading order and a landing plan under
src/cpp/, named tolerances (scad::tol), no swallowed exceptions or unchecked optionals that clang-tidy reports, and its
doctest executables run in CI in Release and under ASan and UBSan. The old tests that do not apply to the soft renderer are
listed in src/cpp/docs/DEVIATIONS.md.
The geometry engine is now C++ on OpenCASCADE, shipped inside the wheel. pip install simplecadapi
needs no cadquery-ocp and no OpenCASCADE on the machine. Models, graphs, packages and the public
API behave as before: the whole previous test suite passes on the new engine.
| platform | wheels |
|---|---|
| Linux x86_64 (manylinux_2_28) | Python 3.10, 3.11, 3.12, 3.13 |
| Linux aarch64 (manylinux_2_28) | Python 3.10, 3.11, 3.12, 3.13 |
| macOS arm64 (macOS 14+) | Python 3.10, 3.11, 3.12, 3.13 |
| Windows x86_64 | Python 3.10, 3.11, 3.12, 3.13 |
Every wheel links the same OpenCASCADE 7.9.3, built from source, so a model computes the same on
every platform. There are no wheels for macOS Intel, musl Linux or Windows on ARM; there the source
distribution builds the module and needs a C++20 toolchain and OpenCASCADE >= 7.8.
This is the first release with prebuilt wheels: please report a platform that does not install or
import.
On the six-axis arm (sandbox-envs/desktop_arm_sources), same sources, same machine, Python runtime:
| 2.2.6.post2 | 2.2.7b1 | |
|---|---|---|
| cold build | 43.8 s | 29.1 s |
| nothing changed | 12.8 s | 6.0 s |
| edit one joint | 9.9 s | 6.1 s |
| peak memory, cold build (process tree) | 2690 MB | 2043 MB |
import simplecadapi |
1.6 s, 360 MB | 0.2 s, 68 MB |
The models computed are the same (volumes agree to 1e-12 relative).
simplecadapi._cpp; simplecadapi.core, simplecadapi.operators.*,simplecadapi.ql, simplecadapi.std.* and the other modules keep their import paths ascadquery-ocp, ocp-gordon, py-slvs. The OpenCASCADE view of a shapeshape.wrapped) is now the module's own binding, simplecadapi._cpp.occt, laid out like OCP.SCA_BACKEND is gone: there is one backend.simplecadapi.inspect.brep is part of the default install and renders with the same software renderer asrender_screenshot_rpath: no VTK, no GPU, no display server (no xvfb). matplotlib is now a core dependency; theinspect extra stays as an empty alias so older install commands keep working. Only simplecadapi.inspect.drawingdrawing).cut_rsolid_list(base, *tools) returns every piece of a cut: a slot through a bar gives both halves, a tool thatmake_cut_rsolid_list and replays.cut_rsolid used to return only the first piece when a cut split the body, silently losing the rest (a slot through acut_rsolid_list. A tool that only touches a wallcut_rsolid_list.Built and tested on all four.
No change in what the SDK computes. Eight operators moved to the module of their family, and
the API reference they are documented in is now generated for all of them.
| operator | now in |
|---|---|
scale_rsolid, transform_rsolid |
operators/transform.py (next to translate_shape, rotate_shape) |
boolean_rsolidlist |
operators/boolean.py (next to union_rsolid, cut_rsolid) |
offset_rsolid, draft_rsolid, extrude_taper_rsolid, extrude_until_rsolid, sweep_multisection_rsolid |
operators/features.py (next to extrude_rsolid, shell_rsolid, sweep_rsolid) |
from simplecadapi import scale_rsolid (and every other name) works as before. Code that
imported them from the modules they were first written in, simplecadapi.operators.deformation,
draft, section_features or limited_extrusion, still works and gets a DeprecationWarning
naming the new place; import from simplecadapi instead.
The documentation generator kept its own hand-written list of source files and public
functions, and nobody had added those four modules to it. The docs of the eight operators above
were therefore written by hand, and the generator deleted them whenever it ran, while
boolean_rsolidlist had none. Now operators/ is discovered, a function the package exports is
public, and what the hand-written docs said (examples, error conditions, how the operation is
replayed) is in the docstrings, so it is in the generated docs. Tests fail if a public operator
has no doc, or if the committed docs differ from what the generator writes.
A hotfix for the editor's parameter panel, and a round of speed work on the notebook cache
and on use, measured on the desktop six-axis arm.
scad.var(name=..., default=...) is a parameter againThe editor found a parameter's default only as the second positional argument of
scad.var. A declaration written with keywords —
J1 = scad.var(name="j1", default=0.0, comment="Joint 1")
— was skipped: no slider, no commit back to the file. Both forms are read now, and
committing a value rewrites the right argument in either.
| desktop arm | before | now |
|---|---|---|
| cold run | 80.5 s | 34.6 s |
| nothing changed | 23.6 s | 4.0 s |
| one joint angle edited | 18.2 s | 3.0 s |
| a link length edited | 35.1 s | 19 s |
| cache on disk | 1.7 GB | 96 MB |
_name) values andscad.var is not redone because afrom lib.dims import A depends on the definition of A.use is followed one call at a time. A cell that uses a notebook by a literal pathuse calls run side by side. The use calls a cell is about to make are started inSCA_JOBS sets the number (default: the smaller of 4 and the1 turns it off). Workers are started only when that saves more than they take to