Cadpole
Cadpole
A turbojet engine model, assembled

Drag to orbit · two fingers or scroll to move · pinch to zoom · double-tap to centre

Open source · script-first

Parametric CAD for bots.

Your agent builds the model and checks its own work: it measures, renders and runs the model's tests. Every dimension is a parameter. The bot sets it, you drag it, the model rebuilds.

  • Parts and assemblies
  • Buildings and plans
  • MCP server
  • STEP, STL, 3MF
  • Apache-2.0

One script, a whole assembly

A whole engine, one model.

Fan, three compressor stages, combustor, turbine and nozzle: 108 parts in one nested assembly from turbojet.star. Blade counts, radii and clearances are parameters an agent, or you, can change.

One script, a whole assembly

Cut open by a flag.

cutaway = True takes a wedge out of every casing, frame and vane ring, so the rotor, the liner and the fuel injectors show. cutaway_angle sets how far it opens.

One script, a whole assembly

Pull it apart.

explode is a parameter like any other. Every stage slides out along the shaft, and the bolts go with their flanges.

One script, a whole assembly

It checks itself.

Fan, compressor, combustor, turbine, nozzle. The model's own tests measure the tip clearance of every blade, so whoever changes it knows at once whether it still fits.

Work with an agent

Ask for a change. Watch the part follow.

Cadpole has an MCP server, so a coding agent can build and edit the model, check the result and see what you have selected in the 3D view. It works with your own Claude Code install. Cadpole ships no agent of its own.

The Cadpole web app with a bracket model and a Messages panel where a request to an agent is typed

Turn Listen on, then type a request in the Messages box.

  1. Turn Listen on, then type a request in the Messages box.
  2. The agent edits the script. The bracket is 1 in wider, with two mounting holes in the base.
  3. Its reply streams in as it works.
  4. Click a face to select it, then ask about "this face".
  5. The agent reads the selection and puts two holes through that face.
  6. It says what it did.

Real session, sped up. No sound.

Two kinds of work

Parts and buildings, one engine.

Cadpole models mechanical parts and it models buildings. An agent drives both through the same operations, so this page shows them one after the other and then what they share.

A herringbone planetary gear set, assembled as printed

Parts and assemblies

Brackets, enclosures, gears, threads, mechanisms that move and whole assemblies, in millimetres, to print, machine or draw.

  • Assemblies
  • Gears
  • Threads
  • Print checks
  • STEP, 3MF
A small cabin with its roof removed, showing the rooms

Buildings and plans

Massing, lots and terrain, floor plans, sun and shadow, sightlines and drawing sets, in feet and inches.

  • Floor plans
  • Sites
  • Sun and shadow
  • Layout solver
  • Sheet sets

Shared by both: the operations an agent calls, parameters and sweeps, tests, renders, dimensioned drawings, exports and the viewer. The building side is a set of libraries on top; a part never touches it.

Part one

Parts and assemblies.

The turbojet at the top is this kind of work. Next: a mechanism that prints in place, artwork turned into relief, an engine taken apart, and a part you can change in the browser.

On GitHub: the guide to parts and assemblies.

A closed eight-blade iris mechanism

Drag to orbit · two fingers or scroll to move · pinch to zoom · double-tap to centre

Mechanisms that move

An iris that prints in place.

Eight blades on pivots under a slotted ring. Blade count, aperture and every clearance are parameters of iris.star.

Mechanisms that move

Turn the ring.

opening runs from 0 to 1. Each drive pin rides a spiral cam slot cut along its own path, so the ring turns 36 degrees from shut to open and the picture is the mechanism.

Mechanisms that move

Fully open.

The blades sit behind the lip. The gaps are whole layers, so it comes off the printer already moving.

A white cylindrical lamp shade in room light

Drag to orbit · two fingers or scroll to move · pinch to zoom · double-tap to centre

Artwork turned into relief

A picture in the wall.

lithophane() turns a picture into wall thickness: thin where it is light, thick where it is dark. In room light it is a plain white shade.

Artwork turned into relief

Turn the lamp on.

Dim the room and light the lamp inside. Thin wall glows, thick wall stays dark, and a moonrise comes up out of the plastic.

Artwork turned into relief

Turn the shade.

The picture runs all the way round: a moon over three ranges of hills, pines and stars, drawn by a function in lithophane_lamp.star. It prints upright in one piece.

A seven-cylinder radial engine model

Drag to orbit · two fingers or scroll to move · pinch to zoom · double-tap to centre

Explode, section, animate

