Source-linked AI summary

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

Xiaolei Zhou, Boyi Lin, Yuchao Feng, Jianwei Zheng

arXiv:2609.39738v1cs.LG

TL;DR

Generating a machining plan from B-rep CAD requires coupling operation choices and tool motion to the same targets and to stock changes caused by earlier cuts. CNCGEN combines object-referenced planning, state-conditioned toolpath generation, and geometric verification feedback. Experiments show improved material-removal quality over CNC-Net with predicted region priors.

  • Problem

    Machining operations and toolpaths are coupled: each path acts on a selected target and changes the stock for later operations, so operation type and target identity alone do not capture the remaining removal task.

    Source: §1 · p. 1
  • Method

    CNCGEN formulates machining as an object-state rollout, using persistent object references, evolving stock states, and verification-guided training to generate operations and toolpaths step by step.

    Source: §1 · p. 2
  • Results

    CNCGEN improves material-removal quality over CNC-Net with predicted region priors; similar sequence accuracy can accompany substantially different removal quality when toolpaths lack state conditioning.

    Source: §5.5 · p. 8, §7 · p. 9
  • Takeaways & Limitations

    The ablations show that similar sequence accuracy can mask substantially different removal quality, supporting state-conditioned toolpath generation.

    Source: §7 · p. 9

    CNCGEN targets three-axis machining of pockets, holes, chamfers, and slant features; its coarse geometric evaluation does not establish machining-tolerance or surface-finish accuracy.

    Source: §6 · p. 9

Abstract

from arXiv · show

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

Machining plans must connect each operation and toolpath to the same target while accounting for stock changes caused by earlier cuts. CNCGEN frames this as an object-state rollout and introduces a dataset and framework for learning it.

1 INTRODUCTION

  • Machining history matters because removing material from one feature can change the remaining removal task for another, even when both targets retain their identities.Operation type and target identity alone do not specify the remaining task.Source: §1 · p. 1
  • CNCGEN-DATASET contains approximately 50k geometrically verified synthetic flows and 800 held-out real CNC records, aligning object-referenced operations and parameterized toolpaths with B-rep targets, stock states, and verification outcomes.The real records are reserved to evaluate transfer from synthetic to real machining data.Source: §1 · p. 2
  • CNCGEN improves material-removal accuracy over CNC-Net with predicted region priors, while its ablation shows that sequence accuracy alone can mask large differences in removal quality.The framework uses shared object memory, state-aware prefix refinement and decoding, and verification-guided training.Source: §1 · p. 2
  • CNCGEN uses shared object memory as a common target representation, conditions later predictions on preceding cuts, and trains with surrogate-verifier feedback on material-removal quality.The estimated removal effects of generated toolpaths update the state for subsequent steps.Source: §1 · p. 2
  • CNCGEN formulates joint process planning and toolpath generation as an object-state rollout, linking persistent manufacturing-object references to evolving machining states.The formulation covers three-axis machining of pockets, holes, chamfers, and slant features.Source: §1 · p. 2

2 RELATED WORK

Prior work studies B-rep understanding, process planning, toolpath generation, and CAD-to-CAM datasets, but these strands leave gaps in jointly learning object-referenced operations and continuous toolpaths as stock evolves.

2.1 B-REP LEARNING AND MANUFACTURING FEATURE RECOGNITION

  • B-rep learning and manufacturing-feature recognition recover geometric or feature representations; CNCGEN additionally uses recovered objects as persistent references for planning and toolpath generation as stock evolves.Prior approaches include UV-Net, BRepNet, and feature-recognition methods such as Hierarchical CADNet, BRepGAT, and AAGNet.Source: §2.1 · p. 3

2.2 MACHINING PROCESS PLANNING AND TOOLPATH GENERATION

  • Existing process-planning and toolpath methods divide the task: DeepMS predicts operations and removal volumes without continuous toolpaths, while CNC-Net generates paths under a prescribed milling-then-drilling schedule.Lee (2026) uses collision feedback for iterative G-code correction, whereas CNCGEN uses geometric feedback during training and jointly predicts object-referenced operations and toolpaths conditioned on preceding cuts.Source: §2.2 · p. 3

