All summaries · 2026-09-17

DeepCAD: A Deep Generative Network for Computer-Aided Design Models

Unknown authors

arXiv:2105.09492 · abstract · pdf · summarized by meta/muse-spark-1.3-contributor on 2026-09-17

The one-paragraph version

This paper introduces DeepCAD, the first deep generative model that creates 3D shapes the way engineers do — as a sequence of computer-aided design operations rather than as a cloud of points or a mesh of triangles. The authors treat a CAD program like a sentence: sketch a closed outline on a flat plane, then extrude it into a solid, then add or cut the next solid, and so on. They build a fixed-size, quantized representation for those operations so a neural network can read them, train a Transformer-based autoencoder that compresses any sequence into a compact latent vector and decodes it back, and then train a GAN in that latent space to invent new vectors that decode into new valid designs. To make this work they also release a new dataset of 178,238 real Onshape models converted into sketch-plus-extrusion sequences, far larger than the prior 8,000-model Fusion 360 Gallery set. The result generates clean, sharp, editable solids that score about as well as point-cloud generators on point-cloud metrics, while remaining directly importable into CAD tools.

The problem they're solving, and why it matters

Almost all prior 3D generators output discretizations — meaning approximations made of many tiny pieces. That includes voxels, which are 3D pixels filling a grid, point clouds, which are sparse dots sampled on a surface, and polygon meshes, which are triangle faces stitched together. Those are useful for rendering and vision, but they are noisy, lose sharp edges, and are painful to edit: you cannot easily say “make this hole twice as wide” on a point cloud.

Real industrial design starts elsewhere. An engineer opens SolidWorks, AutoCAD, or Onshape and builds a construction history: draw a 2D profile, extrude it into 3D, join it to or cut it from what exists, repeat. Behind the scenes the CAD kernel computes a boundary representation, often shortened to B-rep, which means the exact mathematical faces, edges, vertices and how they connect to form a watertight solid. The command sequence can always be turned into a B-rep, but the reverse is very hard because many different histories can give the same final shape.

The missing piece, the authors argue, is a generator of the history itself. If you can generate the commands and their numbers, you get parametric, editable, sharp geometry for free, plus you can later convert to meshes or points if you want. The difficulty is that CAD histories are sequential and irregular: different commands carry different numbers of parameters, some discrete choices like whether to join or cut, and some continuous numbers like positions and angles that must satisfy strict relations like parallel or perpendicular.

The key idea, in plain words

Think of CAD as language. A sketch profile is like the subject of a sentence — “this square with a circular hole” — and the extrusion that lifts it into 3D and merges it is like the verb — “extrude 5 mm and join.” Just as sentences are words in order, a CAD model is commands in order, and dependencies matter: you cannot extrude a profile before you have sketched it.

To let a language-style model handle this, the authors do two unifying tricks. First, they restrict to the most-used vocabulary: three curve types for sketching plus one extrusion command, and force every command into the same shape, a list of 16 parameter slots with unused slots marked as empty. Second, they turn all continuous numbers into discrete choices by normalizing and quantizing — meaning scaling shapes into a fixed box and rounding values to one of 256 levels, like converting smooth volume into 256 volume steps. That lets the network classify rather than regress, which means pick the right bin rather than guess an exact decimal, and that protects precise geometric relations from small numeric wobble.

On top of that they use a Transformer, which is an attention-based neural network originally built for text that learns which earlier tokens each later token should pay attention to, arranged as an autoencoder, which is an encoder that compresses input to a latent vector followed by a decoder that rebuilds it. The latent vector here means a 256-number summary of a whole CAD model. Once that space is learned, random sampling there yields new CAD programs.

How it actually works, step by step

Start with a concrete example. To make a flat plate with a hole, you might start Loop 1: begin a loop, draw four lines that return to the start, forming the outer square. Start Loop 2: begin a loop, draw a circle for the hole. Those loops together bound one profile, meaning a filled 2D region with a hole. Then an extrude command says how that profile’s plane sits in 3D space, how large it is, how far to pull it in each direction, and what boolean to apply, where boolean means how to combine solids: start a new body, join, cut, or intersect.

The paper formalizes that as: a model is a fixed-length list of 60 commands, padded with an end marker if shorter. The command types are start-of-loop, often written as SOL, line, often written as L, arc, often written as A, circle, often written as R, extrude, often written as E, and end-of-sequence, often written as EOS. A line needs only its end point because it starts where the previous curve ended; an arc needs an end point plus sweep angle, meaning how far around it goes, plus a flag for clockwise versus counter-clockwise; a circle needs center and radius; an extrude needs plane orientation angles, plane origin, profile scale, two extrude distances, boolean type, and one-sided versus symmetric versus two-sided type.

Before training, every model is scaled into a two-by-two-by-two cube, every sketch is scaled into its own unit square with a remembered scale factor, and all continuous values are rounded to 8-bit integers. The authors sort loops and curves by a consistent bottom-left rule so the same shape does not appear in many random orders.

The network then works in three stages. First, embedding, which means turning each discrete command into a continuous vector. Each command gets a sum of three learned embeddings: one for its type, one for its 16 quantized parameters, and one for its position in the sequence. Second, encoding: a four-layer Transformer encoder with eight attention heads reads all 60 embeddings and averages its outputs into one 256-dimensional latent vector. Third, decoding: a matching four-layer Transformer decoder starts from learned constant queries, attends to the latent vector, and predicts all 60 command types and parameters at once in a feed-forward way, not left-to-right autoregressive generation. Training uses standard cross-entropy loss, which means penalty for picking the wrong discrete bin, with twice the weight on parameters versus types, while ignoring padded commands and unused parameters.

