Skip to content

feat(featurescript): cut holes with std's extrude locally, on opencascade - #129

Merged
AadiJo merged 1 commit into
mainfrom
featurescript-geometry
Oct 30, 2026
Merged

AadiJo merged 1 commit into
mainfrom
featurescript-geometry

Conversation

@AadiJo

@AadiJo AadiJo commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

A local preview has to produce geometry. This adds a geometry layer on OpenCascade (WASM) so std's own modeling features run locally, starting with what a typical "cut holes into a face" script needs.

  • src/geometry/Model.ts keeps a topology registry. Every body, face, edge and vertex gets a transient id that survives operations through OpenCascade's history, records the feature that created it (what qCreatedBy answers), and carries attributes. State is immutable, so std's feature rollback stays cheap. Seam edges and full-circle vertices are left out, so topology counts match Onshape's.
  • Builtins for sketches (lines, circles, arcs, points, regions), opExtrude, opBoolean, opDeleteBodies, evPlane, attributes, and the query types std's extrude path uses. Std's fCuboid and extrude run unmodified.
  • Preview output: tessellation to GLB with the previewed feature's faces in amber.
  • Corpus cases (corpus/<case>/case.json) are the gate: test/corpus.e2e.test.ts runs each one, checks statuses, volumes and topology counts, and writes a PNG, GLB and JSON report to .cadsense/fs-corpus/<case>/.

Stacked on #128.

Testing: vp test run in packages/featurescript, 333 tests. The bolt circle case cuts six 5 mm holes through a 100 x 60 x 10 mm plate through std's real extrude. The volume matches the analytic 58821.9028 mm³ and the counts are 12 faces, 24 edges and 8 vertices, in about 80 ms. Geometry tests cover rollback of a failed feature's geometry and transient ids across features.

Not yet checked against Onshape recordings: plane origins from evPlane, sketch body structure, and query result order are listed as open in FeatureScript.md.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@vercel

vercel Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cadsense Ready Ready Preview Oct 30, 2026 5:43pm UTC

@AadiJo
AadiJo changed the base branch from featurescript-interpreter to main October 30, 2026 17:38
@AadiJo
AadiJo force-pushed the featurescript-geometry branch from 1c4d37c to 1af9be7 Compare October 30, 2026 17:38
@AadiJo
AadiJo merged commit 92c8a70 into main Oct 30, 2026
1 check was pending

This branch was successfully deployed

1 active deployment
Preview — 1af9be74 Deployed Oct 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant