Table of Contents
Fetching ...

A Solver-Aided Hierarchical Language for LLM-Driven CAD Design

Benjamin T. Jones, Felix Hähnlein, Zihan Zhang, Maaz Ahmad, Vladimir Kim, Adriana Schulz

TL;DR

This paper tackles the difficulty of generating precise procedural CAD with large language models by introducing AIDL, a solver-aided, hierarchical CAD DSL designed for LLM-driven design. AIDL offloads spatial reasoning to a geometric constraint solver while providing dependencies, semantics, and modular hierarchy, enabling LLMs to focus on high-level design intent. The authors demonstrate that AIDL enables accurate, editable 2D CAD programs and achieves competitive visual fidelity and better editability than OpenSCAD in few-shot scenarios, with ablations showing the value of hierarchy and constraints. The work presents a neurosymbolic approach that combines a purpose-built language with a recursive solver, improving controllability and reliability for AI-assisted CAD workflows and suggesting a pathway for more robust AI-assisted design tooling in practice.

Abstract

Large language models (LLMs) have been enormously successful in solving a wide variety of structured and unstructured generative tasks, but they struggle to generate procedural geometry in Computer Aided Design (CAD). These difficulties arise from an inability to do spatial reasoning and the necessity to guide a model through complex, long range planning to generate complex geometry. We enable generative CAD Design with LLMs through the introduction of a solver-aided, hierarchical domain specific language (DSL) called AIDL, which offloads the spatial reasoning requirements to a geometric constraint solver. Additionally, we show that in the few-shot regime, AIDL outperforms even a language with in-training data (OpenSCAD), both in terms of generating visual results closer to the prompt and creating objects that are easier to post-process and reason about.

A Solver-Aided Hierarchical Language for LLM-Driven CAD Design

TL;DR

This paper tackles the difficulty of generating precise procedural CAD with large language models by introducing AIDL, a solver-aided, hierarchical CAD DSL designed for LLM-driven design. AIDL offloads spatial reasoning to a geometric constraint solver while providing dependencies, semantics, and modular hierarchy, enabling LLMs to focus on high-level design intent. The authors demonstrate that AIDL enables accurate, editable 2D CAD programs and achieves competitive visual fidelity and better editability than OpenSCAD in few-shot scenarios, with ablations showing the value of hierarchy and constraints. The work presents a neurosymbolic approach that combines a purpose-built language with a recursive solver, improving controllability and reliability for AI-assisted CAD workflows and suggesting a pathway for more robust AI-assisted design tooling in practice.

Abstract

Large language models (LLMs) have been enormously successful in solving a wide variety of structured and unstructured generative tasks, but they struggle to generate procedural geometry in Computer Aided Design (CAD). These difficulties arise from an inability to do spatial reasoning and the necessity to guide a model through complex, long range planning to generate complex geometry. We enable generative CAD Design with LLMs through the introduction of a solver-aided, hierarchical domain specific language (DSL) called AIDL, which offloads the spatial reasoning requirements to a geometric constraint solver. Additionally, we show that in the few-shot regime, AIDL outperforms even a language with in-training data (OpenSCAD), both in terms of generating visual results closer to the prompt and creating objects that are easier to post-process and reason about.

Paper Structure

This paper contains 35 sections, 7 figures, 2 tables.

Figures (7)

  • Figure 1: A 2D CAD program in AIDL, generated using the prompt "old-school telephone". The LLM generates AIDL code in a hierarchical fashion, adding constraints using naturally named operators. AIDL's backend solver produces the final CAD shape rendered on the right.
  • Figure 2: AIDL allows LLMs to express constraints using semantically meaningful operators. This figure demonstrates how adding constraints (highlighted in red) in an AIDL program for a phone handset eliminates geometrical flaws in the generated 2D sketch. (Left) AIDL code for handset design. (Top right) Design before constraints applied. (Bottom right) Design after constraints applied.
  • Figure 3: A sample of LLM-guided 2D CAD generations using AIDL. An untuned general purpose LLM is able to generate a diverse range of objects with accuracy after being prompted by the AIDL language syntax and a few example programs.
  • Figure 4: Comparison and Ablation. For the task of text-to-CAD, we compare our language to OpenSCAD and ablate on our language design choices. (Top Left) In particular, generated OpenSCAD programs exihibit manually drawn polygons with explicit vertex positions which are difficult to edit. (Bottom Left) Programs generated with $\textbf{AIDL}_{\text{no constraints}}$ has detached parts due to not being able to constrain the relative positions of part geometries. (Right) When an AIDL model is created with a structure hierarchy it is easier to locally edit because of modular substructures (left), while a similar edit on a non-hierarchical model (right) results in the model breaking (the dial moves without the dial holes). Performing the same edit in a non-hierarchical model requires multiple, non-concurrent edits.
  • Figure 5: Types and operations of AIDL.$\tau$ represents the union type (structure|parameter|geometry). [$\theta$] is the notation used to represent an array or list of $\theta$.
  • ...and 2 more figures