Sketch-Driven Multibody Simulation: A New Breakthrough in VLM-Generated Simulation Code

VLMs generate multibody simulation code from engineering sketches; a two-stage pipeline doubles success rate, with the bottleneck in sketch reading, not code writing.
This study explores whether vision-language models (VLMs) can generate physically correct multibody simulation code directly from engineering sketches. The team built an automated closed-loop benchmark of 23 parameterized mechanical models, tested 12 open-source VLMs, and used triple validation of executability, graph isomorphism, and parameter/trajectory consistency. The core finding: a two-stage pipeline (code-agnostic intermediate representation, then code generation) raises success from 23.9% to 48.0%. With code generation fixed, pure text input achieves 94.8%, sketches alone 48.0%, and sketches plus text 78.2%, showing sketch reading is the main bottleneck. Ablation attributes gains to pre-selecting component types, with errors in sketch reading. The pipeline transfers to hand-drawn sketches, offering a new path for automated engineering simulation.
Creating engineering simulation models has long relied on manual coding or GUI operations, which is time-consuming and error-prone. But when mechanical systems are complex enough, describing them in text becomes verbose and prone to ambiguity. A recent study takes a different approach: can a vision-language model (VLM) generate physically correct multibody simulation code directly from engineering sketches?

From Text to Sketch: A Problem-Driven Paradigm Shift
The research team points out that large language models (LLMs) can already generate multibody simulation models from text descriptions, but for complex mechanical systems, text descriptions become verbose and error rates rise. In contrast, a single sketch can convey the same mechanical system information more compactly. This raises a key question: can a VLM generate executable simulation code directly from a sketch alone?
To answer this question, the team built an automated closed-loop benchmark. They rendered 23 parameterized mechanical models as annotated sketches and performed triple validation on each generated simulation model: executability, graph isomorphism, and parameter/trajectory consistency. This validation mechanism ensures rigor in evaluation—not only checking whether the code runs, but also whether its structure is equivalent to the ground-truth model and whether its behavior matches the baseline.
Vision-language models (VLMs) are a class of large models with both visual perception and language understanding capabilities, typically composed of a vision encoder (such as ViT) and a language model decoder, able to receive mixed image and text inputs and output natural language or code. Unlike pure-text LLMs, VLMs need to map geometric, symbolic, and spatial relationships in images into a semantic space—a cross-modal alignment process that is both their core capability and main bottleneck. In this study, the VLM is required to generate simulation code directly from engineering sketches, which is harder than conventional image captioning tasks because sketches contain many domain-specific symbols (such as hinges, sliders, force arrows) and the output must be physically correct.
Two-Stage Pipeline: Perceive First, Then Generate
The study tested 12 open-weight VLMs, and the core finding is: using a two-stage pipeline—first extracting a code-agnostic intermediate representation of the mechanical model from the sketch, then generating code based on that representation—doubles the success rate compared to having the VLM generate code directly (48.0% vs. 23.9%). This result shows that decoupling "perception" from "generation" can significantly improve VLM performance on engineering tasks.

