Vision language models turn sketches into physical simulation code

Perception Before Simulation: Sketch-Based Generation of Multibody Simulation Code With Vision Language Models

Artificial Intelligence

Summary

Simulating how mechanical systems move usually requires writing detailed computer code, which can be hard and error-prone. The researchers studied whether models that understand both pictures and language can create this simulation code just from simple sketches of the machines. Their method first translates the sketch into a basic representation before making the code, which worked much better than making code directly from the sketch. Using sketches helped the model understand the system layout, though combining sketches with text descriptions gave even better results. This approach could help engineers quickly turn their drawings into simulations without manually coding everything.

What this means in practice

  • For mechanical design engineers: Convert engineers’ sketches of mechanical systems directly into verified dynamic simulation models to accelerate design iteration.
  • For software developers for cad tools: Integrate vision-based code generation to enable sketch-to-simulation workflows within computer-aided design software for mechanical parts.$Commercial implications: Enables new automated simulation features in CAD software that can be marketed to engineering firms seeking faster prototyping.

Authors

Tobias Möltner, Peter Manzl, Sebastian Weyrer, Michael Pieber

Abstract

Large language models (LLMs) can generate multibody simulation models from textual descriptions, but for complex mechanical systems these descriptions become lengthy and error-prone, whereas a sketch conveys the same mechanical system compactly. This study investigates whether Vision Language Models (VLMs) can generate physically correct multibody simulation code directly from sketches of mechanical models. In an automated closed-loop benchmark, 23 parameterized mechanical models are rendered as annotated sketches, and every generated simulation model is verified against ground truth by executability, graph isomorphism, and parameter and trajectory agreement. Across 12 open-weight VLMs, a two-stage pipeline that first extracts a code-agnostic intermediate representation of the sketched mechanical model doubles the success rate of simulation code generation compared to direct code generation by the VLM (48.0% vs. 23.9%). With code generation held fixed by a single coder LLM, so that only perception varies, replacing the textual description with a sketch lowers success from 94.8% to 48.0%, and to 78.2% when the textual description accompanies the sketch. An ablation attributes the gain to pre-selecting the element types shown in the sketch. Error classification and robustness tests to scaling and rotation locate the remaining failures in reading the drawing rather than in code generation. The pipeline transfers to hand-drawn sketches. Turning an engineer's sketch directly into a verified dynamic simulation opens a route to automating model creation in computational mechanics.