2.3 DATASETS FOR CAD-TO-CAM LEARNING

  • Existing CAD-to-CAM datasets cover geometry, design sequences, feature annotations, or operations with removal volumes; CNCGEN-DATASET explicitly links each object-referenced operation and parameterized toolpath to its stock change and verification outcomes.This supports evaluation of both the predicted process and cumulative material-removal effects.Source: §2.3 · p. 3

3 DATA REPRESENTATION AND VERIFICATION

CNCGEN represents machining as a verified flow with persistent targets and a state trajectory, then constructs synthetic and real records with geometric and toolpath checks.

3.1 MACHINING FLOW REPRESENTATION

  • Persistent object references link each operation and toolpath to the same geometric target as stock changes, while the state trajectory records the initial state and its evolution after each step.The representation also includes input B-rep geometry, initial stock, target-part geometry, manufacturing objects, and verification results.Source: §3.1 · pp. 3–4

3.2 DATASET CONSTRUCTION AND VERIFICATION

  • CNCGEN-DATASET contains approximately 50k verified synthetic flows generated from standard-part families under constrained three-axis milling rules, covering pockets, holes, chamfers, and slant features.Representative samples pair B-rep models with feature geometry and machining outcomes.Source: §3.2 · p. 4, Figure 2 · p. 4
  • Candidate flows are checked for B-rep geometry, manufacturing objects, toolpath legality, and material-removal outcomes; 800 independently collected real records are expert-screened and reserved for testing transfer beyond the generated standard-part distribution.The real records are excluded from training, validation, model selection, and fine-tuning.Source: §3.2 · p. 4

4 METHODOLOGY

CNCGEN couples persistent object references with machining-state feedback so operation selection and toolpath generation share targets and account for preceding cuts. Its pipeline refines operations, updates state from predicted removal, and uses a frozen verifier for training feedback.

4 METHODOLOGY

  • CNCGEN couples persistent object memory, state-dependent prefix refinement, state-conditioned toolpaths, and frozen-verifier feedback in a stepwise machining-flow pipeline.At inference, prefix refinement, toolpath generation, and state updates proceed step by step.Source: §4 · p. 4, §4.4 · p. 6

4.1 OBJECT MEMORY FROM B-REP GEOMETRY

  • B-rep decoding recovers object candidates whose retained memory entries preserve target identity while dynamic tokens encode evolving machining context shared by both decoders.The compact state combines global material-removal summaries with object-level progress variables.Source: §4.1 · pp. 4–5

4.2 OPERATION PLANNING WITH STATE FEEDBACK

  • Parallel proposals establish an operation sequence, then prefix refinement uses prior decisions, object usage, and path statistics to revise each step and select its target.Planner supervision includes operation labels, matched object pointers, and coverage, count, and compatibility constraints.Source: §4.2 · p. 5

4.3 STATE-CONDITIONED TOOLPATHS AND STATE UPDATES

  • Each toolpath is conditioned on its selected object, operation, B-rep context, and pre-operation state; a geometric removal estimate plus learned correction updates state for later predictions.Toolpath outputs include Bézier control points, waypoints, motion and pass labels, strategy and tool attributes, and cutting parameters.Source: §4.3 · p. 5

4.4 VERIFICATION-GUIDED TRAINING

  • A pretrained Surrogate Verifier supplies differentiable geometric feedback during generator refinement, combining selected-region error with overcut and residual-material penalties on valid candidate steps.Its aircut, validity, and risk outputs serve as auxiliary diagnostics; staged pretraining is followed by joint refinement on generator rollouts.Source: §4.4 · p. 6

5 EXPERIMENTS AND ANALYSIS

Experiments compare CNCGEN with adapted CNC-Net baselines on synthetic and held-out real CNC records, assessing geometry, material removal, component effects, and transfer. CNCGEN improves removal quality on both benchmarks, while ablations show that similar sequence accuracy can accompany different removal outcomes.

5.1 EXPERIMENTAL SETUP; 5.3 BASELINES AND COMPARISON SETTING

  • Evaluation uses deterministic 90/5/5 synthetic splits, holds out all 800 real records for testing, and compares CNCGEN with CNC-Net variants using predicted or oracle machining-region priors.Methods share B-rep preprocessing and an offline geometry evaluator; failed executions remain in evaluation.Source: §5.1 · p. 7, §5.3 · p. 7

