Computer-Aided Design (CAD) generative modeling has a strong and long-term application in the industry. Recently, the parametric CAD sequence as the design logic of an object has been widely mined by sequence models. However, the industrial CAD models, especially in component objects, are fine-grained and complex, requiring a longer parametric CAD sequence to define. To address the problem, we introduce Mamba-CAD, a self-supervised generative modeling for complex CAD models in the industry, which can model on a longer parametric CAD sequence. Specifically, we first design an encoder-decoder framework based on a Mamba architecture and pair it with a CAD reconstruction task for pre-training to model the latent representation of CAD models; and then we utilize the learned representation to guide a generative adversarial network to produce the fake representation of CAD models, which would be finally recovered into parametric CAD sequences via the decoder of MambaCAD. To train Mamba-CAD, we further create a new dataset consisting of 77,078 CAD models with longer parametric CAD sequences. Comprehensive experiments are conducted to demonstrate the effectiveness of our model under various evaluation metrics, especially in the generation length of valid parametric CAD sequences. The code and dataset can be achieved from https://github.com/Sunny-Hack/Code-for-Mamba-CAD-AAAI-2025-.
Figures & tables
Figure 1: The gallery of CAD models created by Mamba-CAD, including visual illustrations of the created CAD models from CAD sequence reconstruction, completion, and random generation.
Figure 2: Common CAD commands discussed in this paper. < SOL > and < EOS > are two symbols for representing the start of one loop and the end of a whole parametric CAD sequence, respectively. f is a counter-clockwise flag.
Figure 3: The overview of our Mamba-CAD architecture. The whole pipeline can be divided into three parts which marked in three different colored line-arrows. (Pre-training stage ⟶ ) : We leverage a task of CAD sequence reconstruction to pre-train the encoder and decoder of Mamba-CAD. Given a mini-batch of CAD-models, their corresponding parametric CAD sequences would be first discretized into friendly network representations (Sec. CAD sequence representation CAD sequence representation ). Next, these representations keep going forward Fusion Embedding, Encoder, and Decoder of Mamba-CAD (Sec. Mamba-CAD Mamba-CAD ) to recover predicted parametric CAD sequences. ( Training stage ⟶ ) : When the pre-training stage is complete, the encoder parameters of Mamba-CAD would be frozen to produce the latent representation K that is further used to guide a 1-D Latent-GAN training. ( Generation stage ⟶ ) : Once the 1-D Latent GAN is well-trained, it enables to randomly sample the noise from a standard gaussian distribution and further feed it into Generator to produce the fake latent representation F , which would further undergo the decoder of Mamba-CAD to recover the parametric CAD sequence.
Dataset
TN
AL
[1-10]
[11-25]
[26-40]
[41-60]
[60-128]
DeepCAD
178,238
15
44.58%
38.73%
11.38%
5.31%
-
Mamba-CAD
77,078
38
-
41.25%
26.60%
16.13%
16.02%
Table 1: The statistic comparison of between DeepCAD dataset and Our Mamba-CAD dataset, including total number (TN), average length (AL) of parametric CAD sequences, and the length distribution.
Figure 4: Visual illustrations of CAD sequence reconstruction. GT represents Ground Truth. ∅ denotes the CAD sequence is invalid, leading to the failure of constructing a 3D shape. Please enlarge 200% for a clear view.
Method
Ac↑
Ap↑
MCD ↓
IR ↓
AL ↑
L ≥ 60 ↑
SR ↑
DeepCAD
96.49
87.38
2.97
14.83%
32.52
51.82%
86.58%
DeepCAD (++)
96.92
87.68
2.81
14.05%
32.49
50.85%
87.49%
TM-CAD
95.73
85.48
4.82
15.85%
31.21
50.31%
85.61%
Mamba-CAD
99.96
99.93
0.64
5.41%
38.91
85.18%
95.43%
Table 2: The comparison of Mamba-CAD and variants in CAD sequence reconstruction. MCD is multiplied by 103 . Ac , Ap , and IR are multiplied by 100%. L ≥ 60: the ratio of valid reconstructed CAD sequences (Length ≥ 60) in total CAD sequences (Length ≥ 60) within test set.
Method
Ac↑
Ap↑
MCD ↓
IR ↓
AL ↑
L ≥ 60 ↑
SR ↑
DeepCAD
83.75
69.77
79.08
42.36%
28.72
19.11%
59.19%
DeepCAD (++)
85.95
71.27
69.68
40.19%
29.78
20.74%
61.12%
TM-CAD
80.75
67.71
82.34
44.34%
28.26
17.79%
57.23%
HNC-CAD
-
-
-
-
30.51
42.89%
74.36%
Mamba-CAD
99.85
98.91
1.03
8.03%
35.43
79.46%
92.84%
Table 3: Quantitative results of CAD sequence completion.
Method
Ac↑
Ap↑
MCD ↓
IR ↓
SR ↑
DeepCAD
95.23
85.58
10.97
10.78%
90.34%
DeepCAD (++)
96.79
87.72
8.93
9.35%
91.22%
TM-CAD
90.94
83.85
12.46
12.37%
87.61%
Mamba-CAD
99.21
98.21
1.31
3.72%
96.51%
Table 4: The quantitative results of generalization ability in Fusion360 reconstruction dataset.
Figure 5: Visualizations of random generation of parametric CAD sequences.
Method
MMD ↓
JSD ↓
COV ↑
Unique ↑
Novel ↑
AL ↑
SR ↑
DeepCAD
3.51
8.93
63.77%
83.41
51.94
27.78
62.76%
SkexGen
2.96
7.39
65.89%
93.33
60.47
29.18
63.49%
HNC-CAD
2.65
6.07
70.43%
92.18
55.32
31.36
68.84%
Mamba-CAD
1.94
4.28
75.61%
94.73
63.25
36.75
74.13%
Table 5: The quantitative results of random generation of parametric CAD sequences. MMD, JSD, Unique, and Novel are all multiplied by 102 .
Parametric CAD modeling represents 3D designs as editable, constraint-driven construction histories and develops methods to generate, reconstruct, and revise them.
Convergence Research Center for Insect Vectors Incheon, South Korea · Department of Computer Science and Engineering Incheon National University Incheon, 22012, South Korea · Department of Computer Science and Engineering Center for Brain-Machine Interface Incheon National University Incheon, South Korea