RLCAD: Reinforcement Learning Training Gym for Revolution Involved CAD Command Sequence Generation

Xiaolong Yin, Xingyu Lu, Jiahang Shen, Jingzhe Ni, Hailong Li, Ruofeng Tong, Min Tang, Peng Du

Introduction

In Computer-Aided Design (CAD), models are represented as parametric command sequences—a "recipe" of operations like extrusions and subtractions. While deep learning has made strides in automating these sequences, existing methods often struggle with complex revolution operations (rotating a profile around an axis) and frequently produce mathematically invalid geometry. Furthermore, training reinforcement learning (RL) agents for CAD has been hindered by slow, memory-intensive simulation environments.

RLCAD addresses these bottlenecks by introducing the first RL training "gym" specifically optimized for revolution-involved CAD command sequence generation. By integrating the high-performance Parasolid geometric engine directly into the RL loop, the system achieves a 39x speedup over previous frameworks and establishes a new state-of-the-art in 3D model reconstruction from boundary representations (B-Rep).

The RLCAD Framework

The authors propose a two-stage framework designed to bridge the gap between static shape representation and dynamic command generation.

The two-stage RLCAD framework, featuring the RLCADGym environment and the Actor-Critic policy network.

1. RLCADGym

Unlike previous environments that rely on slow web-based APIs (such as the Fusion 360 Gym), RLCADGym utilizes a shared-memory architecture and multi-process parallelism. This integration eliminates the overhead of HTTP communication, allowing the agent to interact with the geometric engine at massive scale.

2. The RLCAD Algorithm

  • Feature Extraction: The system employs UV-Net, a specialized neural network that interprets B-Rep geometry as a graph of faces and curves. Pre-trained via contrastive learning, it generates robust shape embeddings that capture both topology and geometry.
  • Policy Network: An Actor-Critic model, powered by a Gated Transformer-XL, predicts the next CAD command. The agent's action space is constrained to geometrically feasible operations, acting as a "validity filter" that prevents the generation of impossible shapes.
  • Hybrid Reward System: To guide the agent, the framework uses a combination of global volumetric overlap (IoU), point-cloud similarity (MMD), and a novel Neural Reward. The Neural Reward measures the distance between generated and target B-Rep embeddings, forcing the agent to respect fine-grained semantic and topological structures.

Handling Complex Revolution Operations

A primary contribution of RLCAD is its ability to geometrically parse curved surfaces to infer rotation axes and profiles. This allows the system to reconstruct objects like screws, wheels, and complex mechanical parts that were previously un-learnable for standard command-sequence models.

Step-by-step reconstruction of a CAD model using a sequence of extrusion and revolution operations.

By breaking down a target model into a sequence of Boolean operations (Union, Subtract, etc.), the agent learns to "build" the model step-by-step. This process ensures that the final output is not just a point cloud or mesh, but a fully editable, parametric CAD file.

Results and Performance

The RLCAD framework was evaluated using a combination of the DeepCAD dataset and a curated subset of the ABC dataset containing complex revolution operations.

  • Accuracy: RLCAD achieved a volumetric Intersection over Union (IoU) of 0.9001, significantly outperforming the previous benchmark of 0.5678 set by the Fusion 360 Gallery.
  • Efficiency: The system is 39.69x faster per training step than existing RL gyms while maintaining a significantly lower memory footprint.
  • Robustness: In head-to-head comparisons with industry-standard feature recognition tools in SolidWorks and Autodesk Inventor, RLCAD successfully reconstructed complex merged geometries and non-perpendicular extrusions where commercial tools often failed.

Limitations and Future Work

While RLCAD represents a significant leap forward, it currently does not support organic modeling features like fillets (rounded edges) or complex spline surfaces. Additionally, as model complexity increases beyond 40 faces, the accuracy of fine-grained topological details can diminish. Future research will focus on expanding the gym's operation repertoire and developing more detail-preserving feature extractors to handle increasingly intricate industrial designs.

Summary updated

BibTeX
@article{yin2026rlcad,
  author = {Xiaolong Yin and Xingyu Lu and Jiahang Shen and Jingzhe Ni and Hailong Li and Ruofeng Tong and Min Tang and Peng Du},
  title = {{RLCAD: Reinforcement Learning Training Gym for Revolution Involved CAD Command Sequence Generation}},
  journal = {Comput. Aided Des.},
  year = {2026},
  doi = {10.1016/j.cad.2025.104027},
}
Figure