Text2CAD: Generating Sequential CAD Designs from Beginner-to-Expert Level Text Prompts

Mohammad Sadil Khan, Sankalp Sinha, Sheikh Talha Uddin, Didier Stricker, Sk Aziz Ali, Muhammad Zeshan AfzalNeurIPS 2024

Computer-Aided Design (CAD) is the backbone of modern engineering, but it is notoriously slow. Prototyping a complex part requires a tedious sequence of 2D sketches and 3D operations (like extrusions and fillets). While we’ve seen an explosion in "Text-to-3D" AI models recently, most of them output static meshes or point clouds—basically "digital statues" that are nearly impossible for an engineer to edit or parameterize.

A new paper from researchers at DFKI and RPTU, titled Text2CAD, introduces the first AI framework capable of generating actual parametric CAD design histories from natural language prompts. Whether you are a beginner asking for "a ring shape" or an expert specifying exact coordinates and radii, Text2CAD aims to automate the heavy lifting of 3D modeling.

TL;DR

Text2CAD is the first end-to-end AI framework that transforms natural language prompts into fully editable, parametric CAD construction sequences. By generating a step-by-step design history (sketches + extrusions) instead of a static mesh, it allows designers of all skill levels to generate and refine 3D models using intuitive text instructions.

What Problem Does This Paper Address?

The primary gap in AI-assisted design is editability. Professional CAD software doesn't just store a shape; it stores the recipe to make that shape. Existing text-to-3D methods fail here because they don't understand the underlying "CAD language" of constraints and parameters.

Furthermore, there is a massive data scarcity problem. We have plenty of CAD files, but very few of them are paired with high-quality natural language descriptions. Developing a system that can bridge the gap between "messy" human language and "precise" geometric parameters requires both a specialized architecture and a massive, multi-level dataset.

Methods

The authors tackled this with a two-pronged approach: a novel data pipeline and a specialized transformer architecture.

1. The Data Pipeline

To create the necessary training data, they used a two-stage "Chain-of-Thought" annotation process. First, a Vision Language Model (LLaVA-NeXT) looked at multi-view images of existing CAD models to generate abstract shape descriptions. Then, a Large Language Model (Mistral-50B) combined these descriptions with raw CAD metadata to produce four levels of prompts:

  • L0 (Abstract): Simple object names (e.g., "a cylindrical object").
  • L1 (Beginner): Simplified design steps without jargon.
  • L2 (Intermediate): Generalized geometric descriptions.
  • L3 (Expert): Precise technical instructions with exact numerical values.
Examples of the four prompt levels (L0 to L3) generated for a single CAD model.

2. The Text2CAD Transformer

The model uses a pretrained BERT encoder to process the text. Crucially, they added a trainable Adaptive Layer to "translate" general BERT embeddings into the specific vocabulary of CAD. The core of the model is a Transformer Decoder that uses layer-wise cross-attention. This allows the model to constantly refer back to specific parts of the text prompt while it "writes" the CAD construction sequence token by token.

The Text2CAD architecture featuring a frozen BERT encoder, a trainable Adaptive Layer, and an autoregressive Transformer Decoder.

Datasets

The researchers utilized the DeepCAD dataset, which contains roughly 170,000 professional CAD models. Using their automated pipeline, they generated approximately 660,000 text annotations, creating the first large-scale multi-level text-to-parametric-CAD dataset.

Key Insights and Ideas

  • CAD as a Language: The researchers treat CAD modeling as a sequence-to-sequence problem. Just as a sentence is a sequence of words, a CAD model is a sequence of "tokens" representing coordinates, line types, and extrusion depths.
  • The Power of Multi-Level Prompts: By training on everything from abstract descriptions to expert specs, the model becomes robust. It learns that "a hollow cylinder" and "draw two concentric circles and extrude" refer to the same geometric outcome.
  • CoT for Data Generation: They found that generating instructions directly from raw metadata led to "hallucinations." Using the VLM-generated visual description as an intermediate step significantly improved the quality and "human-likeness" of the training prompts.

Key Results

Text2CAD significantly outperformed the baseline (a modified version of the original DeepCAD model) across almost every metric:

  • Geometric Accuracy: The median Chamfer Distance (a measure of how closely the generated shape matches the target) dropped from 32.82 to 0.37—a massive leap in precision.
  • Parametric Precision: The F1 score for generating "Arcs" improved by 80% compared to the baseline.
  • Robustness: The "Invalidity Ratio" (how often the model generates "broken" geometry) was reduced to just 0.93%.
  • Human Preference: In user studies, professional CAD designers preferred Text2CAD’s outputs over the baseline, especially as the complexity of the prompts increased.

Limitations and Future Work

Despite the breakthrough, the authors note a few hurdles:

  • VLM Sensitivity: The initial shape descriptions are only as good as the VLM's "eyes." Perspective distortions in the multi-view images can sometimes lead to incorrect text descriptions.
  • The "UNK" Problem: Standard text tokenizers (like BERT's) aren't built for engineering. They often treat specific numerical values as "Unknown" tokens, which can hurt precision in the "Expert" prompt category.
  • Dataset Diversity: The DeepCAD dataset is heavily biased toward simple primitives like boxes and cylinders. Future work will need to focus on more organic or highly complex industrial parts to improve the model's robustness.

Summary updated

BibTeX
@inproceedings{khan2024text,
  author = {Mohammad Sadil Khan and Sankalp Sinha and Sheikh Talha Uddin and Didier Stricker and Sk Aziz Ali and Muhammad Zeshan Afzal},
  title = {{Text2CAD: Generating Sequential CAD Designs from Beginner-to-Expert Level Text Prompts}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=5k9XeHIK3L},
}
Figure