NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Vitruvion: A Generative Model of Parametric CAD Sketches

Ari Seff, Wenda Zhou, Nick Richardson, Ryan P Adams

Introduction

Parametric computer-aided design (CAD) tools are the predominant way engineers specify physical structures, from bicycle pedals to airplanes. Unlike standard drawing tools that produce pixels or vectors, parametric CAD relies on parametric sketches. These sketches act as constraint programs: design intent is encoded not only via geometric primitives (lines, arcs, circles) but also by parameterized algebraic constraints (such as "tangent," "parallel," or "coincident") between these elements. If a designer changes the diameter of a hole, the surrounding parts automatically adjust to maintain these geometric relationships.

Creating these sketches is a tedious, manual process. While machine learning has made significant strides in artistic sketching, engineering CAD presents a unique challenge: models must understand the relational "design intent" behind the geometry. Vitruvion is a transformer-based generative model designed to bridge the gap between rough human input—like a hand-drawn scribble—and a fully realized, constrained, and editable CAD model.

Vitruvion translates a rough hand-drawn sketch into a fully constrained parametric CAD model, which can then be extruded into a 3D part.

Methodology

The authors treat CAD sketch generation as a sequence modeling problem, factorizing it into two main stages:

  1. The Primitive Model: A decoder-only transformer autoregressively generates a sequence of geometric primitives (lines, circles, arcs, and points). Each primitive is defined by its type and quantized coordinates.
  2. The Constraint Model: An encoder-decoder transformer processes the generated primitives. The encoder "reads" the primitives, and the decoder outputs a sequence of constraints. Because constraints must reference specific parts of primitives (e.g., "this line is tangent to that circle"), the model utilizes pointer networks, allowing it to "point" to specific indices in the primitive sequence.

Vitruvion can be conditioned on various contexts to assist different stages of the design workflow:

  • Autocomplete: Predicting the remainder of a sketch given a partial prefix.
  • Autoconstrain: Inferring the most likely constraints for a set of existing, unconstrained primitives.
  • Image-to-CAD: Using a Vision Transformer (ViT) encoder to translate a raster image of a hand-drawn sketch directly into a parametric CAD model.

Training and Dataset

The model is trained on the SketchGraphs dataset, which contains millions of real-world sketches extracted from the Onshape CAD platform. The researchers filtered and deduplicated this data to create a high-quality set of 1.7 million unique sketches, focusing on the four most common primitives: arcs, circles, lines, and points.

Key Insights

  • CAD as a Language: By representing a sketch as a sequence of tokens (Type, Value, ID, Position), the authors successfully applied the same transformer architectures that have revolutionized Natural Language Processing to mechanical engineering.
  • The Importance of Noise Injection: A critical discovery was that the constraint model performs poorly on real-world, imprecise inputs if trained only on perfect data. By injecting Gaussian noise into the primitive coordinates during training, the model learns to "fix" imprecise human drawings, snapping them to the intended geometric relationships.
  • Implicit Hierarchy: Although a CAD sketch is technically an unordered set of constraints, the order in which engineers naturally create these sketches contains useful hierarchical information. Training the model to respect this human-centric ordering significantly improved performance.

Results

Vitruvion demonstrates strong quantitative and qualitative performance:

  • Quantitative Performance: The model achieved a significantly lower Negative Log-Likelihood (NLL) compared to baselines like uniform sampling or standard compression algorithms. For the primitive model, it achieved a next-step prediction accuracy of 71.7%.
  • Image Synthesis: When conditioned on hand-drawn images, the model reached 82.2% accuracy in predicting the correct sequence of primitives.
  • Qualitative Success: Vitruvion successfully takes messy, hand-drawn scribbles and produces solved CAD sketches that can be imported directly into professional software (like Onshape) for downstream 3D modeling.

Limitations and Future Work

While Vitruvion represents a significant step toward an "AI co-pilot" for mechanical engineers, it has a few limitations. Currently, the model is restricted to 2D sketches; future work could extend this to 3D construction operations (like extrusions and fillets) and 3D point cloud inputs. Additionally, the model occasionally struggles with non-axis-aligned lines in hand drawings, as these are less common in the training data. Finally, the current version focuses on categorical constraints (e.g., tangency) and omits numerical constraints (like specific scale dimensions) or complex "hyperedge" constraints involving more than two primitives.

Summary updated

BibTeX
@inproceedings{seff2022vitruvion,
  author = {Ari Seff and Wenda Zhou and Nick Richardson and Ryan P Adams},
  title = {{Vitruvion: A Generative Model of Parametric CAD Sketches}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=Ow1C7s3UcY},
}
Figure