Acceptance Criteria for Spatial Reasoning in Parametric 3D Scripting
Turning natural language into a verifiable 3D scene is less about drawing an approximate shape and more about whether spatial relationships between parts still hold when parameters change. This article breaks down how to turn a creative coding prompt — a waterbird riding a steel-framed bicycle on a coastal boardwalk at dusk — into an inspectable, parameterized engineering task, covering narrative vs. constraints, global constants, three coupled invariants, script structure, re-run acceptance, and testable prompt design.
Turning natural language into a verifiable 3D scene is not about “drawing an approximate shape.” The real challenge is whether the spatial relationships between parts still hold when parameters change. A qualified generation should deliver a complete script that runs in headless batch mode: the scene has a narrative, geometry is derived from constants, and the model still passes spatial checks after changing a few numbers. Below, using the example “a waterbird riding a dark-green steel-framed bicycle on a seaside boardwalk at dusk,” we show how to converge creative coding into an acceptance-testable engineering task.
1. Separate Narrative from Constraints
Narrative governs style and readability: dusk lighting, a forward-leaning riding posture, a canvas tool bag, and a fishing net on the rear rack can all be moderately stylized. Constraints are what a program can prove: the frame is a classic diamond type; both wings extend forward to grip the handlebars; one webbed foot rests on a pedal while the other stays near the lowest point of the recovery stroke; the crank drives the rear wheel, the chain is under tension, and the riding posture must stay consistent with the drivetrain phase.
Stylization allows simplified surfaces and building the bird and frame from primitives, but it does not allow “looks right” to substitute for geometric relationships. Acceptance ignores whether the render is pretty; it only checks whether the grip, chain, and feet still hold up after parameters change. This is what distinguishes “writing code that runs” from “building a parameterized model.”
2. Consolidate Control Variables into Global Constants
The top of the script should expose only a small set of global constants; all other dimensions are derived from them, and functions must not contain magic numbers decoupled from these constants. Recommended minimum set:
- Wingspan: determines handlebar width and grip spacing on both sides, so the wingtips can still wrap around the grips.
- Wheelbase: the distance between front and rear wheel centers, from which the top tube, down tube, seat tube, and chainstays form the diamond topology.
- Chainring and rear cog tooth counts: determine the gear ratio, pitch radii, and total chain length.
- Crank phase angle: determines the spatial positions of both pedals, and which foot is in pedaling contact versus which is at the low point of the recovery stroke.
If wheel diameter, crank length, or saddle height need to appear, they should be written as derived quantities computed from the constants above in fixed ratios, calculated in one place rather than scattered across mesh coordinates. This way, the reviewer changes only numbers — never statements — and observes whether the entire geometry follows.
3. Three Couplings That Must Hold Simultaneously
First, when wingspan increases, the handlebar widens, and the grips still fall within the small range the wingtips can grasp. In practice, first derive shoulder width and wing-bone length from wingspan, then set the handlebar’s outer width slightly less than the wingspan, aligning grip centers with the wingtips in the handlebar’s local coordinate system. Do not simply stretch the handlebar while the wings keep hardcoded coordinates.
Second, when chainring tooth count increases, the pitch radius grows and the chain path must be recomputed. The common approach: compute pitch radii from tooth counts and a uniform pitch, then use the common tangent lines between the two circles plus arcs to form a taut chain. Slack and tight sides should be separated so the chain doesn’t pass through the chainring, frame, or float in mid-air. When the gear ratio changes, cog radius and total chain length must update together — not just scale one ring.
Third, when the crank phase changes, the pedals rotate around the bottom bracket to their new positions; the driving foot’s contact surface still sticks to the pedal top, and the recovery-side foot stays near the lowest point without penetrating the pedal. Phase is an angle, not a texture offset: the crank vector, pedal normal, and foot-sole plane must share the same rotation. Moving only the bird’s feet without rotating the crank — or rotating the crank while the feet stay at old coordinates — both count as failures.
4. Recommended Script Structure
A single file is fine, but layer the logic: constants and derived quantities, rigid-body poses, mesh generation, assembly and export. The pose layer only computes coordinate frames and transforms, creating no meshes; the mesh layer only consumes poses. Chain sampling points, pedal contact points, and grip centers should be output as printable check values for batch log comparison — not left to visual inspection.
The relationships look like this (pseudocode, not tied to any specific modeling API):
span, wheelbase, n_chain, n_cog, phase = CONSTSr_front = pitch_radius(n_chain)r_rear = pitch_radius(n_cog)crank = rotate_z(phase)pedal_down = crank_origin + crank * crank_lenpedal_up = crank_origin - crank * crank_lenbar_width = span * grip_ratioassert chain_clear_of_frame(r_front, r_rear, wheelbase)assert foot_on_pedal(drive_foot, pedal_down)assert foot_near(return_foot, lowest_point(pedal_up))
Stylized meshes can be attached after poses are finalized. Never reverse-engineer the phase from mesh vertices.
5. How to Judge a Parameter-Change Re-run
Increase the wingspan slightly from its baseline, raise the chainring tooth count, and move the crank phase to another quadrant — then rerun after changing only the constants. Pass criteria: the handlebar and grips widen with the wingspan while still being wrapped by the wingtips; the chain re-conforms to the two pitch circles without intersecting geometry or floating; the driving foot still contacts the current pedal, and the free foot remains at the recovery low point. If any condition holds only under the initial numbers and breaks the moment they change, magic numbers or copy-pasted coordinates are present.
Common failures include: static assembly, where drivetrain parts and limbs are each computed independently; a fixed polyline chain that intersects the frame as soon as tooth counts change; phase affecting only the crank display but not the feet; left-right foot mirroring errors, where both feet push down or both dangle simultaneously; and a wheelbase change that moves the wheels while the tool bag and fishing net stay pinned to old coordinates. Batch logs should show contact distances, chain clearances, and grip offsets, judged against thresholds — not subjective scoring from screenshots.
6. How to Write Testable Prompts
The prompt should specify the narrative, constant names, units, a ban on magic numbers, and the acceptance action of “change only the numbers and rerun.” Do not provide reference images, which would tempt the model to copy pixels instead of building constraints. Require delivery of a single runnable script, and state that the headless launch method can be described in text — avoiding tying acceptance to any particular interactive operation.
Evaluate generated results on three capabilities: whether spatial relationships can be expressed as parameters; whether the model stays free of intersections when tooth count, phase, and scale change simultaneously; and whether the drivetrain phase and riding posture remain consistent under stylized shapes. A static, attractive result that can’t re-link only proves mesh stacking. Passing after parameter changes is what shows spatial reasoning has entered an executable model.
7. Engineering Habits for Implementation
Concentrate constants, make derived quantities pure functions, separate transforms from meshes, and make check values loggable — these four rules apply to any text-driven parametric scene. For complex shapes, first use envelope volumes to guarantee contact and clearance, then swap in stylized meshes. Prioritize tests for “few parameters, strong coupling” parts like the chain, pedals, and grips; add decorations later. This way, a creative scene can still have its dusk and fishing net, but the evaluation criterion remains: can the spatial relationships be verified through parameterized checks — not whether one particular run happens to look right.
