MIRAGE-CAD: Construction-Mediated Multimodal Generation of Executable CAD Programs
Abstract
Recovering an executable parametric CAD program from an observed object is fundamentally ambiguous, because the same final geometry can result from different construction procedures. We study this problem from four types of input: natural-language descriptions, rendered images, point clouds, and STEP/B-Rep geometry. MIRAGE-CAD maps each input to a shared construction representation and mediates program generation through an explicit construction-plan interface. The resulting Python CAD code is executed by an OpenCASCADE kernel to build the solid and export it as STEP. On 2,500 held-out queries per modality, the system achieves 55.4-70.0% build success and 52.3-66.2% STEP export success without retrieval at inference. Controlled comparisons show that strong reconstruction does not depend on expressing the construction representation as text: a decoder conditioned directly on the continuous representation also reconstructs strongly, while an exposure-matched plan-based decoder shows no detected material loss in per-part geometric fidelity. The explicit plan instead provides a readable and separately measurable intermediate representation whose agreement with the reference construction is informative about downstream execution success. Finally, we show that executable validity, geometric fidelity, and parametric responsiveness can diverge substantially and should therefore be evaluated separately.
Figures & tables
| Modality | Observation content | Absolute scale |
|---|---|---|
| Text | Query description (up to 400 characters) | When explicitly stated |
| Image | Empty | No |
| Point cloud | Normalised shape and PCA statistics | No |
| STEP/B-Rep | Kernel-derived geometric statistics | Yes |
| Stage | Purpose | Trainable modules | Objective |
|---|---|---|---|
| 1 | Representation alignment | Projection heads, point/STEP encoders, and | |
| 2 | Latent prior fitting | Four modality-specific priors | |
| 3 | Plan-decoder adaptation | Prefix adapter and LoRA-IR | Plan NLL |
| 3b | Cross-modal continuation | Prefix adapter and LoRA-IR | Plan NLL |
| 4 | Code-decoder training | LoRA-Code | Program NLL |
| 4b | Predicted-plan continuation | LoRA-Code | Program NLL |
| Arm | Construction conditioning | Explicit plan | Role |
|---|---|---|---|
| B0 | None | No | Direct query-to-code baseline |
| B1a | Continuous | No | One-epoch direct-latent arm |
| B1b | Continuous | No | Extended direct-latent arm |
| B2 | Latent followed by plan | Generated | Deployed MIRAGE-CAD |
| B2-Pred | Latent followed by plan | Generated | One-epoch plan arm |
| B3 | Retrieved training construction | Retrieved | Retrieval reference |
| ID | Configuration | Syntax (%) | Build (%) | STEP Export (%) |
|---|---|---|---|---|
| B0 | Direct query code | 97.6 | 35.4 | 34.6 |
| B2 | Generated plan code | 94.5 | 70.0 | 66.2 |
| Metric | B1a latent | B2-Pred plan | B2 deployed |
|---|---|---|---|
| Syntax (%) | 95.8 | 95.8 | 95.2 |
| Build (%) | 86.2 | 90.4 | 71.4 |
| STEP export (%) | 85.6 | 90.0 | 67.4 |
| Unconditional F@1 / (%) | 73.0 | 76.8 | 53.6 |
| Bbox within (%) | 94.4 | 97.1 | 90.6 |
| Diagnostic | Build AUROC | Export AUROC | with CD | with F@1 |
|---|---|---|---|---|
| Latent cosine | 0.484 | 0.482 | ||
| Plan cosine | 0.708 | 0.700 | ||
| Plan Op-Set F1 | 0.727 | 0.725 | ||
| Plan Op-Seq LCS | 0.727 | 0.724 |
| Modality | Syntax (%) | Prog-Op-F1 (%) | Build (%) | STEP Export (%) |
|---|---|---|---|---|
| Text | 98.3 | 80.1 | 57.2 | 53.1 |
| Image | 94.3 | 79.1 | 57.8 | 52.3 |
| Point cloud | 89.5 | 73.9 | 55.4 | 52.6 |
| STEP/B-Rep | 94.5 | 85.1 | 70.0 | 66.2 |
| MIRAGE pathway | Coverage | Paired CD | Paired IoU |
|---|---|---|---|
| Generated plan | 226/400 vs 392/400 | 55.78 / 0.117 ( ) | 0.0604 / 0.9226 ( ) |
| Prior-NN-IR | 392/400 vs 392/400 | 17.59 / 0.187 ( ) | 0.1621 / 0.9426 ( ) |
| Parts | Perturbations | Rebuild-valid (%) | Responsive (%) | Reachability (%) |
|---|---|---|---|---|
| 74 | 1,608 | 99.8 | 82.2 | 29.3 |
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| Operation | Documents | Document coverage (%) | Total occurrences |
|---|---|---|---|
| OP_HOLE_PATTERN | 22,094 | 88.38 | 24,303 |
| OP_TRANSLATE | 9,623 | 38.49 | 15,545 |
| OP_BOOLEAN_JOIN | 11,667 | 46.67 | 15,065 |
| OP_SKETCH | 11,254 | 45.02 | 13,287 |
| OP_BOX | 8,255 | 33.02 | 9,637 |
| OP_PLATE | 7,905 | 31.62 | 7,905 |
| Slots | Count | Content |
|---|---|---|
| 0 | 1 | Validity : brep_valid , represented as 0 or 1. |
| 1–6 | 6 | Topology counts : numbers of solids, shells, faces, wires, edges, and vertices. |
| 7–9 | 3 | Bounding box : extents along the three coordinate axes. |
| 10 | 1 | Surface area : total B-Rep surface area. |
| 11 | 1 | Volume : solid volume. |
| 12–22 | 11 | Surface-type counts : plane , cylinder , cone , sphere , torus , bezier_surface , bspline_surface , surface_of_revolution , surface_of_extrusion , offset_surface , and other_surface . |
| Modality | before (%) | after (%) | |
|---|---|---|---|
| STEP | 74.3 [72.6, 76.0] | 70.0 [68.1, 71.7] | |
| Point cloud | 29.9 [28.1, 31.7] | 55.4 [53.5, 57.4] | |
| Text | 28.5 [26.7, 30.3] | 57.2 [55.3, 59.1] | |
| Image | 38.8 [36.9, 40.8] | 57.8 [55.8, 59.7] | |
| Average | 42.9 | 60.1 |
| Prefix source | plan cos | Op-Set F1 (%) | Op-Seq LCS (%) | Build (%) |
|---|---|---|---|---|
| zero | 0.057 | 38.1 | 28.3 | — |
| constant | 0.082 | 35.9 | 26.8 | — |
| shuffled | 0.047 | 34.6 | 26.0 | 68.6 [64.4, 72.5] |
| deployed | 0.886 | 88.0 | 80.1 | 71.4 [67.3, 75.2] |
| oracle | 0.898 | 88.7 | 79.8 | 69.2 [65.0, 73.1] |
| Condition | Plan | Obs. | STEP Build (%) | Text Build (%) |
|---|---|---|---|---|
| C3 deployed | Yes | Yes | 71.4 [67.3, 75.2] | 59.6 [55.2, 63.8] |
| C2 plan-only | Yes | No | 58.0 [53.6, 62.2] | 58.0 [53.6, 62.2] |
| C1 observation-only | No | Yes | 0.0 | 0.2 |
| C0 neither | No | No | 0.0 | 0.0 |
| Modality | Variant | Op-Set F1 (%) | Build (%) | STEP Export (%) | plan cos |
|---|---|---|---|---|---|
| STEP | A | 79.2 | 100.0 | 100.0 | 0.634 |
| B | 76.6 | 100.0 | 99.97 | 0.534 | |
| C | 64.4 | 46.7 | 46.0 | 0.499 | |
| Text | A | 53.7 | 98.1 | 98.1 | 0.342 |
| B | 54.4 | 98.3 | 98.3 | 0.328 | |
| C | 45.5 | 45.0 | 41.8 | 0.125 |
| Accounting | Retrieved | Generated | Wins (Gen.:Ret.) | ||
|---|---|---|---|---|---|
| Conditional | 1,330 | 0.111 (45.6%) | 0.162 (66.2%) | 982:347 | |
| Unconditional | 2,923 | 0.099 (40.6%) | 0.066 (26.9%) | 983:1,939 |
| Pathway | Conditioning at inference | Autonomous |
|---|---|---|
| CAD-Recode | Point cloud code | Yes |
| MIRAGE generated plan | Point cloud construction latent plan code | Yes |
| MIRAGE Prior-NN-IR | Plan retrieved from the training index at inference | No |
| Pathway | CADR | MIRAGE | Both | CADR only | MIR. only | Neither | |
|---|---|---|---|---|---|---|---|
| Generated plan | 392/400 | 226/400 | 222 | 170 | 4 | 4 | |
| Prior-NN-IR | 392/400 | 392/400 | 385 | 7 | 7 | 1 | 1.0 |
| Pairing | MIRAGE | CADR | 95% CI | MIR. wins | |||
|---|---|---|---|---|---|---|---|
| Gen.-plan CD | 222 | 55.78 | 0.117 | 1/222 | |||
| Gen.-plan IoU | 200 | 0.0604 | 0.9226 | 5/200 | |||
| Prior-NN-IR CD | 385 | 17.59 | 0.187 | 5/385 | |||
| Prior-NN-IR IoU | 369 | 0.1621 | 0.9426 | 10/369 |
| Implementation detail | Consequence | Possible correction |
|---|---|---|
| The point-cloud input is divided by its maximum radius before encoding | Absolute scale is removed before the encoder; the produced-to-target bounding-box ratio is 0.695 internally and 0.339 on the cross-source set. | Provide the pre-normalisation scale as an additional input and retrain from the alignment stage. |
| The point-cloud path contains a train–inference prompt inconsistency in the cross-modal continuation | Point-cloud plan quality is confounded by this prompt mismatch; its magnitude and direction are not isolated. | Correct the prompt and retrain the cross-modal continuation. |
| Prog-Op-F1 matches operation identifiers wherever they occur | 61.6% of matched identifiers are parameter names inside string literals; the metric’s absolute value should not be interpreted as operation-call accuracy. | Restrict scoring to canonical operation invocations or operation families; this requires rescoring but not retraining. |
| Each trained condition is represented by a single run | Small differences between trained configurations include unmeasured seed-to-seed variation. | Repeat the comparisons supporting the headline claims across multiple training seeds. |
| Stages 3, 4, and 4b use STEP rows and their adapters are reused across modalities | The multimodal results combine modality effects with a decoder-training distribution that is not symmetric across modalities. | Train or continue the code decoder with modality-balanced conditioning, or evaluate modality-specific decoder adaptations. |
| The STEP face, edge, and relation streams contain no independent per-entity records in the present corpus | Reported STEP results effectively depend on the 50-dimensional global descriptor (Appendix B.2 ); they do not establish the performance of a learned entity-level B-Rep encoder. | Export per-entity descriptors during corpus construction and retrain from the alignment stage. |
Parametric CAD Modeling
Parametric CAD modeling represents 3D designs as editable, constraint-driven construction histories and develops methods to generate, reconstruct, and revise them.
See all 81 papers