How to Scientifically Evaluate LLM 3D Spatial Reasoning: Text-to-Blender-Script as the Test Case
Every newly released model claims "front-tier spatial reasoning," yet these claims rarely come with verifiable evidence. Instead of trusting leaderboard scores, developers can design a high-signal test task of their own. This article uses text-to-Blender-script generation as that task, explains why it exposes spatial reasoning flaws that plain chat hides, and shows how to build an anti-hardcoding acceptance harness with global constants and numeric assertions. It also covers a concrete prompt (a pelican riding a bicycle), the failure modes to expect, and how to compare multiple models fairly. The approach is cheap — one carefully designed prompt plus one acceptance script — and transfers to any domain where geometry is driven by parameters.
1. Why “generate a 3D scene script” is a good target for spatial reasoning
Most new model announcements emphasize that “spatial reasoning is close to first-tier level,” but such claims usually come without verifiable evidence. As a developer, rather than reading leaderboard numbers, it is more useful to design a test task with a high signal-to-noise ratio.
Plain text conversation rarely exposes spatial reasoning defects — a model can get by on linguistic patterns. In contrast, the task “produce a runnable 3D modeling script from a text description alone” has three properties that make it a natural probe:
- The result is executable: the script either runs or throws an error, with no gray area.
- Spatial relations are quantifiable: positions, dimensions, and contact relationships between objects can be checked with numeric assertions instead of human visual scoring.
- It is parameterized and repeatable: extract key dimensions and phases into constants, change a few numbers, rerun, and you can tell whether the model actually understands or has hardcoded values.
This task is considerably harder than the common “draw a scene with a web 3D library.” Example data for web 3D approaches is abundant in training corpora, so models can score by recalling patterns. The offline Python scripting API of 3D modeling software is comparatively obscure, and the task carries implicit real-world constraints such as mechanical transmission and skeletal posing — which separates genuine reasoning from pattern recall much more effectively.
2. Test task design: a pelican riding a bicycle
A good test prompt looks playful but is full of traps. The reference task description:
On a seaside promenade at dusk, a pelican is riding a dark green steel-frame bicycle. The pelican leans forward, both wings extended to grip the handlebar, one webbed foot pressing a pedal while the other hangs in the air at the lowest point of the pedal’s return stroke. The frame is a classic diamond design, a canvas tool bag hangs from the down tube, and a roll of fishing net is strapped to the rear rack. The bicycle is not a static prop: the crank is driving the rear wheel, the chain is under tension, and the pelican’s riding posture must be consistent with the current phase of the drivetrain.
How many checkpoints does this hide?
- Geometric coupling: handlebar width is determined by wingspan, and the grip positions must enclose the wing tips — change the wingspan and the handlebar must change with it.
- Drivetrain calculation: chain length is determined jointly by chainring teeth, cog teeth, and center distance. Enlarge the chainring and the chain path must be recomputed, without clipping through geometry or hanging loose.
- Phase consistency: the crank phase angle determines the spatial position of both pedals. The pedaling foot must sit on the pedal surface, and the returning foot must hang in the air at the low position — this tests basic trigonometry and 3D coordinate transformation.
- Overall assembly: the relative positions of all parts must be correct for the result to pass.
3. Key technique: global constants for anti-cheating acceptance
The biggest risk in this kind of evaluation is a model welding the answer into the code. The fix is to extract all key parameters into global constants at the top of the script and require every piece of geometry to be derived from them:
# The evaluation script must derive all geometry from these constants. No magic numbers.PELICAN_WINGSPAN = 1.15 # Wingspan (m); determines handlebar width and grip spacingBICYCLE_WHEELBASE = 1.02 # Wheelbase (m); drives frame geometryBICYCLE_CHAINRING_TEETH = 44 # Chainring teeth; determines chain length and gear ratioBICYCLE_COG_TEETH = 16 # Rear cog teethBICYCLE_CRANK_PHASE = 35.0 # Crank phase angle (deg); determines pedal and foot positions
For acceptance, change only the numbers and leave the code untouched: set wingspan from 1.15 to 1.35, chainring teeth from 44 to 52, and phase angle from 35 to 140, then rerun the script and check:
- Whether the handlebar widens accordingly and the grips still enclose the wing tips;
- Whether the chain path is correctly recomputed for the new chainring size;
- Whether the pedaling webbed foot still contacts the pedal surface and the hanging foot is still in the low position of the return stroke.
This effectively separates “parameterized understanding” from “numeric memorization.” A model that truly understands spatial relationships passes wingspan into the handlebar width calculation as a variable; a model that only recalls patterns tends to hide a hardcoded offset somewhere deep in the code.
4. Automating the acceptance script
Manual visual inspection is slow and subjective. It is better to write an assertion-based acceptance script and run it together with the generated script in the modeling software’s no-GUI mode:
def assert_contact(foot, pedal_surface, tol=0.02):"""Check contact error between the webbed foot and the pedal surface."""dist = (foot.location - pedal_surface).lengthassert dist <= tol, f"foot-pedal deviation {dist:.3f}m exceeds tolerance"def assert_chain_clearance(chain_points, chainring_radius):"""Check that the chain neither clips the chainring nor hangs loose."""for p in chain_points:r = math.hypot(p.x, p.y)assert abs(r - chainring_radius) < 0.01, \f"chain radius deviation too large: {r:.3f} vs {chainring_radius:.3f}"
Four layers of acceptance dimensions are recommended:
- Runnability: executes from the command line in no-GUI mode without errors.
- Parameter linkage: after changing the constants, the geometry of each part updates correctly.
- Spatial constraint satisfaction: numeric assertions on contact, envelope, and clearance relations.
- Semantic fidelity: whether the dynamic characteristics in the description are reflected (chain under tension, riding posture consistent with phase).
5. Comparing models properly, and common failure modes
A single successful run says little about capability. Run multiple models in parallel with the same prompt, fix the sampling temperature, sample several times, and compute a pass rate. The failure modes seen in practice include:
- Magic-number hardcoding: values scattered inside functions that are disconnected from the constants; change a parameter and it breaks.
- Phase angle errors: no radian conversion, or the 180-degree phase difference between the two feet computed incorrectly.
- Shortcut chain geometry: drawing a plain torus instead of computing the actual path from tooth counts and center distance.
- Disconnected assembly: the pelican and the bicycle are each correct, but assembled together the foot cannot reach the pedal.
These failure modes map directly onto the core sub-abilities of spatial reasoning: coordinate transformation, parameter propagation, constraint solving, and overall assembly planning.
6. Final thoughts
To evaluate a model’s spatial reasoning, building an “executable, parameterized, automatically assertable” test task is more reliable than relying on vendor claims or leaderboard rankings. The cost here is just a well-designed prompt plus an acceptance script, yet the conclusions are far more trustworthy than subjective scoring. Developers can port this method to other domains — mechanical assembly, architectural layout, UI component arrangement — anywhere geometry is parameter-driven the same evaluation philosophy applies: make the model prove under constraints that it actually understands space, rather than that it memorized the answer.