5.2 EVALUATION METRICS

  • Final-shape IoU, Removal F1, normalized Chamfer Distance, Overcut, and Residual assess final geometry and the extent and accuracy of material removal.Ablation operation predictions are also assessed by step and sequence exact match and category macro-F1.Source: §5.2 · p. 7

5.4 MAIN COMPARISON; 5.6 REAL-WORLD EVALUATION

  • On synthetic tests, CNCGEN has higher Removal F1 than CNC-Net+Oracle MRP (0.9016 versus 0.5067), but higher Overcut (0.0079 versus 0.0025).On held-out real records, CNC-Net+Oracle MRP has Residual 0.6617 versus 0.1845 for CNCGEN, and Removal F1 0.4290 versus 0.8126.Source: §5.4 · p. 7, §5.6 · p. 9
  • Removal F1 rises from 0.2318 to 0.9016 on synthetic tests and from 0.1170 to 0.8126 on held-out real records for CNCGEN versus CNC-Net+Pred. MRP.On synthetic tests, Residual falls from 0.6032 to 0.0431; on real records, it falls from 0.7268 to 0.1845.Source: §5.4 · p. 7, Table 1 · p. 8, §5.6 · pp. 8–9

5.5 ABLATION STUDIES

  • Without state-aware toolpaths, Seq. EM changes from 0.8290 to 0.8260, while Removal F1 falls from 0.9016 to 0.3113 and overcut rises from 0.0079 to 0.0169.Removing MER lowers category Macro-F1 from 0.9024 to 0.2182 and Removal F1 from 0.9016 to 0.1484; removing the prefix refiner lowers Seq. EM from 0.8290 to 0.7796 and Removal F1 to 0.3115. Without SV loss, IoU decreases from 0.9525 to 0.9296 and overcut increases from 0.0079 to 0.0236.Source: §5.5 · p. 8

5.6 REAL-WORLD EVALUATION

  • Real-benchmark case inspection identifies remaining errors in multi-feature pockets, narrow chamfers, slant features, and overlapping pocket boundaries.Relative to synthetic tests, Removal F1 decreases from 0.9016 to 0.8126 and Residual increases from 0.0431 to 0.1845.Source: §5.6 · p. 9

6 LIMITATIONS

CNCGEN is scoped to three-axis machining of specified feature types, and its coarse geometric evaluation does not establish machining-tolerance or surface-finish accuracy.

6 LIMITATIONS

  • CNCGEN targets three-axis machining of pockets, holes, chamfers, and slant features; turning, free-form finishing, and simultaneous multi-axis machining require broader process or motion representations.External profile machining is supplied by setup construction.Source: §6 · p. 9
  • The compact 2.5D state and 4.0 mm occupancy evaluation describe material removal at a coarse geometric scale, not machining-tolerance or surface-finish accuracy.Narrow-feature and boundary errors remain in the real benchmark.Source: §6 · p. 9
  • Training uses synthetic standard-part flows, while the 800 real records cover a limited range of shop practices, fixtures, and machining intent.Generated plans and parameterized toolpaths require machine-specific post-processing; geometric verification does not assess cutting forces, tool wear, chatter, or physical suitability of predicted cutting parameters.Source: §6 · p. 9

7 CONCLUSION

The conclusion presents CNCGEN-DATASET and CNCGEN as a joint approach to learning object-referenced process plans and continuous toolpaths from B-rep models.

7 CONCLUSION

  • Experiments on synthetic and held-out real records show improved material-removal quality over CNC-Net with predicted region priors.Ablations show that similar sequence accuracy can mask substantially different removal quality, supporting state-conditioned toolpath generation.Source: §7 · p. 9

AI USE DISCLOSURE

The authors report that generative AI assisted manuscript preparation but not dataset generation, method implementation, or experiments.

AI USE DISCLOSURE

  • Generative AI tools assisted language editing, translation, structural revision, and editorial feedback, but were not used to generate the dataset, implement the method, or conduct experiments.The authors take responsibility for the final manuscript and its scientific claims.Source: AI USE DISCLOSURE · p. 10

SUPPLEMENTARY MATERIAL

