TL;DR
While Large Language Models (LLMs) excel at generating code, their outputs in Computer-Aided Design (CAD) often lack the geometric complexity and organic curves found in real-world industrial products. This paper introduces a novel data augmentation paradigm that prompts LLMs with Python-scripted reference surfaces to guide the generation of complex, organic CAD models. Combined with an agentic self-correction loop, this approach successfully synthesizes diverse, industry-grade CAD data featuring high proportions of spline-based curvatures.
What Problem Does This Paper Address?
Automating CAD generation is a major milestone for manufacturing and engineering, but current generative models suffer from a severe data scarcity problem. Publicly available CAD datasets (like DeepCAD or ABC) are largely restricted to simple "sketch-and-extrude" operations, resulting in boxy, simplistic shapes.
In contrast, real-world industrial designs—such as car body panels or ergonomic consumer products—rely heavily on organic, free-form geometries defined by B-splines (basis splines). These smooth curves are vital for aesthetics, aerodynamics, and reducing structural stress concentrations. Because existing models are trained on simple datasets, they fail to generate these complex, industry-standard geometries.
Methods
To bridge this gap, the authors propose a designer-centered prompting strategy that mimics how human industrial designers work. Instead of starting from scratch, designers often shape a new component to conform to an existing reference surface (e.g., designing a mounting bracket to fit the curved interior of a car door).
The framework consists of three main components:
- Design Procedure Prompting: The LLM prompt is structured to include a prefix prompt, a textual design description, a design context instructing the model to conform to a reference surface, and a postfix prompt enforcing structural constraints.
- Code-as-Conditioning: Rather than using images or point clouds—which LLMs struggle to translate into precise mathematical shapes—the authors provide the reference surface directly inside the prompt as a Python script (using the CadQuery library). They use four types of B-spline reference surfaces: Gaussian, saddle, wave, and ripple.
- Agentic Validation Loop: To ensure the generated code actually works, the system passes the output through a two-stage validation pipeline. First, it checks if the code successfully compiles into a 3D Boundary Representation (B-rep/STEP file). Second, it verifies if the 3D shape is structurally sound and "watertight." If any errors are found, the feedback is sent back to the LLM for iterative self-correction.
Datasets
The authors evaluated their method primarily on the generation of mechanical brackets, comparing their synthetic data against:
- DeepCAD-b, GenCAD, and CAD-MLLM: Standard open-source CAD program datasets used as baselines.
- ABC Dataset: A massive public dataset of miscellaneous CAD files.
- Industry Dataset: A proprietary collection of real-world commercial industrial bracket designs used to benchmark true industry standards.
Key Insights and Ideas
- Code is the Best Modality for Geometry: Text-based LLMs are highly proficient at code generation. By feeding the model geometric constraints as executable code (a reference surface script) rather than an image, the LLM can leverage its code-reasoning capabilities to produce highly accurate 3D math.
- The Ripple Effect of Constraints: Forcing the LLM to match a curved reference surface naturally forces it to introduce organic primitives (B-spline faces and edges) throughout the rest of the object so that the entire structure aligns correctly.
- Prompting "Organic" Isn't Enough: Simply adding text instructions like "make the bracket look smooth and organic" does not work. Without a programmatic reference surface constraint, the LLM merely stacks more standard boxy primitives together to approximate smoothness, increasing model complexity without actually generating true spline curves.
Key Results
The proposed method significantly outperformed existing synthetic datasets in generating complex, organic geometries, moving much closer to real-world industrial standards:
- B-Spline Ratio: The proportion of B-spline elements in the generated models reached 0.2217, a massive leap from previous synthetic datasets like DeepCAD-b (0.0004) and GenCAD (0.0009). Real industry data sits at 0.5352.
- Presence of Splines: 77% of the models generated by this method contained B-spline faces, and 89% contained B-spline curves. In comparison, virtually 0% of the models in DeepCAD-b, GenCAD, or CAD-MLLM contained any B-spline faces.
Limitations and Future Work
Despite its success, the method has a few notable limitations:
- Higher Error Rates: Generating complex organic code is inherently harder. The authors noted that 21% of their successful generations required more than 5 iterations of the self-correction loop due to compilation or structural errors.
- Dependency on Reference Scripts: The system still relies on humans providing the initial script for the reference surfaces.
- Lack of Precise Alignment Control: While the LLM successfully generates organic shapes conforming to the surface, it cannot yet precisely control where or how the object anchors to the surface (e.g., blending into the base versus attaching via distinct feet). The authors suggest that fine-tuning LLMs on precise input-output pairs will be a crucial next step for achieving this level of control.
Summary updated