The slopcad documentation
Every guide lives in the repository under docs/guides/, and every primary public API gets a runnable example under packages/docs-examples/ that the workspace gates typecheck, build, and run. pnpm verify proves them, this page proves them again in your browser. The tables below are generated from the same source constants the code declares, not hand-maintained copies.
Live examples
Browser-runnable, measured. The async cards boot the real Manifold WASM kernel in-process, and the numbers are the kernel's own measurements.
Document, parameters, expressions, units
okpackages/docs-examples/src/core/document.ts, units.ts
- holeDiameter
- 10 → 12.5 mm
- volumeHint = holeDiameter × 2
- 20 → 25
- timeline
- translate
- 1 inch
- 25.4 mm
- 2in × 40mm × 5mm
- 10160.00 mm³
Render proof: the projected plate, live
rendering…packages/docs-examples/src/core/projection.ts → @slopcad/ui CadViewport
The same kernel-neutral projection data the GLB exporter consumes, drawn by the registry's own CAD viewport component: geometry, camera, and lights from the deterministic scene, no host state.
pending
Primitives and booleans: real Manifold geometry
running…packages/docs-examples/src/kernel/primitives.ts
Feature regeneration through the kernel bridge
running…packages/docs-examples/src/kernel/features.ts
Reusable components: contract + kernel build
running…packages/docs-examples/src/components/components.ts
Native format: the one that keeps history
okpackages/docs-examples/src/core/native.ts
- text bytes
- 2101
- replayed transactions
- 3
- reopened holeDiameter
- 12 mm
- resave identical
- yes
- validator issues
- 0
STL / 3MF / GLB: deterministic bytes
okpackages/docs-examples/src/io/mesh.ts
- STL bytes (12 triangles)
- 684
- STL deterministic
- yes
- 3MF bytes · unit
- 2190 B · millimeter
- GLB bytes
- 1012 B
Sketch solve: degrees of freedom, honestly counted
okpackages/docs-examples/src/sketch/sketch.ts
- dof before constraints
- 12
- dof after
- 0
- |AB| solved
- 50.000000 mm
- profile signed area
- 600.000 mm²
- serialize round trip
- exact
Sketch vocabulary: ellipses, splines, and slots
okpackages/docs-examples/src/sketch/vocabulary.ts
- ellipse dof bare → constrained
- 5 → 0
- solved semi-axes
- 8.000000 × 5.000000 mm
- spline interior dof (endpoints pinned)
- 4
- slot loop area (πr² + 2rL)
- 52.566 mm²
- serialize round trip
- exact
React integration: live parameter edit
okpackages/docs-examples/src/react/store.tsx
- interaction
- click the button
Kernel capability matrix
What each backend declares it can do, read from the kernels' own capability constants (packages/docs-examples/src/kernel/capabilities.ts). A declined operation answers the structured kernel/unsupported-operation, never a silently wrong result.
| capability | manifold | opencascade | jscad | fake |
|---|---|---|---|---|
| booleans | supported | supported | supported | supported |
| translate | supported | supported | supported | supported |
| rotate | supported | supported | supported | not supported |
| exact primitive vol. | supported | supported | supported | supported |
| exact boolean vol. | supported | supported | not supported | not supported |
| tight boolean bounds | supported | supported | supported | not supported |
| persistent topology | not supported | supported | not supported | not supported |
| sweep | not supported | supported | supported | supported |
| loft | not supported | supported | supported | supported |
| fillet | not supported | supported | not supported | supported |
| chamfer | not supported | supported | not supported | supported |
| shell | not supported | supported | not supported | supported |
| mirror | supported | supported | supported | supported |
| surface area | supported | supported | supported | supported |
✓ declared · — declined (answers kernel/unsupported-operation)
Formats and parametric history
One format preserves the parametric model. Everything else is geometry exchange: deliberate, provenance-marked, and never a fake history.
| format | direction | what a file carries | parametric history |
|---|---|---|---|
| Native slopcad document | save / open | Parameters with expressions, feature graph, bodies, the full transaction log (undo/redo reach), regeneration states, rollback marker | preserved |
| STEP (AP214IS / AP203 / AP242DIS) | export / import | BREP solids in canonical millimetres; import mints provenance-marked solids (origin "imported-step") | — |
| OCCT BREP | export / import | BREP solids; import provenance "imported-brep" | — |
| IGES | import | Meshes only (the occt-import-js fallback reads tessellations, never BREP solids), the same class of body an STL import produces | — |
| STL (binary) | export / import | One triangle soup per solid, canonical millimetres, no part structure | — |
| 3MF | export / import | Mesh + well-known metadata (Title/Designer/Description) + declared unit; import is Node-targeted (node:zlib) | — |
| GLB (glTF 2.0) | export | The render projection: one named node per render object, POSITION/NORMAL accessors, the CadScene material | — |
Foundations
Installation
docs/guides/installation.mdMonorepo checkout, the verify gate, and the external-consumer registry install.
CAD core
docs/guides/cad-core.mdThe kernel-neutral document: bodies, parameters, features, ids, diagnostics.
example: packages/docs-examples/src/core/document.ts
Parameters
docs/guides/parameters.mdThe parameter collection: creation, metadata, expressions, edits as commands.
example: packages/docs-examples/src/core/document.ts
Expressions
docs/guides/expressions.mdThe expression engine: AST, unit literals, functions, dependency extraction.
example: packages/docs-examples/src/core/document.ts
Units
docs/guides/units.mdDimensional values: length/angle/area/volume, conversion, dimensioned arithmetic.
example: packages/docs-examples/src/core/units.ts
Geometry
Primitives
docs/guides/primitives.mdBox, sphere, cylinder, cone through the kernel contract, measured and tessellated.
example: packages/docs-examples/src/kernel/primitives.ts
Booleans
docs/guides/booleans.mdUnion, subtract, intersect: exact for mesh kernels, banded for the fake.
example: packages/docs-examples/src/kernel/primitives.ts
Features
docs/guides/features.mdThe feature graph, transactions, undo/redo, regeneration, rollback, suppression.
example: packages/docs-examples/src/kernel/features.ts
Kernels
docs/guides/kernels.mdThe pluggable kernel contract and the capability flags every backend declares.
example: packages/docs-examples/src/kernel/capabilities.ts
Workers
docs/guides/workers.mdThe versioned worker protocol: node channels, web workers, stale-result guards.
example: packages/docs-examples/src/kernel/workers.ts
Rendering & interaction
R3F
docs/guides/r3f.mdThe renderer-neutral projection and the React Three Fiber scene that consumes it.
example: packages/docs-examples/src/core/projection.ts
Selection
docs/guides/selection.mdSelection state, pick modes, synthetic faces, persistent topology references.
example: packages/docs-examples/src/core/projection.ts
Tools
docs/guides/tools.mdThe headless tool system: runtime, manager, registry, inspection tools.
example: packages/docs-examples/src/core/custom-tool.ts
UI
docs/guides/ui.mdThe @slopcad/ui CAD components and their installation through the registry.
Data exchange
Native files
docs/guides/native-files.mdThe one format that preserves parametric history: dual-persisted, replay-checked.
example: packages/docs-examples/src/core/native.ts
STL / 3MF / GLB
docs/guides/mesh-exchange.mdThe cad-io mesh adapters: deterministic bytes, one file per solid, GLB scenes.
example: packages/docs-examples/src/io/mesh.ts
STEP / IGES
docs/guides/step-iges.mdThe OpenCascade exchange paths: exact BREP solids in, geometry-only provenance out.
example: packages/docs-examples/src/kernel/occt.ts
Sketching
Sketches
docs/guides/sketches.mdWorkplanes, entities, serialization, profile resolution for extrusion.
example: packages/docs-examples/src/sketch/sketch.ts
Constraints
docs/guides/constraints.mdThe constraint vocabulary and the deterministic reference solver.
example: packages/docs-examples/src/sketch/sketch.ts
Distribution
Registry
docs/guides/registry.mdThe Phase 33 registry model: three source registries, byte-reproducible artifacts.
Reusable components
docs/guides/components.mdThe component contract, the execution surfaces, and the shipped three.
example: packages/docs-examples/src/components/components.ts
Custom tools
docs/guides/custom-tools.mdWriting a tool: state, reducer, registry entry, manager lifecycle.
example: packages/docs-examples/src/core/custom-tool.ts
Custom kernel adapters
docs/guides/custom-kernels.mdImplementing the kernel contract; the shared suite judges any backend.
example: packages/docs-examples/src/kernel/custom-adapter.ts
Engineering
Testing
docs/guides/testing.mdThe contract suite, semantic assertions, in-memory database, e2e harnesses.
example: packages/docs-examples/src/contract-suite.test.ts
Package boundaries
docs/guides/package-boundaries.mdWhat may import what: the allowed-import map and its enforcement.