The supplement outlines the paper’s supporting materials and records, which link B-rep geometry and persistent manufacturing objects to operations, toolpaths, stock states, and verification outcomes.

A.1 MACHINING FLOW RECORDS

  • Each machining-flow record links B-rep geometry and stock to manufacturing objects, ordered operations, toolpaths, intermediate states, and verification outcomes.States represent the material remaining after specific operation prefixes, while verification records describe geometric outcomes.Source: §A.1 · p. 12
  • Operation records preserve target identity across steps, and object pointers link each operation to its corresponding tool motion.Toolpaths include control points, waypoints, motion and pass labels, strategy, tool class, and cutting parameters.Source: §A.1 · p. 12
  • Fig. S1 illustrates the B-rep input, extracted machining features, recorded toolpaths, and primitives for slant milling, pocket milling, and drilling.The supplement also points to representative dataset examples in Fig. 2 and Fig. S2.Source: Figure S1 · p. 12, §A.1 · p. 12

A.2 SYNTHETIC DATA GENERATION AND VERIFICATION

The supplement describes constrained synthetic-flow generation and verification, a separately curated held-out real CNC benchmark, and a deterministic synthetic-data split.

A.2 SYNTHETIC DATA GENERATION AND VERIFICATION

  • Synthetic flows cover pockets, holes, chamfers, and slant features, with varied stock, feature layouts, operation orders, and canonical toolpath parameters.Generation follows constrained three-axis milling rules and excludes held-out real records as templates or perturbed training examples.Source: §A.2 · p. 12
  • Synthetic samples are retained only after toolpath-legality checks and a minimum voxelized verification IoU of 0.95 across validation runs.Checks include geometric screening, manufacturability filtering, toolpath checks, and material-removal verification.Source: §A.2 · pp. 12–13

A.3 REAL-WORLD DATA COLLECTION AND CURATION

  • Expert review retained 800 real CNC records with aligned geometry, stock, features, operation descriptions, toolpath metadata, and machining outcomes.All 800 are held out from training, validation, model selection, and fine-tuning.Source: §A.3 · pp. 13–14

A.4 SPLIT PROTOCOL AND DATASET STATISTICS

  • The approximately 50k synthetic flows use a deterministic 90/5/5 train-validation-test split based on hashing sample identifiers.The same identifier retains its partition assignment regardless of record order; Fig. S4 summarizes feature-count and command-type distributions.Source: §A.4 · p. 14, Figure S4 · p. 14

B METHOD DETAILS

The method uses shared object references and evolving machining state to connect operation planning, toolpath generation, and geometric verification across successive steps.

B. METHOD DETAILS

  • Aligned record targets supervise object recovery, planning, toolpath generation, state prediction, and verification, while shared memory entries combine persistent object fields with step-dependent context.The planner and toolpath generator access the same retained entries through query-dependent attention.Source: B METHOD DETAILS · p. 14, §B.1 · p. 15, Figure S5 · p. 15

B.2 OPERATION PLANNING AND PREFIX REFINEMENT

  • Planning predicts operation and feature types, an object pointer, validity, and termination, while prefix refinement revises steps using prior decisions and updated state.The pointer distribution uses object embeddings and machining context before the current operation.Source: §B.2 · p. 16

B.3 TOOLPATH GENERATION AND STATE UPDATES

  • Toolpaths are decoded from the selected operation, target object, B-rep context, and pre-operation state, then update the state used for later predictions.A deterministic 2.5D carving model estimates removal, and a residual updater corrects the resulting state.Source: §B.3 · p. 16

B.4.1 OFFLINE MATERIAL-REMOVAL LABELS

  • Offline verification estimates machined occupancy by removing cutter-swept regions from stock occupancy on a 4.0 mm grid.The evaluation also retains failed executions, scoring partial rollouts by their last exported occupancy and missing exports as uncut stock.Source: §B.4.1 · p. 17, §C.2 · p. 18

B.4.2 SURROGATE ARCHITECTURE

  • The surrogate verifier combines analytic path-contact estimates with learned calibration and supplies geometric feedback to the generator while its parameters remain frozen.Its calibrated outputs include IoU, Removal F1, overcut and residual penalties, validity, and risk.Source: §B.4.2 · p. 17