Seven cylinders, one crank.

A radial engine with a master rod and six link rods. Turn crank and every piston goes where the geometry puts it.

Explode, section, animate

Take it apart.

Rods, pistons, barrels and heads move out along their own cylinders in layers, the propeller and nose case slide forward, and the crankshaft slides back. The keyframes live in the script, next to the parts.

Explode, section, animate

See inside.

The cutaway removes everything in front of the crank: the propeller, the nose case and the front half of the crankcase, barrels and heads. The master rod, its six link rods, the pistons and the valves show while it turns.

Parts and assemblies · try it here

Change the script. The part follows.

This is the real engine, compiled to WebAssembly and running in your browser. Move a slider or edit a line and the model is rebuilt from the script.

The part the script describes
Loads the engine once, about 9 MB

Rendered ahead of time. Start the engine to change it.

part.star

Part two

Buildings and plans.

The same engine at the scale of a house. Scripts write feet and inches, and optional libraries add rooms and storeys, lots and terrain, the sun, sightlines and a solver that places rooms. Every building, lot and rule below is invented.

On GitHub: the guide to buildings and plans.

Buildings and plans · floor plans

A plan from a list of rooms.

An invented two-bedroom cabin, 30 ft by 26 ft. Rooms are rectangles in feet; the walls, door swings, dimension strings, room areas, section and 3D model are all generated from them. The kitchen, the bath and both bedrooms are furnished by the layout solver, which keeps every clearance and the kitchen's work triangle.

14 ft

One parameter. Move it and the plan is redrawn: the living room, kitchen and deck widen, their areas and the dimension strings follow. Kitchen, bath and bedrooms placed by the layout solver; the living room by hand, held to the same rules by the script's tests.

Section
South elevation
More
cabin_plan.star
w = param("living_w", 14, unit="ft", min=12, max=20)
x0 = w + P             # east rooms start here
x1 = x0 + 14 + 8 / 12
xb, n = x0 + 5.5, 13.5 + P
TOP = 25.0             # the north wall's inside face
ROOMS = [
    rm("living", "Living", (0, w, 0, 13.5)),
    rm("kitchen", "Kitchen", (0, w, n, TOP), furnish = "kitchen_L"),
    rm("entry", "Entry", (x0, x1, 9.5 + P, 13.5)),
    rm("bed1", "Bedroom 1", (x0, x1, 0, 9.5), furnish = "full"),
    rm("bath", "Bath", (x0, xb, n, TOP), furnish = "tub"),
    rm("bed2", "Bedroom 2", (xb + P, x1, n, TOP), furnish = "full"),
]

Buildings and plans · sites and terrain

A lot, its ground and its rules.

An invented 40 ft by 80 ft parcel on a 25 % slope, modelled from the shapes site data comes in: corner coordinates, a surveyed profile and ground samples. The height rule is a body you can see and test against.

The envelope is geometry

The translucent blue volume is the height rule: 30 ft above the ground at every point (its 40 ft cap never bites on this lot). The house steps down the slope in three levels, the walk-out floor a level below the sidewalk on a filled terrace; a test fails when any of it leaves the envelope, and lowering the upper setback paints the part that does in red. The ground is drawn in 5 ft bands, so each edge is a contour.

More
Parcel40 ft × 80 ft
Slope25 %
Height limit above grade30 ft
Height cap40 ft
Upper floor setback15 ft
Tests in the script12 pass

Buildings and plans · sun and shadow

Where the shadow falls, as a number.

sun() places the sun for a latitude, a date and a time. shadow_study() returns the shadow a house throws on a neighbour's light court as an exact area, so a test can hold it at zero.

Nine tiles from one command

Three dates by three times of day: the June solstice, the equinox and the December solstice at 9, 12 and 3, looking down the slot between the house and the neighbour's light court. In 3D the court's footprint for the document's own date and hour is drawn in teal, and the line of sight from the sidewalk to the studio's roof lantern turns red where the house cuts it; widen the passage to 12 ft and it clears.

More
Lot50 ft × 100 ft
Proposed house30 × 40 × 30 ft
Shadow on the court, winter noon0 sq ft
Lantern from the sidewalk, 8 ft passagehidden
Lantern from the sidewalk, 12 ft passageseen
Tests in the script8 pass
cadpole render examples/shadow_study.star --shadow-study \ --sun 38,-140,2026-06-21,12:00,-9 -o study.png

Buildings and plans · layout optimisation

State the rules. The solver places the rooms.