To isolate the impact of the perception stage, the team fixed the code generation stage (using a single encoder LLM and only changing the input modality). The results show a clear gradient: pure text descriptions achieve a success rate as high as 94.8%, which drops sharply to 48.0% when replaced with sketches, and rises back to 78.2% when sketches are accompanied by text descriptions. This indicates that although sketches are compact as input, the VLM's sketch-reading ability remains the bottleneck; combining text and sketches can partially compensate for information loss.
Multibody simulation code typically refers to executable programs that describe the dynamic behavior of rigid/flexible body systems, commonly found in Modelica, Simscape, or Python-based physics engines (such as PyBullet). Such code needs to define component types (mass blocks, joints, force elements), topological connection relationships, parameter values (mass, inertia, friction coefficients), and initial conditions. The difficulty in generating such code lies in the fact that syntactic correctness does not equal physical correctness: the code must compile and execute, and the model structure it describes must be isomorphic to the real system. The validation mechanism in this study is designed precisely for this characteristic.
Ablation Experiments and Error Attribution
Further ablation experiments attribute the gain of the two-stage pipeline to the step of "pre-selecting the component types shown in the sketch." In other words, the key role of the intermediate representation is to clarify component types, rather than other complex transformations.
Error classification and robustness tests for scaling and rotation localize the remaining failures to the "sketch reading" stage rather than the "code generation" stage. This finding has clear engineering implications: improving the VLM's diagram understanding ability is more effective at improving end-to-end performance than optimizing the code generator. The study also verified that the pipeline can transfer to hand-drawn sketches, meaning that engineers' casual sketches could potentially be directly converted into validated dynamic simulations.
Graph isomorphism in this paper refers to representing both the generated simulation model and the baseline model as "component-connection" graphs and then checking whether the two are topologically equivalent (i.e., node types and edge relationships correspond one-to-one). This is a stricter validation than code text similarity, because the same physical system can be expressed with different syntax, but the graph structure must be consistent. Combined with parameter and trajectory consistency checks, the evaluation framework can rule out false positives where "the code runs but the model is wrong," ensuring that the success rate metric reflects true physical modeling capability.
Industry Implications: Perception Matters More Than Generation
This research provides an important direction for the development of AI-assisted engineering simulation. Currently, a great deal of industry effort is invested in improving LLMs' code generation capabilities, but this study shows that in the task from sketch to simulation code, the bottleneck lies in visual perception rather than code synthesis. By introducing a code-agnostic intermediate representation, the two-stage pipeline effectively separates "understanding the diagram" and "writing correct code," allowing each stage to be optimized independently.
From an application perspective, if hand-drawn sketches can be directly converted into verifiable dynamic simulations, the model creation workflow in computational mechanics could be substantially automated. Engineers could skip tedious modeling steps, express design intent with the most natural sketches, and let the VLM complete the subsequent conversion. Of course, the current 48.0% success rate still indicates that sketch-reading ability needs improvement, but the combined text-plus-sketch mode (78.2%) has already demonstrated the practical value of multimodal input.
Another significance of the study lies in its evaluation methodology: the automated closed-loop benchmark, graph isomorphism validation, and trajectory consistency checks provide a reusable paradigm for future evaluation of VLM engineering capabilities.
One-line Summary
Vision-language models generate multibody simulation code from engineering sketches; a two-stage pipeline doubles the success rate, with the bottleneck in sketch reading rather than code writing.
Paragraph Summary
This study explores whether vision-language models (VLMs) can generate physically correct multibody simulation code directly from engineering sketches. The team built an automated closed-loop benchmark containing 23 parameterized mechanical models, tested 12 open-source VLMs, and adopted triple validation of executability, graph isomorphism, and parameter/trajectory consistency. The core finding is: a two-stage pipeline (first extracting a code-agnostic intermediate representation, then generating code) raises the success rate from 23.9% to 48.0%. After fixing the code generation stage, pure text input achieves a 94.8% success rate, sketches alone only 48.0%, and sketches plus text rise back to 78.2%, indicating that sketch reading is the main bottleneck. Ablation experiments attribute the gain to pre-selecting component types, with errors localized to the sketch-reading stage. The pipeline can transfer to hand-drawn sketches, providing a new path for automating engineering simulation.
Related articles

Tencent WorkBuddy in Practice: Building an AI Automated Testing Workbench with SKILL Capabilities
Based on Bilibili creator Baili Yang's sharing, this article analyzes how Tencent WorkBuddy AI agent desktop workbench can be used for automated testing: the shift from AI-assisted to AI-led, the relationship among large models, agents, and SKILL capabilities, zero-configuration installation and permission control, and practical ideas for building a personal AI automated testing workbench.

Adding Authentication to Remix SaaS Apps: A Practical Guide to WorkOS AuthKit
Based on the official WorkOS AuthKit guide, this article covers the full approach to integrating authentication in Remix or React Router SaaS apps, including session management, protected routes, multi-tenant organizations, enterprise SSO, and SCIM sync, and analyzes its engineering value for SaaS teams.

Claude Code v2.1.335 Update: Remote MCP Connections and Enhanced Terminal Experience
Claude Code v2.1.335 update explained: new claude mcp add --web remote MCP connections, Tab completion, fullscreen file peeking, harness-audit tool, and batch fixes for Windows/macOS and VS Code.