B.4.3 TRAINING OBJECTIVE AND RISK LABELS

  • Verifier training weights overcut more heavily because later operations cannot restore removed target material, and labels flag high overcut, low recall, or invalid verification.The overcut weight is 2.0 versus 0.5 for residual penalty; rejectable risk includes overcut penalty above 0.12 or removal recall below 0.90.Source: §B.4.3 · p. 17

C.1 IMPLEMENTATION AND TRAINING SETTINGS

  • The reported geometric metrics use a shared stock-frame evaluation protocol, while training uses separate settings for feature recognition, planning, toolpaths, and verifier refinement.Real targets are reconstructed from stock and manufacturing annotations, with boundary-profile setup machining excluded from the removal target when appropriate.Source: §C.2 · p. 18, §C.1 · p. 18

C.3 BASELINE ADAPTATION

  • The CNC-Net adaptation uses rasterized region priors, whereas CNCGEN uses B-rep graph features with object, operation, toolpath, and state supervision.The oracle-prior variant uses reference manufacturing annotations and is a privileged diagnostic setting; predicted-prior generation does not access target labels or occupancy at test time.Source: §C.3 · p. 19

C.4 ABLATION SETTINGS AND ANALYSIS

The ablations associate object memory, prefix refinement, state-aware toolpaths, and verifier training with aspects of machining quality; supplementary analyses report verifier agreement, qualitative outcomes, and remaining scope boundaries.

C.4 ABLATION SETTINGS AND ANALYSIS

  • Without MER, Category Macro-F1 falls from 0.9024 to 0.2182 and Removal F1 from 0.9016 to 0.1484, while residual material rises from 0.0431 to 0.0673.Object-referenced Step EM and Seq. EM are inapplicable without stable operation-target identities.Source: §C.4 · p. 19
  • Without prefix refinement, Step EM decreases from 0.8552 to 0.8172 and Seq. EM from 0.8290 to 0.7796, while overcut increases from 0.0079 to 0.0167.Removal F1 falls to 0.3115.Source: §C.4 · p. 19
  • Without state-aware toolpaths, Removal F1 falls from 0.9016 to 0.3113 and overcut rises from 0.0079 to 0.0169 despite similar sequence accuracy.Step EM is 0.8530 versus 0.8552 for the full model, and Seq. EM is 0.8260 versus 0.8290.Source: §C.4 · p. 19
  • Without the SV loss, IoU decreases from 0.9525 to 0.9296 and Removal F1 from 0.9016 to 0.3041, while overcut reaches 0.0236.The latter is the highest overcut value among the ablations.Source: §C.4 · pp. 19–20

C.5 SURROGATE VERIFIER RELIABILITY

  • SV predictions show Spearman correlations of 0.61–0.79; risk and validity AUROC values are 0.958 and 0.951, with F1 scores of 0.894 and 0.910.Final machining geometry is evaluated separately with the offline material-removal evaluator.Source: §C.5 · p. 20, Table S1 · p. 20, Table S2 · p. 20

C.6 ADDITIONAL QUALITATIVE RESULTS AND FAILURE ANALYSIS

  • In displayed held-out real-part examples, CNCGEN recovers cavities and through-regions more completely than CNC-Net+Pred. MRP, which leaves fragmented residuals or incomplete interiors.Fig. S6 presents target geometry, CNC-Net+Pred. MRP, and CNCGEN under the common offline evaluator.Source: §C.6 · p. 20, Figure S6 · p. 20
  • Failed rollouts show residual material near narrow bands, pocket intersections, and slant-feature boundaries, as well as noisy geometry linked to object-binding or local-path errors.Such errors can reduce IoU and increase overcut even when the operation category is reasonable.Source: §C.6 · pp. 20–21, Figure S7 · p. 21

D EXTENDED DISCUSSION

  • The evaluation covers common three-axis features and geometric removal, but broader process coverage, real-record diversity, and physical-process checks remain outside the stated scope.The discussion identifies limited shop-practice coverage and notes that force, deflection, chatter, thermal effects, wear, coolant, and feed/speed suitability are not evaluated.Source: D EXTENDED DISCUSSION · p. 21
Loading 2609.39738v1…