Repository navigation
2.2.7 Update Notes
The 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.
Prebuilt packages
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.
The editor is faster
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 |
- The model reaches the page sooner. The kernel publishes the model as parts identified by the content of their geometry,
the server sends each page only the parts that page lacks, and the page builds geometry only for new parts. A joint angle
moves 115 KB instead of 6.26 MB; from the last cell to the model on screen takes 0.36-0.41 s instead of 1.3-3.2 s. The
model is pushed over the WebSocket in thepreviewevent itself, with no second request. - The kernel keeps what its cells made and what
use()returned, and a saved parameter's digest follows what a cell
reads: changing one joint angle no longer redoes the cell that builds the parts. The cost is memory: about 300 MB more at
idle than the beta (the kernel keeps the twelve most recent cell results). - One case is still slower than 2.2.6: a new value of
OPEN_STROKEon the arm takes 5.8 s (2.2.6.post2: 4.7 s; the beta:
6.8 s), because the assembly solve it triggers is real work.
Var and Expr behave like numbers
int(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 shape
With 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.
Failures and fixes
- A failing fillet or chamfer, and a failing ql
exactly(), attach their picture again (2.2.7b1 drew one for booleans only). - The editor starts with whatever model file is on disk: a damaged or partial one is not restored and no longer leaves the
editor "starting the kernel" for ever. A damaged preview is refused with the reason (400), not as missing parts. - Cache entries written by an older build that name classes which no longer exist are replaced; a notebook with such entries
(a child run throughuse, the arm's gripper) takes 0.8 s instead of 3-6 s. - An OCCT failure while reading a geometry type or closedness makes the property absent, as in 2.2.6.
- A failure that is handled and used to leave no trace prints a
[sca]line on stderr.
Upgrading
- Notebooks with saved parameter values rebuild once after the upgrade (their cells' digests changed).
shape.wrappedis a copy when OCP is installed (above).- New switches are listed in
docs/environment.md.
The skill
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.
For contributors
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.