lmcad is a native lmcode host for parametric 3D solids: OpenCASCADE B-rep modelling, volume checks, and a built-in software renderer that writes PNG, APNG, STL and OBJ with no GPU or display. This page is the quick reference for lmcad 0.1.5; programs are lmscript files with a _lmcode_ block run by run_lmcode.
Install and run
npm install -g @lmctl-ai/lmctl # lmscript + lmctl (Node.js >= 24)
export GITHUB_TOKEN=$(gh auth token) # optional: avoids GitHub API rate limits on first install
lmctl autorun https://raw.githubusercontent.com/lmctl-ai/lmcad/main/examples/gear-train.lms
lmscript --check model.lms # compile the blocks only
lmscript model.lms # compile and run
Minimal program
mkdir("images");
p = _lmcode_ cli="lmcad" install="github:lmctl-ai/lmcad@latest";
let shape = scene.box(2.0, 3.0, 4.0, material().color(0.2, 0.55, 0.85));
scene.assert_close(shape.volume(), 24.0, 0.000001);
scene.fit_camera(42.0, 1.2);
scene.directional_light(-0.5, -1.0, -0.4, 0.8);
scene.ambient(0.2);
scene.render_png("images/box-volume.png", 320, 240);
end _lmcode_
r = run_lmcode(p);
if (!r.ok) { println(r.stderr + r.stdout); }
assert(r.ok);
println("wrote images/box-volume.png");
Host protocol
Command
Effect
lmcad --version
Prints lmcad X.Y.Z. The release tag vX.Y.Z and the binary version must agree for install="github:lmctl-ai/lmcad@latest".
lmcad --lmcode-schema
Prints a compact summary: the context line, then free functions, then members grouped by type.
lmcad --lmcode-schema --json
Prints the embedded schema bytes exactly (dsl.schema 2, name lmcad). This is the compiler input.
lmcad --lmcode-signatures
Prints the canonical signature list of the host registry, host and standard: 271 lines in 0.1.5.
lmcad --lmcode FILE [FILE ...]
Runs compiled program files in argument order. Objects and scene state persist between files; locals are fresh for each file. The first failure stops execution.
Exit code
Meaning
0
Success; one JSON result line per completed block.
2
Invalid command line. The host prints its usage line and a CLI_USAGE result (phase cli).
3
Program file load failure or a block or host run failure.
4
Another application failure.
Context, types and functions
Name
Kind
Role
scene
Context object of type Scene
The one entry point of a block.
Scene
Host type
Solids, sketches, lights, cameras, renders, exports and assertions.
Shape
Host type
Handle to an OpenCASCADE solid: transforms, booleans, edge treatment, volume and bounds.
Sketch
Host type
Straight-segment 2D polygon to extrude or revolve.
Material
Host type
Display color and Blinn-Phong surface parameters.
Camera
Host type
View returned by camera and fit_camera.
Light
Host type
Directional or fill light.
Animation
Host type
APNG writer.
Keyframes
Host type
Collection read from CSV; supports len, at and for-in iteration.
scene.render_png, render_ppm, export_stl, export_obj, scene.animation with add_frame and finish
lmcad 0.1.5 ships 206 standard-library signatures (the lmcode_std_v3 catalog at 206). The current lmcode_std_v3 catalog has 226 signatures, adding the REST and CLI interfaces; lmcad picks those up when it syncs and releases, and the 0.1.5 binary does not register them. Full signatures are in the reference.
Gallery
A plate cut with a loop of cylinder bores.A patterned brick built by looping over unions.A hollow vessel made from a revolved sketch.A revolved cup body with a fused handle.One frame from a CSV-keyframed tween.
More
Skill: rules for generating and checking lmcad scripts.
User guide: concepts, outputs, limits and troubleshooting.
Reference: every flag, exit code, type, method and standard signature.
Tutorial: render a scene, a range loop and a tween animation.
Quickruns: run lmcad tasks with a solo Lead or a Lead, Coder and Reviewer.