arXiv:2609.39738cs.LGSep 2026

Manuscript Offprint

arXiv:2609.39738

CNCGEN: A Dataset and Framework for Machining Process Planning and Toolpath Generation from B-rep Models

Xiaolei Zhou, Boyi Lin, Yuchao Feng, Jianwei Zheng

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

ABSTRACT

Learning to generate machining process plans and toolpaths from B-rep CAD requires coupling discrete operation decisions with continuous tool motion as the workpiece evolves. Correctly predicting an operation sequence does not by itself ensure correct material removal, because each toolpath acts on the stock left by preceding cuts. We formulate this problem around persistent manufacturing objects: object identity determines the target of an operation, while the evolving stock state conditions the generation of its toolpath. Based on this formulation, we propose CNCGEN, a dataset and learning framework for three-axis machining. CNCGEN-DATASET contains approximately 50k geometrically verified synthetic machining flows and 800 held-out real CNC records. Each flow aligns B-rep geometry with object-referenced operations, parameterized toolpaths, intermediate stock states, and verification outcomes, enabling supervision of the correspondence between planning decisions and their geometric effects. CNCGEN generates operations and toolpaths for selected objects step by step, updating a compact machining state to guide subsequent predictions. During training, a learned surrogate verifier provides material-removal feedback that links local predictions to their geometric consequences. Experiments on synthetic and held-out real CNC records show that CNCGEN improves the resulting workpiece geometry and reduces residual material and overcut compared with adapted CNC generation baselines.

1 INTRODUCTION

CNC machining transforms stock material into a target part through a sequence of cutting operations. A boundary representation (B-rep) describes the desired geometry, while a machining process must also specify operation order, target regions, and tool motion. Learning from paired geometry and machining records offers a way to infer these choices for new parts. However, these choices are coupled: each toolpath acts on a selected target and changes the stock encountered by subsequent operations. The challenge is therefore to link discrete operation decisions to continuous tool motion for the same target, while accounting for their cumulative material-removal effects.

Learning-based methods address a partial perspective of this challenge. CNC-Net predicts tool radii and paths with iterative stock updates, but follows a prescribed milling-then-drilling schedule rather than selecting the operation type at each step (Yavartanoo et al., 2024). In contrast, DeepMS learns operation sequences and associated material-removal volumes from voxelized geometry, but does not generate the toolpaths that realize those volumes (Maqueda et al., 2025). Lee (2026) proposes combining LLM-based G-code generation with Separation Logic verification, using collision feedback to guide program correction. However, agreement with an operation sequence does not ensure that the associated toolpaths remove the intended material from the evolving stock. Joint learning must therefore connect each operation and toolpath to the same manufacturing target and use the resulting geometric effects to guide both subsequent predictions and training.

This dependence on machining history is evident when features interact. Consider two pockets whose removal volumes overlap within the same workpiece. Machining one pocket changes the material remaining in the other, although both retain their identities as planning targets. The operation type and target identity alone therefore do not specify the remaining removal task. Subsequent operation and toolpath predictions must account for this changing task while preserving their reference to the same target. We therefore formulate machining-flow generation as an object-state rollout. Persistent object references link each operation to its target and toolpath, while the evolving machining state conditions subsequent decisions on preceding material removal. Based on this formulation, we introduce CNCGEN, a dataset and learning framework for three-axis machining of pockets, holes, chamfers, and slant features, as shown in Fig. 1.

Figure

Fig. 1: Overview of CNCGEN. Given a B-rep model, CNCGEN identifies manufacturing objects and generates a machining plan with corresponding toolpaths. The highlighted objects and steps illustrate how a shared identity links discrete operation decisions to continuous tool motion. The upper loop represents feedback of the updated state to subsequent operations and toolpath predictions.

To supervise this rollout, we construct CNCGEN-DATASET with approximately 50k geometrically verified synthetic machining flows. Within each flow, shared object references align operation sequences and parameterized toolpaths with B-rep targets, intermediate stock states, and verification outcomes, so that each operation and toolpath can be related to the stock change it produces. The dataset also includes 800 independently collected, expert-verified real CNC records reserved for evaluating transfer from synthetic to real machining data.

Building on this supervision, CNCGEN recovers manufacturing objects from B-rep and stores their geometry, semantics, and evolving states in shared memory. The planner and toolpath decoder read the same indexed objects, giving operation selection and tool motion a common target representation. To account for preceding cuts, a prefix refiner revises proposed operations using the executed prefix and updated state, which also conditions toolpath and cutting-parameter prediction. The estimated removal effects of each generated toolpath update the state for subsequent steps. During training, a surrogate verifier learned from recorded verification outcomes provides differentiable geometric feedback, so that learning accounts for material-removal quality as well as operation and toolpath annotations. Experiments on synthetic and held-out real CNC records show that CNCGEN improves material-removal accuracy over CNC-Net with predicted region priors. Ablations further show that removing toolpath state conditioning sharply degrades material-removal accuracy despite nearly unchanged operation-sequence accuracy. Our overall contributions are summarized as follows.

• We formulate joint machining process planning and toolpath generation from B-rep as an object-state rollout, linking discrete operation decisions and continuous tool motion through persistent manufacturing-object identities and evolving machining states.

• We construct CNCGEN-DATASET with approximately 50k geometrically verified synthetic machining flows and 800 held-out real CNC records. Object-referenced annotations connect operation choices and tool motion to stepwise material-removal effects.

• We develop CNCGEN, which uses shared object memory to provide a common target representation for planning and toolpath generation, and state-aware prefix refinement and decoding to adapt predictions to preceding cuts. Verification-guided training supplements operation and toolpath supervision with material-removal feedback.

References (43)