TimelineCAD thread · rev A2023 – 2024

CAD-RAG: retrieving and generating editable CAD

The problem

Most generative models for 3D shape output a mesh, and an engineer cannot change a hole diameter in a mesh. A new part also usually starts from an existing one, so finding the right old design is as useful as generating a new one.

Authors
A. Ananthakrishnan, A. Bharathi, V. Dharanivendhan, M. Ramanathan
Venue
Journal of WSCG, 2025
Lab
AGC Lab, IIT Madras
Output
Fusion 360 model with full construction history
Text and sketch retrieval in CAD-RAG. The recording follows the search results through to an edited part in Fusion 360.

The idea

We tested two routes to editable CAD. One generates the modelling commands directly. The other finds a similar model and edits its commands. I worked mainly on building the data that made retrieval possible.

1Background

We wanted a result someone could keep working on in Fusion 360. For that we needed the sketches, extrusions and cuts that produce the geometry.

2What we built

Querytext, image or sketchThree encodersViT image, BERT text,ViT sketchRetrieve137,004 CAD modelsChosen modelwith its commandsequenceEdit instructionplain languageLLM editfew-shot, retrievedexamples in promptPoint cloudor sketchJoint latent spacesymmetric InfoNCETransformer decodercommand sequence,autoregressiveFusion 360full constructionhistory
Fig. 1Two routes to an editable model. Top and middle rows: retrieve a model, then edit it with a language model. Bottom row: generate the command sequence directly (MultiCAD).

Generate a model. We trained a Transformer decoder to write modelling commands one token at a time. The sketch and point-cloud encoders learn a shared representation by bringing two views of the same part together. That lets the decoder start from either of those inputs.

Find a model to reuse. We aligned text, image and sketch encoders so the search could rank the same library from any of those queries. A text query can say what a part is for, while a sketch can show an outline that's awkward to describe.

Edit its construction sequence. The language model gets the selected part's commands, the requested change and examples retrieved for that query. Starting from an existing sequence gives it the part's sketches and features to work with. The edited model opens in Fusion 360 with that construction history.

Prototype interface with a text query and ranked results
Fig. 2A text query and its ranked results.
An edited sketch open in Fusion 360
Fig. 3An edited model open in Fusion 360.

3Building the data

Most of my work was on the retrieval data. We started with 178,238 DeepCAD models and deduplicated them down to 137,004. We paired the geometry with images, text and sketches so we could train the encoders to recognise when different descriptions refer to the same part.

A sketch drawn by hand often leaves out edges and details that are obvious in a CAD render. We collected more than 400 observational sketches and generated about 109,000 contour sketches from the models so the sketch encoder could learn from both.

4Result

In the paper, our method improved curve accuracy, loop accuracy and CLIP similarity over OpenECAD. It appeared in the Journal of WSCG in 2025. We later used the retrieval and editing workflow in desAIgn works.