For generation from scratch, the authors freeze the autoencoder and train a small latent GAN, where GAN means a generator network that tries to fool a discriminator network into thinking its outputs are real. Both are simple four-layer perceptrons trained with Wasserstein GAN plus gradient penalty on the 256-dimensional latent vectors. At run time they sample Gaussian noise, map it to a latent vector, and decode to commands.

To train all this they built a new dataset. Starting from the ABC dataset of one million Onshape B-reps, which lacked operation histories, they used Onshape’s FeatureScript language to re-parse histories, kept only models buildable with sketch plus extrude, and ended with 178,238 sequences split 90 percent train, 5 percent validation, 5 percent test. They note line, arc, and circle cover 92 percent of curve cases in that data, and they deduped the test set by Chamfer Distance to remove near-duplicates from training.

What they showed — results, honestly, with limitations

For autoencoding — compress then rebuild unseen models — the base model recovers the command type correctly about 99.36 percent of the time, a metric they call Command Accuracy, and recovers parameters within a small tolerance of 3 out of 256 levels about 97.47 percent of the time, a metric they call Parameter Accuracy. The shape error, measured by Chamfer Distance, which means the average nearest-point distance between 2,000 dots sampled on the true versus rebuilt surfaces, has a median of about 0.787 thousandths. About 3.30 percent of outputs are invalid, meaning they fail to produce a watertight topology and cannot even be point-sampled. Adding synthetic augmentation by randomly mixing sketch-extrude pairs from two models improves all numbers to 99.50 percent, 97.98 percent, 0.752 thousandths, and 2.72 percent invalid.

Ablations justify the representation choices. Representing arcs by middle point instead of angle performs similarly. Including extra start-point numbers in extrusion, or worse, using relative instead of absolute curve positions, hurts shape quality even when parameter accuracy looks good, because small errors accumulate around a loop and cause self-intersections; one yellow example in the paper shows two triangles colliding. Regressing continuous values directly instead of quantizing is much worse, with median Chamfer Distance jumping to about 2.14 thousandths, because it breaks parallel and perpendicular relations.

For random generation, converted to point clouds for comparison with a well-known point generator called l-GAN, DeepCAD is comparable: Coverage, meaning fraction of real shapes that have a close generated neighbor, 78.13 percent versus 77.73 percent; Minimum Matching Distance, meaning fidelity of the closest match, 1.45 versus 1.27 hundredths where lower is better; Jensen-Shannon Divergence, meaning similarity of overall point distributions, 3.76 versus 5.02 hundredths where lower is better. Qualitatively the CAD outputs look sharper and remain editable, unlike lumpy point clouds.

The authors also show cross-dataset generalization: trained only on Onshape data, the model still reaches about 97.90 percent command accuracy and 0.796 thousandths median distance on Fusion 360 Gallery tests. As a demo application, they map scan-like point clouds through a PointNet++ encoder into the same latent space to reconstruct CAD, then edit the result in CAD software with operations like move-face or fillet, though quantitative scores there drop to around 85.95 percent command accuracy and 12 percent invalid, worse with added noise.

Limitations are stated plainly. Only sketch plus extrude with lines, arcs, and circles is supported — no Bézier splines, revolve, fillet, or chamfer that needs a reference to the B-rep, not just prior commands. Validity is not guaranteed and degrades for long sequences over about 30-40 commands, partly because long examples are rare in the data. Mean Chamfer Distance is much higher than median because rare topology failures create huge outliers.

Why this might matter to me

If you care about spatial reasoning in language and vision models, this is an early proof that operation sequences are a better mother tongue for 3D than triangles or dots: a short program captures symmetry, repetition, and contact that a point cloud can only hint at, and attention over ordered commands learns those long-range dependencies. For world models, which need compact, predictive states of physical scenes, a 256-number CAD latent that decodes to an exact solid plus a boolean history is far more actionable than a voxel grid — you can reason about support, attachment, and affordances from the construction steps.

For text-to-CAD and parametric geometry, DeepCAD supplies both the missing tokenizer and the missing corpus: the 16-slot quantized command, the ordering rules, and 178k histories give you a target representation that large language models can later be conditioned on, which is exactly the path later SkexGen and Fusion 360 work followed. For 3D generation and scene representation, it suggests a hybrid future: use diffusion or autoregressive transformers to propose coarse structure, but decode to parametric sketches and extrusions so outputs stay sharp, watertight, and editable, then compose those parts into scenes rather than generating undifferentiated soup.

Terms worth knowing

Computer-aided design model here means a history of operations that builds a solid, not the final triangles. Sketch means 2D curves drawn on a plane; loop means one closed chain of curves; profile means the filled region bounded by one or more loops, for example a square with a circular hole. Extrusion means pulling a profile along its normal into a 3D body. Boolean operation means the merge rule: new body, join, cut, or intersect. Boundary representation, or B-rep, means the exact faces, edges, vertices and their connectivity computed from the history. Quantization means rounding continuous numbers to 256 discrete bins after normalizing into a fixed box. Transformer means a neural network that uses attention to weigh relationships across a sequence. Autoencoder means an encoder-decoder pair that learns a compressed latent vector that can rebuild the input. Latent GAN means a GAN trained on those latent vectors to sample new ones. Chamfer Distance means average nearest-neighbor distance between two point sets sampled on surfaces. Command Accuracy and Parameter Accuracy mean fraction of correctly predicted command types and, given correct type, parameters within tolerance. Invalid Ratio means share of decoded sequences that fail to form a valid solid.