opt is a linear and mixed-integer solver in the script language. This script gives four rooms minimum sizes and a limit on how long and narrow two of them may be, forbids overlaps, asks the kitchen to share 4 ft of wall with the living room and caps the floor area. The solver picks every size and position.

Proven optimal, and it says which rule decided

The answer names the rules that bind and what each costs. Here the floor-area cap, which counts two floors, sets the plate's depth; the outline above the rooms is that second floor. Whole floor plans fitted to a template over three storeys are the same kind of problem and run as background jobs.

More
Living room24 ft × 17 ft 1½ in
Kitchen9 ft × 11 ft
Bedroom10 ft × 11 ft
Bath5 ft × 11 ft
Floor plate24 ft × 28 ft 1½ in
Floor-area cap, two floors1,350 sq ft, 0 left
The problem45 variables, 58 rules
Resultoptimal
room_layout_opt.star
p = opt.problem(name="rooms")
depth = p.var("plate depth", min=20, max=MAX_DEPTH)
p.constrain(FLOORS * WIDTH * depth, max=CAP, name="floor-area cap")
apart("living", "kitchen")
shares_wall("kitchen", "living", DOOR)
sol = p.solve()

Buildings and plans · drawing sets

A drawing set from one export.

Sheets are part of the script: a cover with a table of the house at three setbacks, a site plan with 1 ft contours, floor plans with their rooms, stair, glazing and door swings dimensioned in feet and inches, a section and an elevation. One export() writes them as one PDF.

Sheet A3.0, section and elevation

The section runs down the slope through both floors and the roof, with the earth hatched and the 30 ft height line. The street elevation has its hidden lines removed and the buried lower level masked by the grade. Every dimension and level is the model's own length, written in feet and inches.

More
Sheets4
Sheet sizeARCH D, 36 × 24 in
Scale of this sheet3/16 in = 1 ft
Tests in the script5 pass
cadpole export examples/house_set.star --run-exports --out-dir .

Part three

What both share.

One engine underneath. The modelling operations, the drawings, the exports and the tools below work the same for a bracket and for a house.

Shared by both · modelling operations

Small scripts, real geometry.

The operations every model is built from, a bracket and a house alike. Each picture was made by a few lines of script: open one to read them, turn the model round or look over the drawing.

Shared by both · vector drawings

Lines, not pixels.

The model that renders also draws: hidden-line views, dimensioned sheets and hatched sections, written as SVG, PDF and DXF. A line is stored as its ends, so it stays sharp at any size.

8×

One camera, two kinds of output

A path-traced picture of a knurled thumbscrew and its nut, and the line drawing of the same model from the same parallel camera: edges in sight solid, edges behind dashed, the thread inside the nut among them. Drag the handle between the two. Zoomed in this far the picture has run out of pixels; the lines are drawn again at every size.

cadpole op Drawing --doc pair-thumbscrew.star --view sheet:V1 \ --format svg --tolerance 0.02

Shared by both · what comes out

Solids, drawings and print files.

The script is the source. Everything else is generated from it, so it never goes stale.

Files for the printer

One export() line per file. This set writes an STL per bin and a Bambu Studio 3MF: a plate per filament, every bin a named object.

  • STL
  • 3MF

Dimensioned drawings

Views, sections and dimensions drawn from the model as vectors, ready to print or send to a laser.

  • SVG
  • PDF
  • DXF

Bring your files

Read a mesh, a STEP part or a DXF profile, then keep working on it with the same operations: a sculpted owl fused to a drilled base, an exact pillow block filleted and fitted, an involute gear hubbed and keyed.

  • STL
  • STEP
  • DXF

Pictures and motion

Every image on this page came from cadpole render and cadpole animate. sweep draws a sheet of variants.

  • PNG
  • GIF

Shared by both · how it is driven

One engine, four ways in.

A model is a short script in Starlark, a small deterministic Python dialect: the same script gives the same model every time, wherever it runs. An agent writes it; you can too.

part.star
w = param("width", 60, unit="mm", min=50, max=120)
depth, thick = 30, 6
pitch = w - 16                 # screw centres, 8 mm in from each end
cb_r, cb_depth = 4, 3.0        # counterbore for a low socket head M4

plate = extrude(sketch(XY).rounded_rect(w, depth, 5), thick, name="plate")
plate = fillet(plate, 0.8, edges=plate.faces(normal=(0, 0, 1)).one().edges, name="edge")

