Source-linked AI summary

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

Rundi Wu, Chang Xiao, Changxi Zheng

arXiv:2105.09492v2cs.CVcs.GRcs.LG

TL;DR

Existing 3D generative models generally produce discrete shapes, leaving CAD construction processes—sequential, parametric, and widely used in industrial design—underrepresented. DeepCAD addresses this gap with a Transformer-based autoencoder that generates CAD-operation sequences, producing plausible and diverse designs while introducing a large CAD-sequence dataset. Its outputs remain subject to topological validity limitations, especially for longer command sequences and operations requiring B-references.

  • Problem

    Existing 3D generative models mainly generate discrete representations, while the sequential and irregular CAD construction process remains difficult to model.

  • Method

    DeepCAD unifies CAD command types, parameters, and order, then uses a Transformer autoencoder to encode command sequences into latent vectors and decode them into CAD sequences.

  • Results

    DeepCAD generates plausible and diverse CAD designs with sharp geometric details that can be readily user edited.

  • Takeaways & Limitations

    The work provides a direct generative model for CAD designs and a large dataset of CAD models represented by command sequences.

  • Takeaways & Limitations

    The network cannot guarantee topological soundness; failures become more likely for quite long command sequences, and some operations require references to the model's B-rep.

Abstract

from arXiv · show

Deep generative models of 3D shapes have received a great deal of research interest. Yet, almost all of them generate discrete shape representations, such as voxels, point clouds, and polygon meshes. We present the first 3D generative model for a drastically different shape representation --- describing a shape as a sequence of computer-aided design (CAD) operations. Unlike meshes and point clouds, CAD models encode the user creation process of 3D shapes, widely used in numerous industrial and engineering design tasks. However, the sequential and irregular structure of CAD operations poses significant challenges for existing 3D generative models. Drawing an analogy between CAD operations and natural language, we propose a CAD generative network based on the Transformer. We demonstrate the performance of our model for both shape autoencoding and random shape generation. To train our network, we create a new CAD dataset consisting of 178,238 models and their CAD construction sequences. We have made this dataset publicly available to promote future research on this topic.

1. Introduction

DeepCAD addresses the missing ability to generate 3D designs as CAD construction processes rather than only discrete shape representations. It uses a Transformer-based generative network to produce plausible, diverse, sharp, and user-editable CAD designs.

  • Existing 3D generative models mainly produce discrete representations such as point clouds, meshes, and levelset fields, rather than the drawing process.
  • DeepCAD generates sequences of CAD operations, including commands and parameters, to represent how a 3D shape is constructed.CAD models can later be discretized into polygon meshes or point clouds when needed.
  • CAD sequences are challenging because geometric operations are sequential, parametric, and governed by both discrete options and continuous values.
  • The method unifies command types, parameters, and sequential orders, then uses a Transformer autoencoder to map CAD models into latent vectors and decode them into command sequences.
  • DeepCAD produces plausible and diverse CAD designs with clean shapes, sharp geometric features, and readily user-editable outputs.

2. Related work

Related work includes parametric shape inference, operation-based shape synthesis, domain-specific languages, and Transformer-based generation. DeepCAD differs by directly generating ordered CAD-operation sequences suitable for CAD tools and downstream shape formats.

  • Parametric shape inference: Parametric shape inference methods analyze point clouds, boundary representations, or sketches to recover parametric surfaces, curves, or CAD operations.
  • Operation-based and DSL methods: CSGNet and UCSG-Net infer sequences of constructive solid geometry operations from voxelized shapes, while other methods synthesize shapes through domain-specific languages.
  • DeepCAD: DeepCAD directly outputs CAD models as ordered CAD-operation sequences, unlike prior approaches using CSG or other domain-specific representations.Its outputs can be imported into CAD tools and converted into point clouds or polygon meshes.
  • Transformer-based models: Compared with SVG generation, CAD commands are 3D, interdependent, and order-constrained, requiring a specialized encoding strategy.

3. Method

DeepCAD represents CAD designs as structured command sequences and uses a Transformer-based autoencoder to model them. The method introduces network-friendly CAD representations, a large command-sequence dataset, and cross-entropy training.

  • CAD Representation: CAD models are represented as user-interaction sequences of operations rather than B-reps, preserving human-editable construction information.Different command sequences can produce the same B-rep, while command sequences can be imported into CAD tools for editing.
  • CAD Representation: The representation covers frequently used sketch and extrusion commands, with sketches organized as loops and profiles.Curve commands include lines, arcs, and circles; extrusion commands create bodies and specify one-sided, symmetric, or two-sided operations and boolean merging.
  • CAD Representation: Each command combines a command type with parameters, while profiles and loops impose a structured sequential organization.Loops begin with ⟨SOL⟩, curves are ordered counter-clockwise, and profiles are lists of loops.
  • Autoencoder: The Transformer autoencoder embeds command sequences, encodes them into a latent vector, and decodes predicted command sequences.The decoder attends to the latent vector and becomes a CAD generative model after training.
  • Dataset and Training: The authors create a publicly available dataset of 178,238 CAD designs represented by command sequences.The dataset is split randomly into training, validation, and test sets using a 90%-5%-5% ratio.

