arXiv:2611.09401cs.AINov 2026

Manuscript Offprint

arXiv:2611.09401

PhyCAD: Physics-Aware Text-to-CAD Generation via Hierarchical Reinforcement Learning

Yuxin Cui, Weijie Zheng, Zhengyang Li, Han Wang, Wenjie Feng, Qiyu Kang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Yuxin Cui, Weijie Zheng, Zhengyang Li, Han Wang, Wenjie Feng, Qiyu Kang ∗^{*}

University of Science and Technology of China, Hefei, China

Figure

(A) FEM-annotated Source CAD

(B) Task Given to The Policy

(C) Same Task in SFT & PhyCAD

Figure 1: Physics-aware CAD optimization. (A) A source CAD model is annotated with FEM conditions and responses. (B) Its exact dimensions are redacted to form an inverse-design task with physical constraints. (C) While the SFT design achieves lower mass but violates the physical constraints, PhyCAD produces a feasible design with lower mass than the reference.

ABSTRACT

Language-driven computer-aided design (CAD) generation enables the creation of editable parametric models from text, yet geometric correctness alone does not ensure physical feasibility. We present PhyCAD, a framework for physics-aware Text-to-CAD generation that trains language models to produce executable CadQuery programs under geometric and physical constraints. To support this setting, we construct a Text-to-CAD dataset that links parametric CAD models with geometric specifications, loading conditions, and physical constraints. We further develop an automated CAD-CAE verifier that combines program execution, geometric checks, and finite element analysis to provide feedback for model training. A key learning challenge is to prioritize joint satisfaction of geometric and physical constraints while retaining informative feedback on partial progress. A flat aggregation of heterogeneous rewards can obscure this priority, allowing improvements in individual criteria to compensate for unmet design requirements. We therefore introduce a Hierarchical Balanced Advantage for Group Relative Policy Optimization, grouping candidates into levels according to their verification status and combining between-level progress with objective-wise peer ranking within each level. This formulation preserves cross-level priority in the training signal while providing fine-grained feedback for satisfying constraints and improving feasible designs. Experiments across multiple language models show that PhyCAD consistently improves joint geometric and physical constraint satisfaction. These results demonstrate the value of verifiable engineering feedback for advancing language-driven CAD generation beyond geometric reconstruction toward physics-aware design. The code is available at https://github.com/PhysAGI/PhyCAD.

∗^{*}Corresponding author: qiyukang@ustc.edu.cn

1 INTRODUCTION

CAD is a fundamental component of modern engineering, providing editable and parametric representations for downstream simulation, optimization, and manufacturing. Learning-based CAD generation has progressively moved from modeling CAD construction sequences and design histories (Wu et al., 2021; Willis et al., 2021) toward language-driven generation with large language models (LLMs) (Zhang et al., 2026). Recent methods can translate natural-language descriptions into parametric CAD sequences (Khan et al., 2024), generate CAD programs from textual or multimodal inputs (Li et al., 2025c; Sun et al., 2025), or synthesize executable modeling code through iterative or tool-augmented workflows (Badagabettu et al., 2024; Xie & Ju, 2025; Mallis et al., 2025). In particular, CadQuery provides an executable, Python-based parametric representation that aligns naturally with code-generation capabilities of pretrained LLMs (Xie & Ju, 2025; Guan et al., 2025).

Despite this progress, geometric correctness alone does not ensure physical feasibility. Existing Text-to-CAD systems are commonly optimized or evaluated using geometric similarity or visual consistency (Khan et al., 2024; Alrashedy et al., 2025; Xie & Ju, 2025; Guan et al., 2025). However, natural-language descriptions do not always fully specify the dimensions, topology, and structural details required for engineering design, and even small geometric deviations may substantially affect structural behavior. More importantly, engineering design is ultimately concerned with whether a component meets prescribed dimensional and physical requirements under specified material properties, loads, and boundary conditions, rather than merely whether it resembles a target shape. Bringing an initially generated model into compliance often requires repeated manual measurement, geometric modification, simulation, and re-evaluation, resulting in a costly refinement process. These limitations have motivated increasing attention to functional and physics-based criteria for evaluating and refining generated CAD models, allowing engineering feedback to guide geometry toward designs that satisfy downstream requirements (Berger et al., 2026; Son et al., 2026).

Computer-aided engineering (CAE), particularly simulation based on the finite element method (FEM), provides a natural source of deterministic feedback for evaluating generated designs. Recent studies have demonstrated the use of LLMs in automated FEM-based workflows and the acquisition of verifiable engineering signals (Hou et al., 2025; Qi et al., 2025). Simulation outcomes have also been used to guide iterative CAD generation and optimization (Berger et al., 2026; Son et al., 2026; Deng et al., 2026). Reinforcement learning (RL) has further enabled CAD-generation models to learn from geometric feedback (Guan et al., 2025). Training with both geometric and physical feedback introduces a key challenge: prioritizing joint constraint satisfaction while retaining informative feedback on partial progress. A flat aggregation of heterogeneous rewards can obscure this priority, allowing improvements in individual criteria to compensate for unmet design requirements. This calls for a learning signal that distinguishes progress toward feasibility from improvements within the feasible design space.

As illustrated in Fig. 1, we present PhyCAD, a physics-aware Text-to-CAD framework that generates executable CadQuery programs from geometric specifications and physical constraints under prescribed material properties, loads, and boundary conditions. The task defines a constrained design space with admissible dimensional ranges rather than a unique target geometry. We construct a corresponding dataset and an automated CAD–CAE verifier that provides training feedback through program execution, geometric checks, and FEM-based simulation. Building on supervised fine-tuning, we introduce a Hierarchical Balanced Advantage for Group Relative Policy Optimization (GRPO) (Shao et al., 2024), grouping candidates by verification status and combining between-level progress with objective-wise peer ranking within each level. This formulation preserves cross-level priority in the training signal while providing fine-grained feedback for satisfying constraints and improving feasible designs. The trained model directly generates programs without an iterative simulation-guided refinement loop at inference time. Experiments across multiple language models show that PhyCAD consistently improves joint geometric and physical constraint satisfaction.

Our contributions are summarized as follows:

  • We formulate physics-aware Text-to-CAD generation and construct a dataset that jointly captures geometric specifications, loading and boundary conditions, and physics-based constraints.

  • We develop an automated CAD–CAE verification pipeline that provides verifiable feedback on program executability, geometric and dimensional compliance, and physical constraint satisfaction to support model training.

  • We introduce a Hierarchical Balanced Advantage that combines between-level progress with objective-wise peer ranking within each level, preserving cross-level priority in the training signal while providing fine-grained feedback for satisfying constraints and improving feasible designs.

References (41)