[KongchangAI]
· 3 min read· 1,603 words

GOPR-CAD: Graph-of-Operations Progressive Reasoning for High-Precision Text-to-CAD Generation

GOPR-CAD: Graph-of-Operations Progressive Reasoning for High-Precision Text-to-CAD Generation

GOPR-CAD uses an LLM as a decision agent to progressively build operation graphs compiled into CAD models, reaching 82.7% structural yield.

GOPR-CAD proposes a new text-to-CAD paradigm: instead of having an LLM directly output full CAD code, it acts as a decision agent that progressively selects operations and parameters to build an operation graph, which a deterministic compiler converts into a STEP model. This training-free, model-agnostic design avoids long-code syntax errors and structural defects. On the MHCAD benchmark of 300 standard mechanical part requirements, it achieves 82.7% structural yield and 87.2% on the CADPrompt subset.

Introduction

In mechanical design, CAD models are the core of product development. Traditionally, creating precise CAD models requires deep engineering expertise and extensive manual operation. In recent years, Text-to-CAD technology has attempted to automatically generate CAD programs from natural language descriptions, thereby lowering the barrier to entry. However, existing methods based on large language models (LLMs) typically generate complete CAD code directly, which often struggles when handling coupled geometric, topological, and dimensional constraints. Language models are prone to errors when generating long code, and even if the code is executable, the resulting models may contain structural errors that are difficult to detect from execution rate or rendered appearance alone.

To address this challenge, a paper titled "GOPR-CAD: Graph-of-Operations Progressive Reasoning for CAD Generation" proposes a novel solution. This method uses the LLM as a decision-making agent that performs progressive reasoning over encapsulated CAD operations to build an executable operation graph, which is ultimately converted into a CAD model by a deterministic compiler. This separated design requires no additional training and is compatible with different language models.

GOPR-CAD framework diagram

B-rep (Boundary Representation) is one of the most mainstream geometric modeling representations in the CAD field. It describes 3D solids by recording the boundary elements of a shape—faces, edges, and vertices—along with their topological adjacency relationships. Each face is typically defined by a parametric surface (such as a plane, cylindrical surface, or NURBS surface), and edges are defined by curves, thereby establishing a complete correspondence between continuous geometry and discrete topology. The STEP (Standard for the Exchange of Product model data, ISO 10303) file format is widely used as a CAD data exchange standard precisely because it can fully encode B-rep information, including geometric surfaces, topological structures, and assembly hierarchy. Compared with voxel representations or mesh representations, B-rep preserves precise analytical geometric information, making it more suitable for manufacturing and engineering analysis of mechanical parts. In text-to-CAD evaluation, when the requirements themselves carry explicit structural definitions, the topological and geometric differences between the generated model and the ground-truth model can be compared directly at the B-rep level, without relying on subjective human judgment or rendered image comparison—this is precisely the technical foundation of "reference-free evaluation."

Core Method: Graph-of-Operations Progressive Reasoning

The core idea of GOPR-CAD is to decompose the CAD generation process into progressive operation graph construction. Unlike directly generating code, the language model no longer needs to output lengthy code all at once; instead, it acts as a decision-making agent that selects the next appropriate CAD operation (such as extrusion, revolution, chamfer, etc.) at each step, gradually building an operation graph. This graph is ultimately converted into a standard CAD model (such as STEP format) by a deterministic compiler.

This design brings several key advantages:

  • Reduced burden on the language model: The model only needs to focus on the operation choice for the current step, without having to coordinate global geometric and topological constraints.
  • No additional training required: This method does not rely on fine-tuning for CAD tasks, so it can flexibly adapt to different LLMs.
  • High structural fidelity: Since the operation graph explicitly expresses design intent, the generated models are structurally more compliant.

The authors point out that the current approach of having LLMs directly generate CAD code is unreliable when coordinating coupled constraints, whereas GOPR-CAD significantly improves the structural correctness of generated models by separating reasoning from compilation.

Deterministic Compiler in this context refers to a program that strictly executes modeling steps according to a sequence of operation graph instructions, with behavior entirely determined by the input and without randomness or approximate inference. In contrast, the process of LLM code generation is probabilistic—the same prompt may produce different code, and long code is prone to syntax errors or logical inconsistencies. The advantage of a deterministic compiler is that as long as the operation graph is logically correct, the compilation result is necessarily correct, eliminating hidden errors such as "the code runs but the model structure is wrong." In a typical implementation, the compiler interfaces with the API of a CAD kernel (such as OpenCascade), mapping each encapsulated operation (extrusion, revolution, boolean operations, chamfer, etc.) to kernel calls and executing them sequentially in the topological order of the graph. The key difference between this architecture and "LLM writes code directly and then executes it" is that the LLM is only responsible for high-level decisions (which operation to choose, what parameters to give) and not for low-level syntax and API call details, thereby narrowing the error surface from "the entire long code" to "a single-step operation choice."