4. Experiments

The experiments evaluate DeepCAD through CAD-model autoencoding and latent-space generation, using command, parameter, geometric, and point-cloud metrics. Results indicate that augmentation improves autoencoding, the model generalizes across datasets, and generated CAD shapes are comparable to l-GAN under point-cloud metrics while retaining editable parametric structure.

  • Autoencoding of CAD Models: Autoencoding is evaluated by comparing reconstructed CAD models with inputs using command accuracy, parameter accuracy, Chamfer Distance, and topology validity.Command accuracy measures recovered command types; parameter accuracy measures parameters within correctly recovered commands, while Chamfer Distance measures sampled surface geometry.
  • Autoencoding of CAD Models: Ours+Aug achieves the best performance, suggesting that randomly composed CAD command sequences improve the network’s generalization ability.The augmented variant uses the same representation and objective as the proposed model but adds randomly composed command sequences, which may occasionally be invalid.
  • Autoencoding of CAD Models: Alt-ArcMid performs similarly to Ours, supporting middle-point arc representation as a viable alternative.Alt-ArcMid specifies arcs using ending and middle-point positions rather than the sweeping angle and counter-clockwise flag.
  • Autoencoding of CAD Models: Alt-Rel can achieve higher ACCparam than Ours yet produce larger CD and invalid topology because relative curve-position errors accumulate around loops.The comparison shows that parameter accuracy alone may not reflect geometric validity.
  • Autoencoding of CAD Models: Alt-Regr suffers larger errors that can break geometric relations such as parallel and perpendicular edges because it directly regresses continuous parameters.The proposed representation instead quantizes continuous parameters after normalization, making all command parameters discrete.
  • Autoencoding of CAD Models: The autoencoder generalizes well across datasets, achieving comparable quantitative performance on Fusion 360 designs after training on Onshape models.The datasets come from different sources, providing a cross-dataset test of reconstruction performance.
  • Shape Generation: DeepCAD generates CAD shapes with comparable point-cloud metrics to l-GAN, while producing smoother surfaces, sharper details, and directly editable CAD models.The comparison is intended to demonstrate comparable shape quality under point-cloud metrics rather than superiority across different application areas.

5. Discussion and Conclusion

DeepCAD introduces a generative model for CAD designs and a large CAD command-sequence dataset. Its outputs may lack topological soundness, especially for longer command sequences, and several operations remain future work.

  • Limitations: Operations such as fillet require references to the model’s B-rep, which the current generative model does not incorporate.Supporting additional curve commands and operations such as revolving a sketch is described as feasible, while B-rep-dependent operations remain future work.
  • Limitations: The network cannot guarantee topological soundness because some generated CAD command sequences do not produce valid shapes.The paper reports that failures are rare in practice but become more likely as command sequences grow quite long.
  • Conclusion: DeepCAD is presented as a generative model for CAD designs, accompanied by a large dataset representing models as CAD command sequences.The paper characterizes this as the first generative model for CAD designs.

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

The supplementary document section identifies the paper’s authors and Columbia University affiliation, along with their contact addresses.

  • Author information: The paper lists Rundi Wu, Chang Xiao, Changxi Zheng, and Columbia University as the authors and affiliation.The supplied text also gives the contact addresses {rundi, chang, cxz}@cs.columbia.edu.

A. CAD dataset

The CAD dataset is parsed from user-created models in Onshape’s online repository and emphasizes diverse mechanical parts rather than category-specific objects. Its distribution is analyzed by sequence length and extrusion count, with duplicate test shapes removed using Chamfer distance.

  • Dataset construction: The dataset parses CAD command sequences from Onshape’s online repository and mostly contains diverse, user-created mechanical parts.Unlike category-focused 3D shape datasets, its models are primarily mechanical parts with varied shapes.
  • Dataset construction: Duplicate test shapes inherited from the ABC dataset are removed when their nearest training-set neighbor falls below a Chamfer-distance threshold.The filtering is performed separately for each test shape.
  • Dataset statistics: Most CAD command sequences are no longer than 40 operations or use fewer than 8 extrusions.The paper attributes this distribution to manual user creation and notes a similar command-length distribution in the Fusion 360 Gallery.
  • Dataset statistics: Figure 8 summarizes the training data by command sequence length and number of extrusions.The figure provides the two requested distribution views without reporting additional values in the supplied caption.

B. Command Parameter Representation

