From Code Generation to Spatial Reasoning: A Guide to Evaluating 3D Modeling Capability

    A script that runs and looks convincing is not proof that a model understands spatial relationships. This guide uses a pelican-on-a-bicycle modeling task to show how to turn narrative prompts into unambiguous geometric and motion constraints, then check code delivery, visual expression, contact, parameter coupling, and reproducible engineering quality.

    1. Evaluating generation means more than “it finished”

    A large model can turn text into a 3D scene script without accurately understanding the spatial relationships in that scene. A script may run, and the image may look artistically strong, while the frame, chain path, wingtip grip, and foot contact are still wrong.

    When discussing technical strengths, a vague claim that “generation looks good” should be broken into separate layers:

    • Code delivery: Can the model output a structurally complete script that runs in the specified environment?
    • Visual expression: Can form, materials, lighting, and composition convey the scene’s narrative?
    • Spatial constraints: Can it handle position, orientation, size, contact, and clearance correctly?
    • Parameter coupling: When inputs change, do related geometry and character pose update together?
    • Engineering maintainability: Can the result be inspected, reproduced, and debugged, rather than shown only once?

    These abilities are related, but they do not substitute for one another. A successful run shows that the execution path is basically usable. A pleasing image shows that the visual presentation is reasonably good. Spatial reasoning looks stable only after constraint checks and parameter perturbations.

    The rest of this article uses a text-to-model task with both mechanical structure and character motion to show how to build a stricter evaluation. It describes a general method and does not rank any specific model.

    2. Why “a pelican riding a bicycle” is a useful spatial-reasoning case

    The task can be summarized as follows: at dusk, on a seaside path, a pelican rides a dark-green bicycle. The body leans forward, both wings reach the handlebars, one webbed foot presses a pedal, and the other is raised. A tool bag is attached to the frame, and a fishing net sits on the rear rack.

    The value of the scene is not the number of objects. It is the dense set of dependencies among them.

    The bicycle must follow a basic mechanical layout. The front and rear wheels, frame, crank, chainring, rear cog, and chain cannot be placed independently. The pelican must fit that structure: wingtips should correspond to the grips, a foot should meet a pedal, and the body should not pass obviously through the frame. The tool bag and net must be attached plausibly, not left floating nearby.

    That produces a clear dependency chain:

    Input parameters → mechanical geometry → contact targets → character pose → scene appearance → acceptance result.

    If the script only stitches objects together at fixed coordinates, the first frame may still look acceptable. Change the wingspan, tooth count, or crank angle, and the scene often breaks immediately. The ability that matters is whether that dependency chain is implemented as executable modeling logic.

    3. Define constraints first so the model is not asked to “solve a contradiction”

    A complex prompt is not automatically a good test. If the request is vague or internally conflicting, failure may come from the task design rather than from the model.

    For example, “one foot is on the current pedal, while the other foot always stays near the lowest point of the other pedal” is not naturally compatible with an arbitrary crank phase. In a standard two-crank layout, the cranks are half a revolution apart. When the overall phase changes, the other pedal is not necessarily at its lowest point.

    Before acceptance, three meanings must be separated:

    1. The raised foot stays above the other pedal with a defined clearance.
    2. The raised foot is in the low part of the return path, without requiring the corresponding pedal to be at its lowest point.
    3. Only one specific phase is checked for a lowest-point pose.

    These requirements need different pose logic and should not be mixed.

    “The bicycle is moving” also needs a definition. If the deliverable is only a still image, the most that can be verified is pose consistency at one moment. That does not prove that the drivetrain is correct throughout the motion. Continuous motion requires a time variable, angular velocity, animation duration, and a frame-sampling rule.

    The first step in a rigorous evaluation is to convert narrative language into unambiguous geometric and motion constraints.

    4. Establish one coordinate system and a parameter dependency graph

    4.1 Unify coordinates and units first

    Use one length unit, and state explicitly that:

    • the longitudinal axis is the bicycle’s direction of travel;
    • the lateral axis is left–right;
    • the vertical axis is height;
    • the ground is the shared height reference.

    The crank, wheel axles, and grips should have clear local coordinate systems. Left and right parts may look similar, but their lateral offsets, normals, and rotations must be handled separately.

    Without those conventions, local objects can face the right way while the overall assembly is still misaligned.

    4.2 Core parameters should drive geometry, not merely appear at the top of the script

    Useful test inputs for this case are:

    • wingspan: 1.15 m;
    • wheelbase: 1.02 m;
    • chainring teeth: 44;
    • rear cog teeth: 16;
    • crank phase: 35 degrees.

    These are test inputs. They do not represent a product feature, and they do not need to match standard bicycle or bird dimensions.

    Parameterization is about dependencies. For example:

    • wingspan sets the target range for grip spacing;
    • grip positions set the wingtip contact targets;
    • wheelbase affects axle positions and the main frame nodes;
    • tooth counts and chain pitch together determine pitch-circle size;
    • crank phase determines pedal-center positions;
    • pedal positions then determine the planted foot’s position and pose.

    Wingspan alone does not uniquely determine grip width. Wingspan usually describes the full span of both wings when spread, while a riding pose does not fully spread them. A pose ratio or joint range is also required.

    “No magic numbers” does not mean every dimension must be uniquely derived from those five parameters. Dimensions that cannot be derived should be named and declared in one place—wheel diameter, crank length, chain pitch, tube diameter, and contact tolerance—with their purpose and units stated.

    5. Mechanical structure should come from geometric relationships

    5.1 A frame is not an arbitrary bundle of tubes

    A classic diamond frame can be built around key nodes: rear axle, front axle, bottom-bracket center, top of the seat tube, and the upper and lower ends of the head tube.

    Compute node positions first, then generate solids from the connections between nodes. When the wheelbase changes, the frame can then be rebuilt from the predefined proportions or constraints.

    Checking that the wheels are apart is not enough. Also confirm that:

    • the fork connects correctly to the front axle;
    • the rear stays connect the rear axle to the frame;
    • the bottom bracket matches the crank rotation axis;
    • the wheels keep the required lateral clearance from the frame.

    5.2 The chain path needs a geometric solution

    Chain modeling is a key distinction between “drawing something that looks similar” and “understanding the mechanism.”

    Let chain pitch be p and tooth count be N. An idealized pitch radius can be written as:

    r = p / [2 × sin(π / N)]

    This relation is appropriate for the pitch circle that corresponds to chain-pin positions. Tooth-tip shape, or fine contact between rollers and tooth faces, needs a fuller tooth model. The pitch radius should not be treated as every outer radius.

    For a simplified scene, a closed chain path can be built in one transmission plane from the common external tangents between the two pitch circles and the two wrapping arcs. After the chainring tooth count changes, the tangent points, straight segments, and arcs must be recomputed. Simply scaling the chainring mesh is not enough.

    Engineering checks for the chain should include:

    • whether the path is closed;
    • whether straight segments meet arcs continuously;
    • whether the chain intersects the frame or tires implausibly;
    • whether the chainring and rear cog lie in a consistent chainline plane;
    • whether link count and total path length are consistent.

    “The geometric path is correct” is not the same as “a real drivetrain can be assembled.” With a fixed center distance, changing the chainring may require a different chain length, rear-wheel position, or tensioning arrangement. If the test allows only the tooth count to change, the script should state which simplification it uses instead of assuming that every mechanical condition still holds.

    5.3 Animation needs an explicit transmission state

    Under an idealized assumption of no slip and a rigid link between the rear cog and the rear wheel, the ratio of rear-wheel angular velocity to crank angular velocity follows the front-to-rear tooth ratio. A real bicycle may include a freewheel or similar mechanism, so the animation must state its mechanical assumptions.

    If the wheels must also roll on the ground without slipping, forward speed must match wheel radius and rear-wheel angular velocity. Spinning the wheels while the bicycle stays still can be a demonstration animation, but it is not a complete simulation of riding.

    6. Character pose should be solved around contact targets

    6.1 Two-wing grip: compute the target, then generate the pose

    A reliable order is to determine the position and orientation of the left and right grips first, then use them as wingtip targets.

    Shoulder and intermediate-joint poses are then solved from body position, wing-segment lengths, and allowed bend ranges. A simplified two-segment limb can use a geometric solution. More joints can use a general inverse-kinematics method.

    If a target is out of reach, the system should report a constraint failure or adjust the body pose under a rule defined in advance. Moving a wingtip onto the grip without preserving segment length produces unnatural stretching.

    6.2 A webbed foot on a pedal: contact constrains both position and direction

    Crank phase can locate the pedal axle, but foot contact also depends on pedal-surface orientation and sole geometry.

    At a minimum, check:

    • the distance from the sole to the pedal surface;
    • whether the sole penetrates the pedal too deeply;
    • whether the sole normal matches the contact face;
    • whether the contact region lies inside the usable pedal area.

    The foot should be derived from the pedal’s local coordinate system, not copied from an initial world coordinate. Only then can the contact relationship remain consistent when the phase changes.

    The raised foot needs its own target rule, such as staying a set distance above the corresponding pedal while keeping enough clearance from the frame.

    7. Use parameter perturbation to test whether coupling is actually understood

    One successful generation is only a starting point. A more useful test changes parameters, leaves the logic unchanged, and regenerates the scene.

    From the original inputs, test separately:

    • wingspan from 1.15 m to 1.35 m;
    • chainring teeth from 44 to 52;
    • crank phase from 35 degrees to 140 degrees.

    Run single-parameter tests first so failures are easier to locate. Then change parameters together to see whether dependencies interfere.

    When wingspan increases, the handlebar should widen, and the check should also ask whether the wingtips remain near the grips, whether the shoulders twist abnormally, and whether the wings pass through the body. When the chainring grows, it is not enough that the chain wraps it. Clearance from the tool bag and frame must also be checked.

    Acceptance metrics should be quantified where possible:

    • contact distance stays within a specified tolerance;
    • joint-segment length changes stay within an allowed range;
    • chain closure error stays below a set threshold;
    • key parts do not penetrate beyond tolerance;
    • after a parameter change, the derived dimensions that should change actually do.

    Tolerances should not be chosen arbitrarily. They should reflect scene scale, geometric precision, and the purpose of the task, and they should be fixed before testing starts.

    8. Keep visual acceptance separate from numerical acceptance

    Numerical checks are good at distance, size, and structural consistency, but they cannot fully judge narrative presentation. Visual checks can reveal poor proportions, weak character recognition, and composition problems, while missing intersections hidden on the back side.

    Keep both acceptance paths.

    Numerical acceptance reports the parameter table, key-point coordinates, constraint errors, and failure reasons. It answers whether the structure satisfies the rules.

    Visual acceptance uses several fixed viewpoints and close views of the drivetrain, grips, and foot-contact regions. It answers whether the scene expresses the intended content.

    The net, tool bag, and evening light can improve completeness, but they should not hide core mechanical problems. When necessary, finish structural acceptance with simple materials, then add artistic treatment.

    Video should be evaluated separately as well. A script for a static scene is not a playable video. The animation timeline, frame rendering, visual continuity, and video export still need to be verified.

    9. Build a reproducible engineering evaluation process

    A complete process can be divided into five stages:

    1. Freeze the requirements: Define inputs, outputs, coordinates, mechanical assumptions, and acceptance conditions.
    2. Generate the script: Require a complete delivery, and distinguish executable code from illustrative pseudocode.
    3. Run in isolation: In a controlled environment, limit file access, runtime, and resource use.
    4. Check automatically: Verify output files, object structure, constraint error, and parameter coupling.
    5. Review manually: Check multi-view results, motion plausibility, and narrative completeness.

    Generated code should be treated as untrusted input. The execution environment should not carry production credentials, and external network access should not be allowed by default. When a script fails, record the error location, resource use, and output state, not merely “failed.”

    When comparing generation strategies, keep the prompt, environment, execution budget, and number of repair attempts the same, and run multiple independent tests. One success or one failure does not prove stable capability.

    The report should also separate the initial delivery from a delivery repaired after human prompting. That distinction helps show whether a system fits an automated pipeline or is better used as an interactive assistant.

    10. What matters is the ability to preserve constraints

    Technical strength in 3D generation should not be reduced to “more code,” “a more polished image,” or “faster execution.” Capabilities with more engineering value include:

    • turning a natural-language request into clear geometric constraints;
    • managing dependencies among objects through shared parameters;
    • keeping mechanical structure and character contact consistent after parameters change;
    • giving a clear diagnosis when a condition cannot be satisfied;
    • delivering a complete result that can be executed, inspected, and maintained.

    “A pelican riding a bicycle” is only an entry point. The same method can be applied to equipment assembly, robot pose, virtual exhibition layouts, and industrial scene prototypes.

    Whether a generative system has reliable spatial reasoning ultimately depends on whether it can keep answering one question: when conditions change, which relationships must stay fixed, and which objects must move with them? Turning that answer into reproducible geometric and motion logic is the step from code generation to engineering modeling.