Evaluation Benchmark MHCAD and Experimental Results

To objectively evaluate the structural fidelity of generated models, the research team constructed the MHCAD benchmark, containing 300 standard mechanical part requirements derived from the Machinery's Handbook. Each requirement has an explicit structural definition, enabling reference-free STEP/B-rep evaluation, i.e., directly comparing the structural differences between the generated model and the ground-truth model.

Experimental results show that GOPR-CAD achieves a 82.7% structural yield on MHCAD and 87.2% structural yield on an external CADPrompt subset. Structural yield measures the proportion of generated models that fully meet the requirements structurally, and this metric reflects the true quality of the model better than conventional execution rate or rendering similarity.

For comparison, the paper notes that existing methods can generate executable programs but may produce structurally incorrect models, and execution rate and rendered appearance cannot reveal these errors. GOPR-CAD ensures the structural correctness of generated models through the operation graph approach.

Structural Yield is the core evaluation metric proposed in this paper, defined as the proportion of generated models that fully conform to the requirement definitions structurally. Unlike execution rate (whether the generated program runs without errors) and rendering similarity (visual comparison at the image level), structural yield requires the model to match the ground-truth model at the B-rep level in both topological structure (the number of faces, edges, and vertices and their connectivity) and geometric parameters (dimensions, positions, orientations). The strictness of this metric lies in the fact that a model may "look right" visually, but if the face count is wrong, the chamfer radius deviates, or the hole position is offset, it will be judged as non-compliant. Such a metric is needed because LLM-generated CAD code, even if executable and with similar rendered images, may still hide structural defects—for example, incorrect boolean operation order leading to residual internal geometry, or extrusion direction deviations masked by subsequent operations. Structural yield directly targets this blind spot, advancing evaluation from "does it look similar on the surface" to "is the structure correct."

Technical Details and Implementation

The implementation of GOPR-CAD consists of two main stages: progressive operation graph construction and deterministic compilation. In the construction stage, the language model decides the next operation to execute based on the text description and the current state of the operation graph. Each operation is encapsulated as an independent module, and the model only needs to select the operation type and parameters. This design enables the model to progressively build complex operation sequences without worrying about syntax errors or coherence issues in long code.

In the compilation stage, the operation graph is converted into standard CAD modeling instructions and executed by a deterministic compiler. Since the compilation process is deterministic, as long as the operation graph is correct, the final model structure is correct. This fundamentally avoids the structural errors that may be introduced when language models generate code.

The method requires no additional training, meaning it can be applied directly to various language models, including open-source and closed-source models. The authors emphasize that this separated architecture supports different language models, providing flexibility for future integration of more powerful models.

Significance and Outlook

GOPR-CAD offers a new paradigm for text-to-CAD generation. By combining the reasoning capabilities of language models with deterministic compilation, it substantially improves the structural fidelity of generated models without sacrificing flexibility. The establishment of the MHCAD benchmark also provides a reproducible evaluation standard for future research.

Although the paper does not mention specific limitations, it is foreseeable that operation graph construction depends on a predefined library of CAD operations, and unconventional or complex geometric shapes may require extending the operation library. In addition, the number of steps in progressive reasoning may affect generation efficiency, and more efficient reasoning strategies could be explored in the future.

Overall, GOPR-CAD takes an important step in the text-to-CAD field, and its approach may also inspire other domains that require precise structural generation, such as architectural design and circuit design. As language model capabilities improve, this agent-based reasoning framework is expected to become a mainstream method for CAD automation.

One-line Summary

GOPR-CAD lets an LLM act as a decision-making agent to progressively build an operation graph, which is then converted into a CAD model by a deterministic compiler, achieving a 82.7% structural yield.

Paragraph Summary

GOPR-CAD proposes a new paradigm for text-to-CAD generation: instead of having the LLM directly output complete CAD code, it acts as a decision-making agent that progressively selects the next operation and parameters over encapsulated CAD operations to build an operation graph, which is ultimately converted into a STEP model by a deterministic compiler. This separated design requires no additional training, is compatible with different language models, and fundamentally avoids syntax errors and structural defects in long code generation. To objectively evaluate structural fidelity, the authors constructed the MHCAD benchmark, containing 300 standard mechanical part requirements derived from the Machinery's Handbook, supporting reference-free B-rep evaluation. Experiments show that GOPR-CAD achieves 82.7% structural yield on MHCAD and 87.2% on the CADPrompt subset, significantly outperforming methods that directly generate code.

#Text-to-CAD#GOPR-CAD#Graph-of-Operations#LLM#B-rep#Structural Yield#MHCAD#Deterministic Compiler
Share:

Related articles