# The counterbores are cut first, so each 4.5 mm screw hole then only
# pierces a floor. The centre bore is one cutter: a 12 mm cylinder through a
# 45-degree countersink cone, standing proud of the cone's top.
ends = [-pitch / 2, pitch / 2]
counterbored = subtract([plate] + [cylinder(cb_r, cb_depth + 2, at=(x, 0, thick - cb_depth)) for x in ends])
bore = union(cylinder(6, thick + 4, at=(0, 0, -1)), cone(4.5, 8.5, 4, at=(0, 0, thick - 3)))
part = subtract([counterbored, bore] + [cylinder(2.25, thick + 2, at=(x, 0, -1)) for x in ends], name="part")
part.material(color="#6fbfa8", roughness=0.35, metallic=0.3)
part.tessellation(tolerance=0.01)   # small round holes stay round up close

export(part, "part.stl")
Coding agents

An MCP server gives an agent every operation as a typed tool: evaluate a script, read the diagnostics, look at the render, read the measurements, run the tests, then try again.

Command line

render, sweep, animate, export, test and serve in one binary. It runs the same on Linux and on a Mac.

Web editor

cadpole serve opens an editor and a 3D view in the browser. It is the same engine as the command line, compiled to WebAssembly.

Tests

A script can measure itself: clearances, volumes, wall thickness. Every example in the repository runs under test.

Work with an agent · set it up

Connect your coding agent.

Let your agent do it: paste this, and it goes through the steps below with you.

Set up Cadpole's assistant integration from github.com/mikelikespie/cadpole (docs/assistant-integration.md): register its MCP server with claude mcp add, start cadpole serve on my script, and tell me when to restart you so you can wait for my messages.

Or step by step:

  1. Have Claude Code installed. Cadpole uses your own install and ships no agent of its own.

    claude --version
  2. Open your script in the web app.

    cadpole serve bracket.star
  3. Register Cadpole's MCP server, in your project folder.

    This adds it for you in this folder (the local scope); --scope project writes it to .mcp.json for everyone on the project. claude mcp list checks the connection and claude mcp remove cadpole takes it out.

    claude mcp add cadpole -- cadpole mcp
    Another MCP client, or by hand: .mcp.json
    { "mcpServers": { "cadpole": { "command": "cadpole", "args": [ "mcp" ] } } }
  4. Start Claude Code in that folder and ask it to wait for Cadpole. It runs cadpole listen in the background, which costs nothing until you send a message.

    claude

    Then ask it:

    Wait for messages from Cadpole in the background and act on them.
  5. Turn Listen on in the web app and type in the Messages box.

Any MCP client can connect the same way; only Claude Code has been tested. The feature is documented as assistant integration.

Cadpole is an independent project, not affiliated with or endorsed by the maker of Claude Code.

Get started

Point your agent at it, or follow the steps.

Cadpole builds on Linux (x86-64 or arm64) and macOS (Apple silicon), from source.

Ask your coding agent

Paste this into the agent you already use. The getting-started guide is written to be followed end to end: exact commands, what each system needs, and a check after every step.

Set up Cadpole from github.com/mikelikespie/cadpole: follow its getting-started guide (docs/getting-started.md), build the CLI, and render examples/bracket.star.

Or do it by hand

  1. Install Bazelisk as bazel

    Follow the official Bazelisk installation instructions for your system. It fetches the Bazel version the repository pins, and Bazel fetches the Rust, C++ and Node toolchains: you never run cargo or npm. Linux (x86-64 or arm64) also needs g++; macOS (Apple silicon) needs Xcode 27. The next step checks all of this and prints the command for anything missing.

  2. Clone and install

    Checks your machine, builds, and puts cadpole on your PATH. The first build compiles everything and takes a while (about 12 minutes on 8 cores, 25 GB of disk); later ones take seconds. Without installing, ./bin/cadpole … works from the checkout.

  3. Run a first example

    Render a picture: bracket.png shows a mounting bracket.

    cadpole render examples/bracket.star -o bracket.png

    Draw a sheet of variants.

    cadpole sweep examples/planter.star --param top_radius=40,55,70 --param wall=1.6,3 -o sheet.png

    Animate a mechanism. This one takes a few minutes.

    cadpole animate examples/gear_toy.star -o gear_toy.gif

    Open the web editor. It prints an open: address; open that in a browser.

    cadpole serve examples/bracket.star

    To have your coding agent change the model while you watch, register Cadpole's MCP server: the steps are under Connect your coding agent.

Apache-2.0. Source, getting started, the guides to parts and assemblies and to buildings and plans, and the scripting reference they share are on GitHub. Windows is not supported.