Parametric Modeling in Practice: Evaluating LLM Spatial Reasoning and Coding Skills

    This article presents a hands-on evaluation of how well large language models handle spatial reasoning and code generation when asked to build a parametric assembly model instead of a one-off visualization script. It explains the task design, the parameters and dependencies that separate writing code from building a model, the capabilities being tested, common failure patterns, and how to judge results through parameter-change regression checks. Readers will find practical guidance on turning natural-language constraints into verifiable, regression-friendly engineering structures.

    1. Why Traditional Hands-On Testing Is Falling Short

    When evaluating models that can generate code, many teams ask the model to output a visualization script and then judge the rendered result subjectively. This approach has a clear ceiling: whether the image looks good often depends on materials, lighting, and composition, which are exactly the areas where current models can get lucky. Once the task shifts from a static ornament to an engineering scenario with transmission relationships, contact relationships, and parameter linkage requirements, the model’s capability boundaries are quickly exposed.

    A more effective approach is to raise the evaluation goal from “generate a visualization script that runs” to “generate a parameter-driven assembly model.” The failure mode of the former is a rendering error; the failure mode of the latter is a spatial-relationship error. The latter is closer to real engineering needs and is harder to mask with surface-level tricks.

    2. Task Design: A Pelican Riding a Bicycle on a Seaside Path at Dusk

    The test scenario is set on a seaside path at dusk, where a pelican rides forward on a dark green steel-frame bicycle. The pose requirements include a forward-leaning body, both wings extended forward to grip the handlebar, one webbed foot pressing on a pedal, and the other webbed foot suspended at the lowest point of the pedal’s return stroke. The frame is a classic diamond structure, with a canvas tool bag hanging from the down tube and a roll of fishing net strapped to the rear rack.

    There are two key constraints. First, the overall result may be stylized and artistic, but the spatial relationships between parts must pass a parametric check. Second, the bicycle cannot be a static prop: the crank is driving the rear wheel, the chain is under tension, and the pelican’s riding posture must stay consistent with the current phase of the transmission system.

    These two constraints push the task from “modeling” to “building a verifiable model.”

    3. Parameters and Linkage: The Dividing Line Between Writing Code and Building a Model

    True engineering modeling requires all geometry to be derived from top-level global constants, with no magic numbers inside functions that are disconnected from those constants. Illustrative code:

    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; determines chain length and gear ratio
    4. BICYCLE_COG_TEETH = 16 # Rear cog teeth
    5. BICYCLE_CRANK_PHASE = 35.0 # Crank phase angle (degrees); determines pedal position and foot contact
    6. def build_handlebar(wingspan):
    7. grip_span = wingspan * 0.92
    8. return {"width": wingspan, "grip_span": grip_span}
    9. def crank_position(phase_deg, crank_len):
    10. rad = math.radians(phase_deg)
    11. return (crank_len * math.cos(rad), crank_len * math.sin(rad))

    The reviewer’s job is clear: change only the numbers, leave the code logic untouched, and rerun the script. For example, change the wingspan from 1.15 to 1.35, change the chainring teeth from 44 to 52, and change the crank phase from 35 degrees to 140 degrees. Then check three things: whether the handlebar widens accordingly and the grips still enclose the wing tips; whether the chain path is correctly recomputed after the chainring grows, with no clipping and no slack; and whether, after the crank phase changes, the foot on the pedal still contacts the pedal surface while the suspended foot remains at the low point of the return stroke.

    The value of this acceptance method is that it turns “does the model understand the constraints” into “does it remain self-consistent after parameter changes,” which cannot be passed by one-off hardcoding.

    4. Capability Breakdown: What This Task Actually Tests

    First, parametric thinking. The model must understand that constants are the single source of truth and that any geometric quantity should be a function of those constants, not a separate set of numbers.

    Second, constraint solving. Chain length is determined jointly by the chainring and cog teeth, and the chain must be taut and fit both sprockets. This is essentially a tangent-path solving problem, not drawing an approximate curve.

    Third, phase consistency. The crank phase determines the pedal position, the pedal position determines the foot contact point, and the suspended foot must land at the low point of the return stroke. All three share the same phase variable and are not allowed to take independent values.

    Fourth, verifiability of spatial relationships. Grip spacing is tied to wingspan, frame geometry is tied to wheelbase, and the tool bag and rack are attached to the frame’s local coordinate system. Any disconnect will surface when parameters change.

    5. Common Failure Patterns and How to Read Them

    The first failure is leftover magic numbers. The render looks fine, but it breaks as soon as a parameter changes, which shows the model only “drew it right this once.”

    The second failure is chain approximation. Using a polyline or a fixed-length curve instead of a tangent solve causes clipping or slack as soon as the chainring changes.

    The third failure is phase decoupling. The foot position is hardcoded, so the foot separates from the pedal once the crank turns, or the suspended foot ends up at the top dead center.

    The fourth failure is mixed coordinate systems. The frame, rack, and tool bag each use world coordinates, so accessories drift after the wheelbase changes.

    When reading results, prioritize parameter-change regression testing over a single visual impression, and give an automatically checkable geometric condition for each assertion, such as a contact-point distance threshold, a chain-tension criterion, and a grip envelope range.

    6. Engineering Implementation Suggestions

    In real projects, this type of evaluation can be organized into three layers. The first is the parameter layer, which maintains global constants and unit conventions in one place. The second is the solver layer, which encapsulates transmission, contact, and envelope relationships into reusable functions. The third is the validation layer, which replaces manual image inspection with automated assertions. For large-scale evaluation and multi-version comparison, a container platform can standardize the runtime environment, object storage can archive scripts and rendered artifacts, and a logging service with monitoring alerts can track the regression failure rate, making evaluation results reproducible and traceable.

    7. Conclusion

    The point of this kind of task is not to generate a good-looking image, but to test whether a model can translate natural-language constraints into a parametric, verifiable, regression-friendly engineering structure. When the acceptance standard shifts from “does it look right” to “is it still right after changing parameters,” the evaluation gains real discriminating power and provides a reliable basis for selection and iteration.