Getting started
Run the app
bash
yarn install
yarn dev # app-server on :4000 + web app on :1420Open <http://localhost:1420>, create a project, then add a sheet and choose CAD part or CAD assembly in the New sheet dialog.
The CAD editor is loaded as a lazy chunk: the app shell never imports OCCT or Babylon. Evaluation runs in a module Web Worker that loads the OCCT wasm once per page.
Create your first part
- New sheet → CAD part. The starter program evaluates to a simple block.
- Click Sketch in the feature toolbar at the bottom of the viewport. The viewport turns normal to the XY plane and enters sketch mode.
- Draw a rectangle (two clicks) — the sketch block is appended to the source.
- Click Extrude; the last sketch is picked automatically. Drag the yellow depth arrow or type a depth, choose an
Operation, then click the green check. The block is committed and the part re-evaluates. - Click the
Extrude 1row in the feature tree to re-open its dialog, or Show in source to jump to the generated statements.
Every action wrote source. Open the Source panel to see the marked blocks.
Commands for CAD work
| Command | What it does |
|---|---|
yarn test:cad-editor | Jest suite for the workbench source layer (tools, sketches, assembly placement, terrain, pipes). |
yarn test:cad-kernel | Node tests for the OCCT kernel: translation, tessellation, STEP import/export, assembly composition, pipe/DEM meshes. |
yarn test:cad-featurescript | Parser/interpreter, source spans, execution trace and history projection. |
yarn test:cad-workbench | Browser acceptance: creates CAD sheets, drives tools and gizmos, exports, reloads. Needs both dev servers. |
yarn test:cad-cfd | Browser acceptance for the CFD mapping slice. |
yarn cad:kernel | Build @indispec/cad-kernel (required before the kernel tests). |
Where the code lives
| Package | Responsibility |
|---|---|
packages/cad/featurescript | Vendored FeatureScript engine: lexer, parser, interpreter, regions, execution trace, history projection, assembly recorder. |
packages/cad/kernel | OCCT kernel of record: geometry translation, tessellation, exact metrics, STEP import/export, pipe and DEM meshes, assembly composition. Also exposes a browser entry point. |
packages/editors/cad | The workbench UIs (CadPartEditor, CadAssemblyEditor), tool-to-source compilers, viewer, worker, CFD pane, terrain picker. |
packages/types/sld-types | Page types, CAD payload types, starter sources. |
The one rule
Never mutate derived geometry. The viewport, feature tree and metrics are read-only views of an evaluation. If you need to change the model, change the program — through a tool block compiler (tooling.ts, assembly-tooling.ts) or the source editor. That rule is what keeps undo, collaboration and review working.