DeepCAD normalizes CAD geometry and parameters into bounded ranges, then quantizes continuous values into 256 levels while retaining discrete command attributes.

  • Parameter preprocessing: The full command-parameter vector is normalized and quantized before being processed by the model.The listed vector includes sketch, extrusion, orientation, scale, CSG, and other command parameters.
  • Parameter preprocessing: Each CAD model is scaled within a 2 × 2 × 2 cube without translation to bound its geometric parameters.The sketch-plane origin and two-side extrusion distances are constrained to [−1, 1], while scale and orientation use separate ranges.
  • Parameter preprocessing: Each sketch profile is normalized to a unit square with its starting point at the center, bounding endpoint coordinates and circle radius in [0, 1].The arc sweep angle remains in [0, 2π] by definition.
  • Parameter encoding: Continuous parameters are quantized into 256 levels and represented as 8-bit integers, while discrete parameters retain their values.The discrete fields encode arc direction, CSG operation type, and extrusion type using their specified categorical values.

C. Network Architecture and Training Details

The network combines Transformer-based autoencoding with a latent-GAN for CAD generation, using fixed-dimensional command representations and specified training settings.

  • Autoencoder: The Transformer encoder and decoder each contain four blocks with eight attention heads, feed-forward dimension 512, layer normalization, and dropout 0.1.
  • Autoencoder: Separate decoder heads predict command types and parameters, with the parameter output reshaped to represent 16 command parameters.
  • Latent-GAN: The latent-GAN uses four-hidden-layer MLP generator and discriminator networks, with noise dimension 64 and output dimension 256.
  • Training data: The dataset contains CAD models and construction sequences used to train the network.
  • Latent-GAN: WGAN-gp training runs for 200,000 iterations with batch size 256, five critic iterations, gradient-penalty weight 10, and Adam learning rate 2 × 10^-4.

D. Autoencoding CAD models

The autoencoding study compares alternative CAD sequence representations and continuous-parameter regression, while reporting reconstruction metrics and parameter-specific accuracy patterns.

  • Comparison methods: The study compares variants that alter curve positions, extrusion coordinates, arc representation, parameter regression, and sequence augmentation.
  • Comparison methods: Alt-Regr regresses continuous parameters with mean-squared error instead of quantizing them, while retaining Cross-Entropy for discrete parameters.
  • Comparison methods: Ours+Aug randomly mixes pairs of sketch and extrusion commands from two sampled sequences with 50% probability, excluding sequences containing only one such pair.
  • Results: Mean, trimmed mean, and median chamfer distances are reported for CAD autoencoding, with numerical values multiplied by 10^3.
  • Results: Figure 10 presents shape autoencoding results on Fusion 360 Gallery test data, using an autoencoder trained on the authors’ dataset.
  • Results: Fusion 360 Gallery test evaluation is reported using quantitative metrics, with higher-is-better and lower-is-better directions indicated in the table.
  • Results: Arc sweeping angle α has lower recovery accuracy because its values span the range [0, 2π] more evenly while arcs occur less frequently than other commands.

E. Generalization on Fusion 360 Gallery [48]

The model trained on the proposed dataset is evaluated on Fusion 360 Gallery data from a different source and performs well on the resulting different shape distribution, while long sequences remain difficult.

  • Cross-dataset evaluation: A model trained on the proposed dataset is tested on Fusion 360 Gallery data constructed from Autodesk Fusion 360 designs rather than the Onshape-based training source.
  • Evaluation: Table 6 reports CAD reconstruction from point clouds using the same metrics as autoencoding, including noisy inputs for Ours-noise.
  • Cross-dataset evaluation: The cross-dataset qualitative and quantitative results show good performance on shape distributions different from the training dataset.
  • Evaluation: Figure 14 provides a gallery of generated CAD models.
  • Failure cases: Longer CAD command sequences are more likely to produce invalid topology or misplaced sketches because topology is harder to preserve and long sequences are underrepresented.

G. Metrics for Shape Generation

Shape-generation quality is evaluated after converting CAD models to point clouds, using metrics that compare reference and generated shape sets for diversity, fidelity, and distributional similarity.

  • Evaluation setup: The evaluation converts CAD models into point clouds before computing three metrics by comparing reference set S with generated set G.
  • Coverage: Coverage measures diversity as the fraction of reference shapes matched by at least one generated shape.
  • Coverage: Coverage matching uses chamfer distance between point clouds as the shape-distance function.
  • Minimum matching distance: Minimum matching distance measures fidelity by averaging each reference shape’s chamfer distance to its nearest generated neighbor.
  • Jensen-Shannon Divergence: Jensen-Shannon Divergence measures similarity between reference and generated marginal point distributions.
  • Jensen-Shannon Divergence: The JSD computation uses KL divergence between each distribution and their mixture M, with point distributions approximated on 28^3 voxel grids.
  • Evaluation setup: Scores average three evaluations, each using 1,000 randomly sampled reference shapes and 3,000 generated shapes.
Loading 2105.09492v2…