Plan First 3D Object Programs
You get a readable program for a multi-part 3D object, with a plan, named parts and joints for anything that moves. Planning first and placing parts by name keeps the model from guessing coordinates, which is where most errors come from.
The prompt
You are a senior CAD scripting engineer who writes short, readable programs that build 3D objects from a supplied library.
Task: Write one program that builds {object_description}, using only the functions listed in {api_reference}.
Steps:
1. Plan first: list the parts, their rough sizes using {units_and_sizes}, and how each part attaches to or moves against another.
2. Fix the details: set each key dimension once as a named variable, and note the moving parts and limits from {moving_parts}.
3. Write each part as its own named step. Position parts using named faces, edges or reference points of earlier parts, never hand-computed coordinates.
4. Combine the parts into one assembly and add a joint for every moving part.
5. Check that every function you call exists in the reference, and fix any that do not.
Output: The plan as a short bullet list, then one code block containing the program with a brief comment on each part, then one line listing any assumptions you made.
Change the parts in curly braces. Use it when you paste any 3D, CAD or scene-building library reference into a chat model and want a multi-part object that actually assembles.
What happened when we ran it
We sent
You are a senior CAD scripting engineer who writes short, readable programs that build 3D objects from a supplied library.
Task: Write one program that builds a desk lamp with a round weighted base, a two-segment arm, a conical shade and a rotating on/off knob on the base, using only the functions listed in lib.cylinder(name, radius, height) makes a solid cylinder. lib.cone(name, r1, r2, height) makes a cone. lib.box(name, w, d, h) makes a block. part.face('top') returns a named face, and part.attach(other, face) places another part on it. lib.joint(name, part, axis, range, kind) adds a hinge or spin. lib.assembly(name, *parts) joins everything..
Steps:
1. Plan first: list the parts, their rough sizes using Millimetres. Base 120 wide and 20 tall, each arm segment about 250 long and 12 thick, shade 90 wide at the opening and 110 tall overall., and how each part attaches to or moves against another.
2. Fix the details: set each key dimension once as a named variable, and note the moving parts and limits from The lower arm pivots 0 to 80 degrees at the base. The upper arm pivots 0 to 140 degrees at the elbow. The shade tilts 0 to 60 degrees. The knob spins freely..
3. Write each part as its own named step. Position parts using named faces, edges or reference points of earlier parts, never hand-computed coordinates.
4. Combine the parts into one assembly and add a joint for every moving part.
5. Check that every function you call exists in the reference, and fix any that do not.
Output: The plan as a short bullet list, then one code block containing the program with a brief comment on each part, then one line listing any assumptions you made.
The model replied
Run on Claude Sonnet 5.5, 07 Nov 2026. Automatic check: 2 out of 5.
Mentioned for
Claude, ChatGPT, Gemini
Where it came from
Found on GitHub, shared by Sandflow-ai: Sandflow-ai/sand3d.
This is our own version of the idea, written and tested by us. The original may differ.