Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
906c719
Verify oc.* symbols at worker startup; fix gizmo code write-back
zalo Aug 12, 2026
7d3359d
Map picked faces/edges to producing code lines in the mesh payload
zalo Aug 12, 2026
ecfd17a
Add LeapShape-style GUI modeling tools that emit code into the editor
zalo Aug 12, 2026
80203fe
Add GUI tools Playwright tests, test env overrides, and docs
zalo Aug 12, 2026
6ac6ad2
Add stateful Sketch tool: multi-click profiles with arcs, fillets, ex…
zalo Aug 12, 2026
c6d3e31
Test the Sketch tool flows and document it in CLAUDE.md
zalo Aug 12, 2026
67e9f9c
Add Python (build123d-lite) evaluation to the CAD worker via Brython
zalo Aug 12, 2026
f472e48
Add the 'python' editor mode to the studio UI
zalo Aug 12, 2026
b9e26e0
Teach the GUI modeling tools to emit build123d-lite Python
zalo Aug 12, 2026
9685baa
Fix centered-Box double scene registration; make show() identity-safe
zalo Aug 12, 2026
0c88023
Add Python-mode Playwright tests and CLAUDE.md docs
zalo Aug 12, 2026
294d4ac
Add worker measurement/introspection hooks; fix sub-shape CacheOp col…
zalo Aug 12, 2026
8e85a38
Add build123d-lite validation harness (test/b123d-validation)
zalo Aug 12, 2026
b567c03
Rewrite build123d-lite: builder mode, full locations/selectors, 40+ o…
zalo Aug 12, 2026
e7563dd
Harden validation harness; refresh reference data and commit the report
zalo Aug 12, 2026
7aa3ce6
Freeze 10 passing build123d example scripts as Python-mode regression…
zalo Aug 12, 2026
fabb26e
Document validated build123d-lite coverage in CLAUDE.md
zalo Aug 12, 2026
778124f
Normalize escaped newlines in harness gap classification
zalo Aug 12, 2026
f8652ce
Upgrade OCCT to 8.0.1 via opencascade.js#cascadestudio-v3-occt801
zalo Aug 13, 2026
816a790
build123d-lite round 4: Text via Text3D/FreeSans, real Bnd_Box measur…
zalo Aug 13, 2026
fbb9fa7
Harness: persistent pages with --pages N fan-out, worker recycle on t…
zalo Aug 13, 2026
90abc14
Update build123d-lite coverage docs: 78/126 passing on OCCT 8.0.1, ha…
zalo Aug 13, 2026
4c44548
Worker: HLR projection, non-uniform scale, kern-exact text, face reve…
zalo Aug 13, 2026
fdfb5db
build123d-lite round 5: same-frame builder gating, until=, HLR, 85/12…
zalo Aug 13, 2026
002e034
Freeze 10 more passing build123d scripts as regression tests (20 total)
zalo Aug 13, 2026
761128f
Docs + harness artifacts: 85/126 coverage, mismatch root causes, timing
zalo Aug 13, 2026
7b9682b
Bump opencascade.js: constructible interpolation arrays for GeomAPI_I…
zalo Aug 13, 2026
4876277
Worker engine: exact interpolation, PipeShell sweeps, section/hull/dr…
zalo Aug 13, 2026
6ca48ff
build123d-lite round 6: exact splines, joints, section/sweep/hull/dra…
zalo Aug 13, 2026
df667a4
Harness + docs for the 110/126 round; 5 more frozen regression tests …
zalo Aug 13, 2026
99ce3df
Bump opencascade.js: Handle_Geom_BSplineSurface.AsGeomSurface for sur…
zalo Aug 13, 2026
8ffc521
Exact BSpline surface-from-points; fuse operand-drop GF fallback; hul…
zalo Aug 13, 2026
9857b50
build123d-lite engine: thicken/projection/hull round + text-parity fi…
zalo Aug 13, 2026
369f22e
Regenerate vendored openscad-parser bundle with esbuild 0.28
zalo Aug 13, 2026
760962a
Freeze 4 more build123d example regressions (29 total)
zalo Aug 13, 2026
b9751a3
Harness defaults-audit table + docs sync for the 117/126 round
zalo Aug 13, 2026
4862a56
Bump opencascade.js: complete ocp_gordon binding surface (BSplCLib, r…
zalo Aug 13, 2026
1a96457
Gordon curve-network surface engine (ocp_gordon port) wired into buil…
zalo Aug 13, 2026
4e293f0
build123d-lite: surface locations, orientation flips, wire projection
zalo Aug 13, 2026
02ee2d0
Gordon surface realization: least-squares fit, not interpolation — br…
zalo Aug 13, 2026
02c494a
Record kernel seam/orientation experiment: identical loci (Hausdorff …
zalo Aug 13, 2026
144f911
build123d-lite: wrap()/wrap_faces() — flat geometry conformed onto a …
zalo Aug 13, 2026
5a13092
make_face cleans like build123d — bicycle_tire PASS (119)
zalo Aug 13, 2026
dec47f3
build123d-lite: one-sided offsets of open lines (offset(side=Side.LEF…
zalo Aug 13, 2026
f704c72
Freeze bracelet, bicycle_tire and offset(side=) as regression tests
zalo Aug 13, 2026
07f5ba6
docs: upstream build123d PR draft for canonical free-edge parametrisa…
zalo Aug 13, 2026
d6c1293
Correct kernel experiment doc: parametrization delta was an API artef…
zalo Aug 13, 2026
bb1ce0f
Docs: 119 PASS coverage, defaults-audit verdicts, new COMPROMISE inde…
zalo Aug 13, 2026
0931f39
Kernel primitives for canonical free-edge parametrization
zalo Aug 13, 2026
054881b
docs: retarget the canonical free-edge PR at build123d dev
zalo Aug 13, 2026
aab58e6
build123d-lite: canonical free-edge parametrization
zalo Aug 13, 2026
9e06e0f
Cross-kernel harness: lite canonical() on 8.0.1 vs patched upstream o…
zalo Aug 13, 2026
6ebe7b9
Freeze the canonical free-edge rule as Playwright tests (54 -> 57)
zalo Aug 13, 2026
cf9024e
CI: 360s timeout for frozen build123d examples (heavy scripts flake o…
zalo Aug 13, 2026
c6efda4
Fix multi-stage GUI tools destroying the model on the second drag
zalo Aug 13, 2026
9ce69b9
docs: sort tie-break becomes opt-in after dev suite feedback
zalo Aug 13, 2026
63531f2
Realign the canonical port with the retargeted patch: opt-in sort tie…
zalo Aug 13, 2026
01ca16b
Docs: note why lite concatenates re-seamed loops itself
zalo Aug 13, 2026
eaa8119
Default to Python (build123d) mode, serialize the mode in share URLs
zalo Aug 13, 2026
cef1899
Tests for the pointer-gesture fix, mode defaults and share-URL round-…
zalo Aug 13, 2026
68c5a23
Docs: CLAUDE.md — suite is 66 tests, plus the pending GUI-gesture/mod…
zalo Aug 13, 2026
8dd72d9
Make the real-pointer tool tests camera-independent; fix Everything E…
zalo Aug 13, 2026
eb4c7d5
Restore the multi-stage tool gesture fix (accidentally reverted in 68…
zalo Aug 13, 2026
f52981e
docs: canonical seam no longer depends on sampling phase or traversal
zalo Aug 13, 2026
54bab58
Mirror the three canonical-seam defect fixes from the patch (f52981e …
zalo Aug 13, 2026
d4636e1
Refresh canonical expectations for the moved mirror-symmetric seams
zalo Aug 13, 2026
2fd079a
Docs: 67 tests (the reversed-traversal canonical regression)
zalo Aug 13, 2026
a3dd88b
Python starter: point the "more ops" comment at the build123d docs
zalo Aug 13, 2026
b879b31
show() defines the scene; starter points at the real coverage docs
zalo Aug 13, 2026
a2a1847
Tools return to Select after committing
zalo Aug 13, 2026
982ca93
docs: split the canonical-edges PR into three small patches
zalo Aug 13, 2026
8573158
Decode raw OCCT wasm exceptions; broaden the b123d corpus to 232 scripts
zalo Aug 13, 2026
a4b99af
build123d-lite: real Select.LAST/NEW, new_edges, os shim and 12 doc-A…
zalo Aug 14, 2026
dbaaac7
Builder-scoped location contexts, property selectors, 45 frozen tests…
zalo Aug 14, 2026
07aafd6
Regenerate report.md with the updated defaults audit
zalo Aug 14, 2026
2870b04
build123d-lite: topology-selection properties + exact convex hull
zalo Aug 14, 2026
eab1bcf
Move upstream-canonical-edges research out of this repo
zalo Aug 14, 2026
07fc4a0
build123d-lite: conic, spline and constrained 1-D objects (9 scripts)
zalo Aug 14, 2026
ab0e915
build123d-lite: Wedge, ConvexPolyhedron, text-on-path, topo_distance_to,
zalo Aug 14, 2026
3a40efc
build123d-lite: 2-D offset of faces + upstream's sketch-face alignment
zalo Aug 14, 2026
bef373e
build123d-lite: upstream's taper-extrude branch + mid-context BuildLi…
zalo Aug 14, 2026
bfb51aa
Docs + five frozen landmarks for the selectors/1-D-solver round
zalo Aug 14, 2026
01a34ab
build123d-lite: closed-form ConstrainedArcs / ConstrainedLines (circl…
zalo Aug 14, 2026
3a80e98
Mark COMPROMISE(traversal-order) at its source (ShapeList.sort_by ties)
zalo Aug 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
352 changes: 347 additions & 5 deletions CLAUDE.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ <h1 hidden></h1>
<select id="editorMode" class="topnav-select" title="Editor Language Mode">
<option value="cascadestudio">CascadeStudio JS</option>
<option value="openscad">OpenSCAD</option>
<option value="python">Python (build123d)</option>
</select>
</div>
</div>
Expand Down
139 changes: 134 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added packages/cascade-core/fonts/FreeSans.ttf
Binary file not shown.
Binary file added packages/cascade-core/fonts/FreeSansBold.ttf
Binary file not shown.
Binary file not shown.
Binary file added packages/cascade-core/fonts/FreeSansOblique.ttf
Binary file not shown.
Binary file not shown.
6 changes: 4 additions & 2 deletions packages/cascade-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@
"types/"
],
"dependencies": {
"opencascade.js": "github:zalo/opencascade.js#cascadestudio-v2",
"brython": "^3.14.3",
"opencascade.js": "github:zalo/opencascade.js#cascadestudio-v3-occt801",
"openscad-parser": "^0.6.3",
"opentype.js": "^1.3.4",
"potpack": "^2.0.0"
"potpack": "^2.0.0",
"quickhull3d": "^3.1.2"
}
}
12 changes: 10 additions & 2 deletions packages/cascade-core/scripts/build.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ if (fs.existsSync(distDir)) {
}
fs.mkdirSync(distDir, { recursive: true });

// 1. Bundle the worker entry point
// 1. Regenerate the oc.* symbol manifest, then bundle the worker entry point
require('./generate-occt-symbols.cjs');
console.log('[cascade-core] Bundling worker...');
execFileSync(npx, [
'esbuild',
Expand All @@ -38,7 +39,14 @@ if (fs.existsSync(wasmSrc)) {
fs.copyFileSync(wasmSrc, path.join(distDir, 'cascadestudio.wasm'));
}

// 3. Copy fonts to dist/fonts/
// 3. Copy Brython (lazy-loaded by the worker for Python/build123d mode)
console.log('[cascade-core] Copying Brython...');
const brythonSrc = path.join(monoRoot, 'node_modules', 'brython', 'brython.js');
if (fs.existsSync(brythonSrc)) {
fs.copyFileSync(brythonSrc, path.join(distDir, 'brython.js'));
}

// 4. Copy fonts to dist/fonts/
console.log('[cascade-core] Copying fonts...');
const fontsDir = path.join(pkgRoot, 'fonts');
const distFontsDir = path.join(distDir, 'fonts');
Expand Down
35 changes: 35 additions & 0 deletions packages/cascade-core/scripts/generate-occt-symbols.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* Scans the worker sources for every `oc.<Symbol>` reference and writes
* UsedOCCTSymbols.generated.js. The worker verifies this list against the
* loaded WASM at startup.
*
* Why: the Embind binding generator derives numbered overload suffixes
* (e.g. BRepBuilderAPI_MakeEdge_24) from each class's overload set. A new
* OCCT version can silently renumber them, which previously surfaced only
* as cryptic "not a constructor" errors deep inside user evaluations.
*/
const fs = require('fs');
const path = require('path');

const workerDir = path.join(__dirname, '..', 'src', 'worker');
const outFile = path.join(workerDir, 'UsedOCCTSymbols.generated.js');

const symbols = new Set();
for (const file of fs.readdirSync(workerDir)) {
if (!file.endsWith('.js') || file.endsWith('.generated.js')) { continue; }
const src = fs.readFileSync(path.join(workerDir, file), 'utf8');
for (const m of src.matchAll(/\boc\.([A-Za-z_][A-Za-z0-9_]*)/g)) {
symbols.add(m[1]);
}
}

const sorted = [...symbols].sort();
const banner =
'// GENERATED by scripts/generate-occt-symbols.cjs — do not edit.\n' +
'// Every oc.* symbol referenced by the worker sources. Verified against\n' +
'// the loaded OpenCascade module at startup (see CascadeWorker.init).\n';
fs.writeFileSync(
outFile,
banner + 'export const USED_OCCT_SYMBOLS = ' + JSON.stringify(sorted, null, 2) + ';\n'
);
console.log(`[cascade-core] ${sorted.length} oc.* symbols -> ${path.relative(process.cwd(), outFile)}`);
11 changes: 7 additions & 4 deletions packages/cascade-core/src/engine/CascadeEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,19 @@ class CascadeEngine {

/** Evaluate CAD code and return mesh data.
* Fires intermediate events (log, addSlider, etc.) in real-time.
* `language` selects the worker runtime ('cascadestudio' default;
* 'python' evaluates build123d-lite code via Brython).
* Returns: { meshData: { faces, edges }, sceneOptions, logs, errors } */
async evaluate(code, { guiState = {}, maxDeviation, sceneOptions } = {}) {
async evaluate(code, { guiState = {}, maxDeviation, sceneOptions, language } = {}) {
if (!this._ready) throw new Error('CascadeEngine not initialized. Call init() first.');

this._working = true;

// Send evaluation command (fire-and-forget — worker processes asynchronously)
this._messageBus.send('Evaluate', {
code,
GUIState: guiState
GUIState: guiState,
language
});

// Request meshing — this returns a Promise that resolves with [facesAndEdges, sceneOptions]
Expand All @@ -83,9 +86,9 @@ class CascadeEngine {

if (!result) return { meshData: null, sceneOptions: {} };

const [[faces, edges], resultSceneOptions] = result;
const [[faces, edges], resultSceneOptions, shapeLines] = result;
return {
meshData: { faces, edges },
meshData: { faces, edges, shapeLines: shapeLines || [] },
sceneOptions: resultSceneOptions || {}
};
}
Expand Down
Loading
Loading