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 · 2026
Read Draw it like Euclid: Teaching transformer models to generate CAD profiles using ruler and compass construction steps by Siyi Li, Joseph G. Lambourne, Longfei Zhang, Pradeep Kumar Jayaraman, Karl. D.D. Willis (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2601-09428.txt.
Introduction
Siyi Li and four co-authors teach transformer models to draw CAD profiles the way Euclid built figures. Their 2026 arXiv paper produces a profile as a sequence of simple construction steps. The steps use tools in the spirit of ruler and compass: offsets, rotations, and intersections of curves.
A designer supplies starting geometry, and the model builds the final points and curves step by step. Working through explicit steps, rather than emitting raw coordinates, mirrors how human drafters plan a sketch. It also gives a checkable path from input to output. The approach could make generated CAD easier to edit and trust.
Catalog record
| CREATOR | Siyi Li, Joseph G. Lambourne, Longfei Zhang, Pradeep Kumar Jayaraman, Karl. D.D. Willis |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 67 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2601-09428
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
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 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. 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. 1 Introduction Computer Aided Design (CAD) tools play a key role in shaping nearly all manufactured objects. CAD models are created by specifying collections of lines, arcs and circles which enclose 2d regions called profiles. These can then be extruded or revolved to define solid volumes, which can be combined using boolean operations to build complex shapes. Geometric constraints can be added to the profiles, enforcing relationships between the curves. For example, lines can be constrained to be parallel, circles concentric and curves can be forced to meet tangentially. The distances and angles between specific curves can also be controlled using parameters, which can be adjusted to modify the shape while maintaining critical aspects of the design like symmetries, regular patterns and constant thicknesses. While machine learning models for the generation of 2d CAD geometry have shown great advances in recent years, these methods have two main limitations. Firstly, all current methods suffer from limited accuracy. Methods which create geometry as a sequence of discrete tokens representing quantized points or coordinates 24 ; 31 ; 8 ; 22 ; 32 have their precision limited by the spacing of the quantization grid, while diffusion methods 34 ; 6 ; 15 have accuracy limited by the convergence of the diffusion process and the decoding of latent vectors. Secondly, while some methods can predict constraints and dimensions, this is done as a second step after the geometry has been generated. An external constraint solver is then required to post-process the curve geometry and produce the final shape. It has been shown that applying generated constraints in post-process can frequently move the geometry 22 ; 8 which is undesirable when the changes significantly alter the design 3 . In this work we investigate an alternative strategy for generating 2d profiles, using a unified sequence which defines both the geometry and shape properties which would usually be enforced by constraints. Inspired by recent work in language models, which show that an intermediate chain of thought (CoT) can greatly improve the accuracy of the final output 30 ; 13 , we wonder whether the generation of some intermediate geometry might assist with CAD generations tasks. We notice that when CAD designers build up shapes, they often start by sketching some intermediate “construction geometry” which defines important aspects of a design like symmetry lines or construction circles. Constraints are then added between the construction geometry and profile curves to enforce properties like coincidence and symmetries. Inside the geometric constraint solver, the graph formed by the geometry and constraints is recursively processed to yield a fine grained sequence of simple geometric constructions which builds up the final shape 21 ; 2 . These construction sequences play a role similar to the algorithm execution traces which have been employed to great effect in a variety of search problems 36 ; 16 ; 7 . In this paper we conduct experiments training transformer models on intermediate construction sequences of ruler, compass and protractor construction steps similar to those used in geometric constraint solvers. As the high level task of shape generation is broken down into small atomic steps with closed form solutions, the performance of the network at solving these subtasks and combining them to build a consistent “CAD program” can be measured separately. The shapes can be controlled using “prompt geometry” provided at the start of the sequence and used as inputs to subsequent constructions. Once generated, the sequences can be replayed with floating point precision, allowing accurate values known at inference time to be propagated through the constructions to build the final profile. The generated geometry is parameterized using a small number values, which can be varied when the sequences are replayed allowing parametric edits to the shape as shown in the right of Figure 1 . We demonstrate quantitatively that the introduction of construction sequences improves the performance of the generative models, reducing self-intersections and proving enhanced adherence to the design requirements. In addition, we show that applying reinforcement learning over the entire construction sequence can further improve results as shown in the language modeling case 26 ; 5 . Our contributions can be summarized as follows • We introduce a domain specific language which builds 2d profile geometry as a sequence of ruler, compass and protractor constructions steps. The construction steps can be replayed with floating point accuracy, allowing parametric editing of the shape. • We show that geometry generated with sequences which include these intermediate construction steps have fewer self-intersections, superior accuracy when auto-completing partial designs and better adherence to other design requirements like symmetry lines. • We show that reinforcement learning, with reward functions which discourage self-intersecting geometry, leads to improvement over a wide range of metrics, many of which are not explicitly optimized. 2 Related work 2.1 Algorithm traces A number of works have explored training neural networks to mimic the logical steps conducted by heuristic algorithms. Vinyals et al. 28 showed that RNNs could replicate some basic geometric algorithms like finding the convex hull and building a delaunay triangulation. Yang et al. 36 experimented with monte carlo tree search traces for maze navigation, robotic manipulation and Atari games. Lehnert et al. 16 used traces from A^{*} search to learn to solve mazes and Gandhi et al. 7 showed how search and backtracking capabilities could be used to play the game Countdown. In this work we investigate the applicability of these techniques to CAD, utilizing algorithm traces similar to those