Skip to main content
Back to timeline
arXivSource publication:

Text-to-CAD stops grading on shape alone: PhyCAD folds finite-element checks into training rewards, reaching 58.05% joint feasibility

Synopsis

Text-driven CAD generation has long been optimized and evaluated on geometric similarity or visual consistency, yet a correct-looking shape does not guarantee a usable structure. PhyCAD runs executable CadQuery programs through a deterministic CAD–CAE pipeline that judges program executability, geometric and dimensional compliance, and finite-element stress, displacement and mass constraints in stages, then reshapes the GRPO training signal with a hierarchical advantage. On a held-out evaluation set, several open models trained with supervised fine-tuning followed by this reinforcement learning raise joint geometric-and-physical success from 21.76%–37.36% to 39.49%–58.05%.

AI-generated editorial illustration: PhyCAD: Physics-Aware Text-to-CAD Generation via Hierarchical Reinforcement Learning

Interpretation

The criterion for text-to-CAD shifts from resembling a target shape to meeting engineering constraints under given material properties, loads and boundary conditions, with the model emitting executable CadQuery programs directly. Earlier text-to-CAD systems were commonly optimized and evaluated by geometric similarity or visual consistency, while natural-language descriptions do not always fully specify dimensions, topology and structural detail, and small geometric deviations may substantially affect structural behavior. On the held-out evaluation set, five open models after supervised fine-tuning reach 21.76%–37.36% joint success and 39.49%–58.05% after the reinforcement learning; three proprietary models under direct prompting reach 7.29%, 15.51% and 9.28% joint success.

The training signal is layered by verification status, so candidates first clear the feasibility threshold and are then compared on individual objectives within the same level. A flat aggregation of heterogeneous rewards lets improvement in a single criterion compensate for unmet design requirements, so the signal must separate progress toward feasibility from improvement inside the feasible region. On Qwen2.5-3B starting from the same supervised fine-tuned model, non-hierarchical GRPO lowers joint feasibility from 21.76% to 18.80%, while hierarchical GRPO raises it to 39.49%.

Generated programs pass through a deterministic pipeline: execution and a STEP solid that can be reimported, then bounding-box dimensions and required geometric constructions, then finite-element analysis. Finite-element analysis under the prescribed material properties, loads and boundary conditions yields volume-weighted 99th-percentile von Mises stress, maximum nodal displacement and mass, each compared with its prompt upper bound; physical verification succeeds only when all pass. Verification outcomes map to four levels, a larger level meaning further progress toward full feasibility; four completions sampled per prompt form one GRPO group and are evaluated independently by this verifier before conversion into hierarchical advantages.

At inference the model generates a CadQuery program directly, without an iterative simulation-guided refinement loop. Earlier physics-aware CAD workflows often relied on repeated simulation feedback to revise geometry, whereas here the CAD kernel and finite-element solver supply verification outcomes rather than gradients through geometry construction or simulation. The hierarchical advantage combines a between-level progress term with a within-level PeerRank term that ranks candidates separately per objective, with nonnegative weights, so a higher-level candidate in the same prompt group receives a larger advantage.

Perspective

Evaluation uses a physics-aware dataset built from the Text-to-CadQuery corpus, with reference designs annotated by finite-element analysis under isotropic structural steel, three-dimensional small-strain linear elasticity and automatically determined fixture and loading regions; held-out samples are excluded from all policy updates. The intended readers are researchers and engineers working on generative design and simulation-in-the-loop workflows.

Prompts mainly encode physical constraints, so broader engineering intent is only weakly represented, and the dataset does not systematically cover material variations. The authors propose future work on local hard dimensional constraints to enforce critical engineering requirements and reduce ambiguity in generated geometry.