Documentation

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.

25 topicsverify-gated examples

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

packages/docs-examples/src/core/document.ts, units.ts

ok

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

packages/docs-examples/src/core/projection.ts → @slopcad/ui CadViewport

rendering…

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

packages/docs-examples/src/kernel/primitives.ts

running…

Feature regeneration through the kernel bridge

packages/docs-examples/src/kernel/features.ts

running…

Reusable components: contract + kernel build

packages/docs-examples/src/components/components.ts

running…

Native format: the one that keeps history

packages/docs-examples/src/core/native.ts

ok

text bytes
2100
replayed transactions
3
reopened holeDiameter
12 mm
resave identical
yes
validator issues
0

STL / 3MF / GLB: deterministic bytes

packages/docs-examples/src/io/mesh.ts

ok

STL bytes (12 triangles)
684
STL deterministic
yes
3MF bytes · unit
2190 B · millimeter
GLB bytes
1012 B
download the example's plate.stl

Sketch solve: degrees of freedom, honestly counted

packages/docs-examples/src/sketch/sketch.ts

ok

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

packages/docs-examples/src/sketch/vocabulary.ts

ok

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

packages/docs-examples/src/react/store.tsx

ok

interaction
click the button
holeDiameter1001

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.

Declared capabilities of the four geometry kernel backends
capabilitymanifoldopencascadejscadfake
booleanssupportedsupportedsupportedsupported
translatesupportedsupportedsupportedsupported
rotatenot supportedsupportedsupportednot supported
exact primitive vol.supportedsupportedsupportedsupported
exact boolean vol.supportedsupportednot supportednot supported
tight boolean boundssupportedsupportedsupportednot supported
persistent topologynot supportedsupportednot supportednot supported
sweepnot supportedsupportedsupportedsupported
loftnot supportedsupportedsupportedsupported
filletnot supportedsupportednot supportedsupported
chamfernot supportedsupportednot supportedsupported
shellnot supportedsupportednot supportedsupported
mirrorsupportedsupportedsupportedsupported
surface areasupportedsupportedsupportedsupported

✓ 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.

Which exchange formats preserve parametric history
formatdirectionwhat a file carriesparametric history
Native slopcad documentsave / openParameters with expressions, feature graph, bodies, the full transaction log (undo/redo reach), regeneration states, rollback markerpreserved
STEP (AP214IS / AP203 / AP242DIS)export / importBREP solids in canonical millimetres; import mints provenance-marked solids (origin "imported-step")—
OCCT BREPexport / importBREP solids; import provenance "imported-brep"—
IGESimportMeshes only (the occt-import-js fallback reads tessellations, never BREP solids), the same class of body an STL import produces—
STL (binary)export / importOne triangle soup per solid, canonical millimetres, no part structure—
3MFexport / importMesh + well-known metadata (Title/Designer/Description) + declared unit; import is Node-targeted (node:zlib)—
GLB (glTF 2.0)exportThe render projection: one named node per render object, POSITION/NORMAL accessors, the CadScene material—

Foundations

  • Installation

    docs/guides/installation.md

    Monorepo checkout, the verify gate, and the external-consumer registry install.

  • CAD core

    docs/guides/cad-core.md

    The kernel-neutral document: bodies, parameters, features, ids, diagnostics.

    example: packages/docs-examples/src/core/document.ts

  • Parameters

    docs/guides/parameters.md

    The parameter collection: creation, metadata, expressions, edits as commands.

    example: packages/docs-examples/src/core/document.ts

  • Expressions

    docs/guides/expressions.md

    The expression engine: AST, unit literals, functions, dependency extraction.

    example: packages/docs-examples/src/core/document.ts

  • Units

    docs/guides/units.md

    Dimensional values: length/angle/area/volume, conversion, dimensioned arithmetic.

    example: packages/docs-examples/src/core/units.ts

Geometry

  • Primitives

    docs/guides/primitives.md

    Box, sphere, cylinder, cone through the kernel contract, measured and tessellated.

    example: packages/docs-examples/src/kernel/primitives.ts

  • Booleans

    docs/guides/booleans.md

    Union, subtract, intersect: exact for mesh kernels, banded for the fake.

    example: packages/docs-examples/src/kernel/primitives.ts

  • Features

    docs/guides/features.md

    The feature graph, transactions, undo/redo, regeneration, rollback, suppression.

    example: packages/docs-examples/src/kernel/features.ts

  • Kernels

    docs/guides/kernels.md

    The pluggable kernel contract and the capability flags every backend declares.

    example: packages/docs-examples/src/kernel/capabilities.ts

  • Workers

    docs/guides/workers.md

    The versioned worker protocol: node channels, web workers, stale-result guards.

    example: packages/docs-examples/src/kernel/workers.ts

Rendering & interaction

  • R3F

    docs/guides/r3f.md

    The renderer-neutral projection and the React Three Fiber scene that consumes it.

    example: packages/docs-examples/src/core/projection.ts

  • Selection

    docs/guides/selection.md

    Selection state, pick modes, synthetic faces, persistent topology references.

    example: packages/docs-examples/src/core/projection.ts

  • Tools

    docs/guides/tools.md

    The headless tool system: runtime, manager, registry, inspection tools.

    example: packages/docs-examples/src/core/custom-tool.ts

  • UI

    docs/guides/ui.md

    The @slopcad/ui CAD components and their installation through the registry.

Data exchange

  • Native files

    docs/guides/native-files.md

    The 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.md

    The 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.md

    The OpenCascade exchange paths: exact BREP solids in, geometry-only provenance out.

    example: packages/docs-examples/src/kernel/occt.ts

Sketching

  • Sketches

    docs/guides/sketches.md

    Workplanes, entities, serialization, profile resolution for extrusion.

    example: packages/docs-examples/src/sketch/sketch.ts

  • Constraints

    docs/guides/constraints.md

    The constraint vocabulary and the deterministic reference solver.

    example: packages/docs-examples/src/sketch/sketch.ts

Distribution

  • Registry

    docs/guides/registry.md

    The Phase 33 registry model: three source registries, byte-reproducible artifacts.

  • Reusable components

    docs/guides/components.md

    The component contract, the execution surfaces, and the shipped three.

    example: packages/docs-examples/src/components/components.ts

  • Custom tools

    docs/guides/custom-tools.md

    Writing a tool: state, reducer, registry entry, manager lifecycle.

    example: packages/docs-examples/src/core/custom-tool.ts

  • Custom kernel adapters

    docs/guides/custom-kernels.md

    Implementing the kernel contract; the shared suite judges any backend.

    example: packages/docs-examples/src/kernel/custom-adapter.ts

Engineering

  • Testing

    docs/guides/testing.md

    The contract suite, semantic assertions, in-memory database, e2e harnesses.

    example: packages/docs-examples/src/contract-suite.test.ts

  • Package boundaries

    docs/guides/package-boundaries.md

    What may import what: the allowed-import map and its enforcement.