Table of Contents
Fetching ...

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.

Draw it like Euclid: Teaching transformer models to generate CAD profiles using ruler and compass construction steps

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.
Paper Structure (47 sections, 6 equations, 16 figures, 10 tables)

This paper contains 47 sections, 6 equations, 16 figures, 10 tables.

Figures (16)

  • Figure 1: Our model (middle) generates CAD profiles through a sequence of ruler, compass, and protractor constructions, starting from the designer’s initial "prompt" geometry (left) and building step by step toward the final profile. Our approach generates profiles that more accurately match the designer’s input and contain fewer self-intersections, compared to a baseline model (top) which omits construction steps and maps directly from geometric prompt to profile. We further refine the construction sequence model during post-training (bottom), where rewards help guide the generation of valid construction sequences. As the sequences encode parametric relationships, families of related profiles (right) can be created from a single construction trace.
  • Figure 2: Profiles generated when three different profile areas requested. When an area of 0.2 model units is requested, the generated profile contains thin regions. Increasing the requested area allows shapes without this thin region.
  • Figure 3: Requesting different symmetry lines in the geometric prompt.
  • Figure 4: Profiles obtained by varying the requested fraction of tangent continuous vertices.
  • Figure 5: Controlling shape complexity by requesting different numbers of edges in the geometric prompt.
  • ...and 11 more figures