From Script Generation to Spatial Reasoning: A Methodology for Evaluating LLM 3D Capabilities Using Blender

    As Large Language Models (LLMs) mature in text generation and code completion, spatial reasoning emerges as a critical differentiator. This article introduces a methodology for evaluating LLMs' 3D spatial reasoning capabilities using headless Blender Python scripts. By generating parametric 3D scenes—such as a pelican riding a bicycle—and applying parameter perturbation tests, we can effectively determine whether a model truly understands spatial relationships or merely produces hardcoded outputs. This approach offers an automated, reproducible, and cheat-proof benchmark for assessing spatial reasoning in 3D modeling tasks.

    1. Why Spatial Reasoning is the New Touchstone for LLMs

    In recent years, LLMs have shown mature performance in text generation and code completion, but the gap in “spatial reasoning” is just beginning to widen. Spatial reasoning refers to a model’s ability to construct a self-consistent 3D scene in its “mind” based on text descriptions and correctly translate these spatial relationships into coordinates, angles, and connections in code.

    This is fundamentally different from standard code generation. Writing a CRUD interface relies on pattern memory and reproduction; building a 3D scene requires understanding relative positions, geometric constraints, and linkage logic between parts. For example, handlebar width must be determined by wingspan, pedal position by crank phase, and chain length by gear ratio. Any disconnect leads to clipping, floating parts, or disproportionate scales. Such tasks naturally serve as high-differentiation benchmarks for LLM capabilities.

    2. Choosing the Evaluation Carrier: Why Headless Blender Scripts

    2.1 Limitations of Traditional Web 3D Solutions

    Early evaluations often used browser-based 3D libraries to generate scenes. The problem is that these libraries provide extensive high-level wrappers, masking many of the model’s spatial decisions. Features like automatic camera framing and geometry normalization make it difficult to judge whether the model actually reasoned through the spatial relationships.

    2.2 Advantages of Script-Based Generation

    Using Python scripts for desktop 3D software as the deliverable offers three main benefits:

    1. Pure Geometric Control: Every vertex and edge in the script is decided by the model, with no hidden default behaviors to fall back on.
    2. Automated Acceptance: Headless mode (CLI + Python script) can be batch-run in a CI environment to output renders or perform geometric assertions at a very low evaluation cost.
    3. Parameterized Verification: The most crucial aspect, detailed below.

    A typical execution looks like this:

    1. blender --background --python text_to_3d_pelican_bicycle.py

    3. Evaluation Case Design: A Pelican Riding a Bicycle

    3.1 Principles of Scene Description Construction

    A good evaluation prompt should contain sufficient spatial clues so that “lazy models” have nowhere to hide. A classic test case is: “On a coastal promenade at dusk, a pelican rides a dark green steel-framed bicycle, leaning forward, wings gripping the handlebars, one webbed foot on a pedal, the other suspended at the lowest point of the return stroke. The frame is a diamond shape, a tool bag hangs from the down tube, a fishing net is tied to the rear rack, and the crank is driving the rear wheel.”

    This test is clever because it simultaneously evaluates:

    • Biological Morphological Modeling: The pelican’s body, long beak, wings, and webbed feet are non-standard geometric shapes, testing the model’s control over curves and deformations.
    • Mechanical Structure Modeling: The bicycle is a classic engineering structure with clear spatial constraints—diamond frame, drivetrain, and wheelset.
    • Posture and Phase Coupling: The riding posture must align with the current phase of the drivetrain. This is dynamic spatial reasoning and the hardest part.

    3.2 Parameterized Constraints: The Key to Differentiating “Writing Code” from “Building Models”

    Define global constants at the top of the prompt and require all geometry to derive from them:

    1. PELICAN_WINGSPAN = 1.15 # Wingspan (meters), controls handlebar width and grip spacing
    2. BICYCLE_WHEELBASE = 1.02 # Wheelbase (meters), drives frame geometry
    3. BICYCLE_CHAINRING_TEETH = 44 # Chainring teeth, drives chain length
    4. BICYCLE_COG_TEETH = 16 # Rear cog teeth
    5. BICYCLE_CRANK_PHASE = 35.0 # Crank phase angle (degrees), drives pedal position

    The core rule is: No magic numbers disconnected from these constants should appear inside functions. This forces the model to build a true derivation chain—handlebar length is a function of wingspan, chain length is jointly determined by the gear ratio and sprocket geometry, and pedal coordinates are calculated via trigonometric functions of the crank phase angle.

    4. Acceptance Method: Change Numbers, Don’t Touch Code

    The killer move in evaluation is the parameter perturbation test. During acceptance, change the wingspan from 1.15 to 1.35, the chainring teeth from 44 to 52, and the crank phase from 35 degrees to 140 degrees. Rerun the script and check three things:

    1. Handlebar Linkage: Did the handlebar widen accordingly, and does the grip position still encompass the wing tips? If the handlebar width is hardcoded, the pelican’s wings will either miss or clip through the handlebar.
    2. Chain Recalculation: After the chainring grows, is the chain path recalculated correctly? If the chain length is hardcoded, there will be clipping or floating.
    3. Pedal Phase Consistency: After changing the phase to 140 degrees, does the pedaling foot still stick to the pedal surface, and is the suspended foot still at the low point of the return stroke? This requires the model to drive both pedal coordinates and the pelican’s leg postures simultaneously using the phase angle.
    1. # Correct way: pedal position should be derived from the phase angle
    2. pedal_front = (
    3. CRANK_LENGTH * cos(radians(BICYCLE_CRANK_PHASE)),
    4. CRANK_LENGTH * sin(radians(BICYCLE_CRANK_PHASE)),
    5. )
    6. # Wrong way: pedal_front = (0.15, -0.05) # Magic number, fails immediately when phase changes

    5. Horizontal Comparison Evaluation Design

    A single model passing only proves it “can write.” To assess capability levels, horizontal comparison is needed. Select multiple mainstream LLMs, use the exact same prompts and acceptance criteria, and score them across these dimensions:

    • Runnability: Does the script pass without errors on the first run?
    • Geometric Self-Consistency: Are there clipping, floating parts, or disproportionate scales between components?
    • Parameter Linkage Correctness: Do all constraints still hold after the perturbation test?
    • Code Engineering Quality: Constant organization, function division, and naming conventions.
    • Explainability: Are the geometric derivation logics explained in comments?

    Practical experience shows that parameter linkage correctness is the highest differentiating dimension. Most models can generate scenes that “look right,” but only models that truly establish a spatial reasoning chain can maintain geometric correctness after parameter perturbation.

    6. Implications for LLM Capability Assessment

    This evaluation method can be generalized into a universal benchmark for LLM spatial capabilities: given a text scene, define parameterized constraints, use headless scripts as deliverables, and use parameter perturbation as the acceptance method. It has several noteworthy characteristics:

    1. Fully Automated and Reproducible: Acceptance is entirely script-driven, relying on no subjective human judgment.
    2. Hard to Game: Models cannot pass by memorizing standard answers because the perturbed parameter combinations are open-ended.
    3. Close to Real Engineering: Parametric modeling is a fundamental skill in CAD, gaming, and VFX industries, making the evaluation results directly relevant to real-world applications.

    For developers, regardless of which model is being evaluated for 3D-assisted generation tasks, “change one parameter and see the whole scene link” is a much more reliable criterion than looking at a rendered image. Whether the spatial relationships are truly “thought through” by the model will ultimately be reflected in every coordinate derived from constants.