Draw it like Euclid: Teaching transformer models to generate CAD profiles using ruler and compass construction steps
Siyi Li, Joseph G. Lambourne, Longfei Zhang, Pradeep Kumar Jayaraman, Karl. D. D. Willis
TL;DR
The paper tackles the challenge of generating accurate 2D CAD profiles by moving beyond direct geometry prediction to a construction-based approach. It introduces a domain-specific language that encodes a sequence of ruler-and-compass constructions, allowing intermediate steps to be replayed with floating-point precision for precise, parametric editing. A transformer is trained in a supervised phase to predict construction sequences and a final profile, and is later fine-tuned with reinforcement learning using rewards that penalize invalid geometry and reward adherence to prompts. Across quantitative and qualitative analyses, adding construction steps improves validity and prompt satisfaction, and RL further enhances a broad set of metrics, including those not explicitly optimized. This approach yields parameterizable, geometry-faithful CAD generation with improved robustness and editability, suggesting practical impact for AI-assisted CAD workflows and design exploration.
Abstract
We introduce a new method of generating Computer Aided Design (CAD) profiles via a sequence of simple geometric constructions including curve offsetting, rotations and intersections. These sequences start with geometry provided by a designer and build up the points and curves of the final profile step by step. We demonstrate that adding construction steps between the designer's input geometry and the final profile improves generation quality in a similar way to the introduction of a chain of thought in language models. Similar to the constraints in a parametric CAD model, the construction sequences reduce the degrees of freedom in the modeled shape to a small set of parameter values which can be adjusted by the designer, allowing parametric editing with the constructed geometry evaluated to floating point precision. In addition we show that applying reinforcement learning to the construction sequences gives further improvements over a wide range of metrics, including some which were not explicitly optimized.
