Table of Contents
Fetching ...

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

TL;DR

This work presents RLCAD, a geometry-engine-backed RL training gym for generating CAD command sequences from boundary representations, extending support from 2D sketches to revolution operations. It integrates a UV-Net–based B-Rep encoder, a cross-modal policy using GTrXL, and a PPO-based learning loop with a hybrid reward that combines global and local geometric cues. A 20k-model ABC-derived dataset and curriculum-driven pretraining enable robust generalization to complex CAD tasks, achieving state-of-the-art reconstruction quality compared to baselines like Fusion 360 Gallery and CAD-Recode. The framework demonstrates substantial improvements in efficiency and fidelity, with broader implications for automated parametric CAD generation and robotics-inspired CAD workflows.

Abstract

A CAD command sequence is a typical parametric design paradigm in 3D CAD systems where a model is constructed by overlaying 2D sketches with operations such as extrusion, revolution, and Boolean operations. Although there is growing academic interest in the automatic generation of command sequences, existing methods and datasets only support operations such as 2D sketching, extrusion,and Boolean operations. This limitation makes it challenging to represent more complex geometries. In this paper, we present a reinforcement learning (RL) training environment (gym) built on a CAD geometric engine. Given an input boundary representation (B-Rep) geometry, the policy network in the RL algorithm generates an action. This action, along with previously generated actions, is processed within the gym to produce the corresponding CAD geometry, which is then fed back into the policy network. The rewards, determined by the difference between the generated and target geometries within the gym, are used to update the RL network. Our method supports operations beyond sketches, Boolean, and extrusion, including revolution operations. With this training gym, we achieve state-of-the-art (SOTA) quality in generating command sequences from B-Rep geometries.

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

TL;DR

This work presents RLCAD, a geometry-engine-backed RL training gym for generating CAD command sequences from boundary representations, extending support from 2D sketches to revolution operations. It integrates a UV-Net–based B-Rep encoder, a cross-modal policy using GTrXL, and a PPO-based learning loop with a hybrid reward that combines global and local geometric cues. A 20k-model ABC-derived dataset and curriculum-driven pretraining enable robust generalization to complex CAD tasks, achieving state-of-the-art reconstruction quality compared to baselines like Fusion 360 Gallery and CAD-Recode. The framework demonstrates substantial improvements in efficiency and fidelity, with broader implications for automated parametric CAD generation and robotics-inspired CAD workflows.

Abstract

A CAD command sequence is a typical parametric design paradigm in 3D CAD systems where a model is constructed by overlaying 2D sketches with operations such as extrusion, revolution, and Boolean operations. Although there is growing academic interest in the automatic generation of command sequences, existing methods and datasets only support operations such as 2D sketching, extrusion,and Boolean operations. This limitation makes it challenging to represent more complex geometries. In this paper, we present a reinforcement learning (RL) training environment (gym) built on a CAD geometric engine. Given an input boundary representation (B-Rep) geometry, the policy network in the RL algorithm generates an action. This action, along with previously generated actions, is processed within the gym to produce the corresponding CAD geometry, which is then fed back into the policy network. The rewards, determined by the difference between the generated and target geometries within the gym, are used to update the RL network. Our method supports operations beyond sketches, Boolean, and extrusion, including revolution operations. With this training gym, we achieve state-of-the-art (SOTA) quality in generating command sequences from B-Rep geometries.

Paper Structure

This paper contains 35 sections, 17 equations, 10 figures, 7 tables, 1 algorithm.

Figures (10)

  • Figure 1: Demonstration of various CAD models generated by our novel CAD model generation algorithm. Including revolution operation enables the generation of more complex geometric shapes, such as the battery, nuts, flanges, etc.
  • Figure 2: The training pipeline is composed of two stages. In the first stage, a contrastive learning approach is employed to pre-train the UV-Net network, aiming to derive an encoder model that can effectively characterize the B-Rep of the CAD model. During the second stage, a reinforcement learning approach is employed to generate the command sequence. We first utilize the tunable UV-Net model to extract the B-Rep embedding of the CAD model, which is then integrated with the feature vector of the historical modeling action sequence. Subsequently, the Actor-Critic network predicts the action distribution and value. The predicted action is transmitted to RLCADGym for execution, yielding the next-stage observation. The neural reward and geometric reward are designed to update the policy network.
  • Figure 3: Battery modeling process using the gym interface. The leftmost image shows face IDs on the surfaces. The right sequence illustrates four extrusion/revolution operations with Boolean operations applied iteratively to generate the final geometry.
  • Figure 4: Revolution operation. The rotation profile is constructed using sampling points from the parametric domain, which are projected and connected based on the surface type. For cylinders and cones, points are projected onto the rotation axis to form the profile. For tori and spheres, the profile arc is determined by the major and minor radii or the sphere center and radius. The rotation angle is defined by the parameter range in the parametric domain.
  • Figure 5: Comparison of different Graph Neural Network (GNN) architectures and UV-Net on reconstruction tasks. It indicates that the UV-Net outperforms the Graph Convolutional Network (GCN), Graph Attention Network (GAT), and Graph Transformer Network (GTN) in reconstructing fine geometric details.
  • ...and 5 more figures