Evaluating 3D Spatial Reasoning and Creative Coding in Large Models
This article presents an evaluation framework for testing how well large language models handle 3D spatial reasoning and creative coding. Using the classic "pelican riding a bicycle" challenge, it explains why generating runnable code is not the same as building a parametric model, and organizes the assessment into three layers: runnability, verifiability, and transferability. It includes prompt structures, sample code for parameter linkage and validation, common failure patterns, and engineering recommendations for turning subjective visual judgment into objective, automated quality gates suitable for model selection and technical standards.
When a large model is asked to “generate a runnable 3D scene script from text alone,” the real difficulty is not syntax. It is spatial relationships and parameter linkage. This article uses the classic high-difficulty task of a pelican riding a bicycle as a thread to reconstruct an evaluation framework: how to drive geometry with global constants, how to keep drivetrain phase and posture consistent, and how to replace visual inspection with automated checks. The article provides prompt structures, sample parameter-linkage code, and an acceptance checklist. It applies to coding tool selection, model capability evaluation, and engineering implementation.
1. Problem Restatement: Why “Generating Code That Runs” Is Not the Same as “Building a Model”
In 3D content generation tasks, the industry often uses a seemingly absurd scene to stress-test models: generate a pelican riding a bicycle from a natural language description alone, and deliver a script that runs in headless command-line mode without a graphical interface. The value of this task is not whether the image is pleasing. It simultaneously pressures three model capabilities.
The first is semantic-to-geometry mapping. The model must translate vague expressions such as “leaning forward” and “both wings extended forward to grip the handlebars” into explicit coordinates, orientations, and contact relationships.
The second is parametric modeling. Constants such as wingspan, wheelbase, tooth count, and crank phase must genuinely drive geometry generation rather than being hard-coded inside a function.
The third is mechanical and motion consistency. The crank drives the rear wheel, the chain remains tensioned, and the pelican’s riding posture must match the current phase of the drivetrain.
Many models can produce syntactically correct scripts that even render an image. But once the top-level parameters are modified, the handlebars do not widen, the chain clips through geometry, and the feet detach from the pedals. This shows that the model wrote “one-off code” rather than a “parametric model.” Therefore, the focus of evaluation should shift forward from “can it run” to “does it remain self-consistent after parameter changes.”
2. Three Layers of the Evaluation Framework: From Runnable to Verifiable to Transferable
The first layer is runnability. The script must be directly executable by an interpreter in headless background mode. It must not depend on interactive operations or external asset files, and all geometry must be generated procedurally by code. This layer filters out “fake delivery”: solutions that require a few manual clicks to produce a result, or that require a reference image for alignment.
The second layer is verifiability. Part relationships in the scene must be checkable through parameters. For example, whether the grip span covers both wing tips, whether the chain path neither clips through geometry nor hangs slack, and whether the support foot always stays in contact with the pedal surface. Verifiability requires the model to design “checkpoints” into the structure during generation, rather than relying on human visual judgment after the fact.
The third layer is transferability. When the reviewer changes only numbers without touching the code—increasing the wingspan from a smaller value, increasing the chainring tooth count, or rotating the crank phase to another angle—the script must still recompute correct geometry and contact relationships. This layer has the highest discriminative power because it tests whether the model truly understands the causal chain of “parameter—geometry—constraint.”
3. Prompt Design: Put Acceptance Criteria Up Front, Not as an Afterthought
The key to a high-quality prompt is to write the acceptance method into the task description, so the model builds constraint awareness during generation. A reusable structure contains five sections.
The first section is deliverable definition. It specifies that the output is a script file that runs in headless mode and prohibits dependence on reference images.
The second section is scene and narrative. It describes stylized elements such as a coastal boardwalk at dusk, a dark green steel-frame bicycle, a canvas tool bag, and a rolled fishing net on the rear rack. It also emphasizes that the style can be artistic, but part spatial relationships must be parametrically checkable.
The third section is the parameter contract. It places key constants at the top of the script and declares that all geometry must be derived from these constants. Magic numbers disconnected from the constants must not appear inside functions.
The fourth section is linkage rules. It explains that wingspan controls handlebar width and grip span, wheelbase drives frame geometry, chainring tooth count determines chain length and the front-to-rear tooth ratio, and crank phase determines pedal position and foot contact.
The fifth section is the change test. It explicitly tells the reviewer that only numbers will be changed before rerunning, and lists three checks.
An example is shown below:
# Top-level parameter contract: all geometry is derived from thesePELICAN_WINGSPAN = 1.15 # Wingspan; controls handlebar width and grip spanBICYCLE_WHEELBASE = 1.02 # Wheelbase; drives frame geometryCHAINRING_TEETH = 44 # Chainring teeth; determines chain length and ratioCOG_TEETH = 16 # Rear cog teethCRANK_PHASE_DEG = 35.0 # Crank phase; determines pedal position and foot contactdef build_handlebar(span):# Grip span is derived from wingspan with envelope margingrip_span = span * 0.92return {"grip_span": grip_span, "wrap_margin": span - grip_span}def build_crank(phase_deg, wheelbase):# Phase only affects pedal position; wheelbase participates in drivetrain validationimport maththeta = math.radians(phase_deg)pedal_pos = (0.17 * math.cos(theta), 0.17 * math.sin(theta))return {"pedal_pos": pedal_pos, "wheelbase": wheelbase}
4. Implementation of Parameter Linkage: Making Constants the Single Source of Truth
Parametric design does not end by moving numbers to the top. Every geometric quantity must be traceable to a constant. In practice, three rules are recommended.
First, single-source derivation. Handlebar width, grip position, pedal coordinates, and chain length should all be functions of constants. Hard-coded values inside branches are prohibited.
Second, envelope rather than edge alignment. The grip span should be slightly smaller than the wingspan with a margin, so that “covering both wing tips” still holds after parameter changes. Exact equality can cause detachment due to numerical jitter.
Third, bind phase to contact. The landing point of the support foot should be computed from the crank phase, while the free foot stays fixed at the low point of the return stroke. Together they keep posture consistent with drivetrain phase.
When the chainring tooth count increases, the chain path must be recomputed for length and wrap angle based on the tooth ratio to avoid clipping or slack. When the phase rotates to another angle, pedal coordinates change accordingly, and the foot contact point must be updated in sync.
Sample validation logic can be written as:
def validate(params, scene):ok = True# 1) Whether the grip span covers both wing tipsok &= scene["grip_span"] + scene["wrap_margin"] >= params["PELICAN_WINGSPAN"]# 2) Whether the support foot lands on the pedal surfacepx, py = scene["pedal_pos"]ok &= abs(scene["support_foot"][0] - px) < 1e-3 and abs(scene["support_foot"][1] - py) < 1e-3# 3) Whether chain length updates with the tooth ratio (illustrative)ratio = params["CHAINRING_TEETH"] / params["COG_TEETH"]ok &= abs(scene["chain_ratio"] - ratio) < 1e-6return ok
5. Common Failure Modes and Root Cause Analysis
The first type is parameter decoration. Constants are placed at the top, but geometry is still generated from fixed values. The image does not change after parameters are modified. This is the most common “fake parameterization.”
The second type is missing constraints. The model focuses only on visual similarity and does not express contact relationships as computable conditions. This leads to visible gaps or intersections between feet and pedals, and between chain and gears.
The third type is style overriding structure. Spatial relationships are sacrificed for a better-looking image. For example, the bicycle becomes a static prop, the crank does not drive the rear wheel, and the chain is slack.
The fourth type is non-reproducible delivery. It depends on external model files, textures, or interactive interfaces and cannot run in headless mode in one pass.
Ultimately, all of these trace back to the model treating “parameter—geometry—constraint—acceptance” as four unrelated fragments rather than a closed loop.
6. Engineering Recommendations: Turn Evaluation into a Pipeline and Conclusions into Standards
For enterprise selection and internal evaluation, it is recommended to integrate this type of task into an automated pipeline.
First, unify the runtime environment. Fix the interpreter and headless execution method to ensure reproducibility.
Second, script the acceptance process. Write the three checks above as assertions, automatically rerun after parameter changes, and output a pass rate.
Third, score in layers. Score runnability, verifiability, and transferability separately to avoid the misjudgment that “if it runs, it gets full marks.”
Fourth, accumulate prompt templates and checklists as organizational assets.
For large-scale concurrent evaluation, container platforms can unify environments, object storage can archive artifacts, message queues can schedule tasks, and logging and monitoring with alerting can track failure causes. This upgrades one-off manual assessment into a sustainable quality gate.
7. Conclusion: The Endpoint of Evaluation Is a “Verifiable Spatial Causal Chain”
Returning to the original question: how do you judge a new model’s 3D spatial reasoning and creative coding ability? The answer is not whether it can generate a showy script. It is whether it can maintain correct relationships between handlebars and wingspan, chain and tooth count, and pedals and feet after parameters are changed.
Putting acceptance criteria up front in the prompt, expressing constraints as executable assertions, and integrating evaluation into a pipeline can turn subjective visual impressions into objective conclusions. This method does not depend on any specific product. It applies to horizontal evaluation of various coding tools and can be directly reused in enterprise model selection and technical standard development.
