# 형상 표현, CAD 변경, 곡률 채널 실험 설계

Source requirements: [[POC] 데이터 전처리 방법론 검토](https://onepredict.atlassian.net/wiki/spaces/TD1/pages/3275522074/POC), read 2026-09-14 through the signed-in browser. This local implementation does not modify Confluence.

## What this experiment can establish

The supplied dataset contains one CAD design and two scan/process runs. Each process workbook has 50 channels, 48 numeric observations and two missing values. The existing mesh has 332,479 vertices; the earlier graph has 11,956 nodes and 72,176 directed edges. Existing registration/annotation validity is unresolved. Geometry representations and computational model behavior can be compared now; generalization, defect probability calibration and optimal production conditions cannot be established from these inputs.

Keep three outputs distinct: (1) measured representation quality and runtime on the real CAD; (2) executable model forward/backward checks; (3) synthetic training/optimization demonstrations. Only future independent, validated data can support actual performance estimates. Millions of points from two physical parts do not create millions of independent training examples.

## GNN when CAD changes

**A variable-size message-passing GNN can accept a different CAD graph. Accurate predictions on the new design require separate validation.** Rebuild nodes, edges, geometric features and boundary conditions from each revision. Never reuse node IDs or the old adjacency merely because the new shape resembles AC28. Shared node/edge networks and permutation-invariant aggregation allow different graph sizes. A fixed node-index embedding or flattening all nodes into a fixed output vector would undermine this property.

[MeshGraphNets](https://arxiv.org/abs/2010.03409) reports adaptive mesh simulation and resolution-independent dynamics in its studied systems. This supports the architecture choice; it does not validate transfer from additive-manufacturing/cloth/aerodynamics data to Moltex forming. [Topology-Agnostic Graph U-Nets](https://arxiv.org/abs/2410.06406) is another relevant scalar-field architecture, not evidence that our current data supports a production predictor.

| Change | Required experiment | Interpretation |
|---|---|---|
| Relabel/reorder the same nodes | Permute node features and remap every edge, undo output permutation | Numerical equivariance test; no new design |
| Remesh the same CAD | Train/evaluate at different resolutions, compare fields on common original-surface query points | Discretization transfer; still one design |
| Change a radius, flange width or thickness | Recompute geometry and process/fixture descriptors; hold the revision out of training | Limited geometry transfer |
| Add/remove holes, ribs or separate shells | Rebuild topology, normals, material/BC maps; evaluate an unseen design family | Topology transfer; likely harder |
| Change material, heating or loading regime | Hold out the regime and provide physical descriptors/history | Physics-domain transfer |

Use a common physical unit (mm), keep physical part size, and fit statistical scalers only on training parts. Per-axis unit-cube scaling distorts angles and curvature; use a single length scale while retaining physical scale as input. Plain coordinate/normal features are not rotation invariant. Consistent manufacturing axes, gravity/heater/draw directions, and rotation tests matter. A diagnostic mirrored scan is not an acceptable geometry augmentation without confirming handedness.

Split by physical part/run/day for repeated-production prediction and by CAD revision/design family for new-design prediction. Patches, views and graph resolutions from the same part must remain in one split. Start with geometry-only and process-only baselines, then fuse them. Report per-part PR-AUC/recall at a fixed false-positive rate for sparse defects, calibrated probabilities, localization distance in mm, and per-region performance once labels exist. Thermal/strain regression needs physical-unit errors and hotspot errors, not only global average loss.

## Dense-to-coarse graph comparison

Requested target node budgets are 12,000 → 6,000 → 3,000 → 1,500 → 750 → 300 → 100. Mesh simplification is constrained by topology and boundaries, so filenames denote requested budgets and metadata reports actual achieved counts. An unattainable target must remain visible. No across-wall kNN edges are added to fake connectivity.

Compare source-surface to simplified-surface mean/P95/max sampled distances in mm, surface area change, connected components, boundary/nonmanifold edges, curvature mapping coverage, edge-length distribution, bytes and forward latency. Sampling gives an estimate, not an exact Hausdorff bound. Inspect small fillets, cutouts and narrow flanges visually; a small global average error can hide the entire defect-relevant feature. Select a budget against the smallest validated defect/feature size and measurement tolerance; do not pick a winner from speed alone.

Use original CAD derivative samples for curvature transfer, with distance/normal-agreement validity masks. Coarse-mesh normal turning is a discretization-dependent descriptor. Preserve a distinction between original analytic curvature and coarse normal-turn proxies. Invalid curvature is unknown, not flat. Smooth principal curvature is undefined at a sharp CAD face junction, where dihedral/boundary features are more appropriate.

## Image input with geometric information

The intended word is geometric information: 2D views can carry aligned 3D descriptors. Use a shared camera and frontmost-surface selection for every channel. Store a visible CAD triangle/node mapping and pixel-to-3D coordinates so predicted pixels can be fused back onto the surface. Include six opposing orthographic views to expose more faces; internal/occluded surfaces still need a graph, UV representation or additional cameras.

| Channel group | Meaning | Availability/constraint |
|---|---|---|
| Silhouette + visibility | Product pixels and frontmost visible surface | Background is not a negative defect label |
| Depth + XYZ | Camera distance and CAD location in physical coordinates | Preserve common projection/normalization metadata |
| Normal XYZ + view/draw alignment | Local orientation/slope | Use consistent orientation and camera/draw directions |
| Principal curvature magnitudes; Gaussian curvature | Bending radii and saddle/elliptic shape | Analytic sample transfer mask; inverse-mm / inverse-mm² |
| Normal change / dihedral / boundary cues | Ridges, creases, face transitions | Distinguish real trim edges from tessellation artifacts |
| Image boundary distance | Distance from silhouette in the projected image | Not geodesic distance to a physical CAD edge |
| Thickness and thickness gradient | Material section and rapid changes | Missing until supplied or validated; ray chord is not automatically sheet thickness |
| Temperature/time features | Tmax, cooling rate, temperature gradients | Missing until actual synchronized sensor/CAE history exists |
| Material, pressure, heating/cooling conditions | Constitutive/process context | Global vector + missing masks; FiLM/broadcast fusion |
| Fixture/contact/heater distance | Boundary-condition context | Requires identified fixtures, contacts and heater geometry |

A depth-only CNN must infer surface derivatives from a projection. Explicit normals and curvature provide a useful inductive bias; whether they improve accuracy is an ablation question. Run depth-only → depth+XYZ/normals → +curvature/boundary → +process → +validated thickness/thermal/BC features on the same part-level split. Compare model capacity and keep masks available. With few parts, additional channels can overfit.

**High curvature is a candidate geometric cue, not a measured high-stress or defect label.** Stress depends on load direction, constraints, material and temperature-dependent behavior, local thickness and contact. Sharp corners can cause mathematical stress singularities; a bright curvature pixel should not be renamed a stress hotspot. A larger fillet can reduce stress concentration in particular load cases, but geometry changes can have different consequences under displacement-controlled loading. See [COMSOL's mechanics examples](https://www.comsol.com/blogs/making-structures-stronger-by-removing-material) and [stress singularity discussion](https://www.comsol.com/blogs/singularities-in-finite-element-models-dealing-with-red-spots).

UV grids complement camera images: each B-Rep face is sampled in its own parameter domain with a trim mask, then face adjacency supplies connectivity. [UV-Net](https://arxiv.org/abs/2006.10211) combines this geometric and topological information. UV spacing is not uniform physical spacing, so trim masks and geometric coordinates/normals must accompany the grids.

## Model-family interpretation

2D U-Net/CNN predicts pixels; point models predict points; mesh GNN predicts mesh nodes; UV-Net-style models predict faces; 3D U-Net predicts voxels. They must eventually be evaluated on a common physical surface/volume target with explicit transfer uncertainty. Surface voxels from a nonwatertight mesh do not establish internal solid occupancy. A regular-grid FNO is a useful executable operator baseline, but requires actual input/output fields for physical thermal training. The [thermal FNO paper](https://arxiv.org/abs/2307.01804) used simulation data and warned that global field averages can hide errors around active thermal regions.

For pre-process prediction, use only information available before forming: CAD, material/nominal thickness, planned conditions and valid prior simulations. Post-process scan deviations, measured dents and final thickness cannot be inputs to that task. They can serve as validated targets or inputs to a separately labeled inspection task. Preserve source timing in schemas.

## STEP/XLS to risk-area and deformation targets

The canonical pre-process sample is one physical production run: `STEP geometry + XLS conditions` as input, with the registered fused `all_merge_pointcloud_full.ply` and reviewed defect annotations used only to construct targets. T1_DOWN, T1_UP, T2_LEFT, T2_RIGHT and TOP are component observations of that same part. They can check sensor extrinsics, coverage and cross-sensor consistency, but must not be counted as five independent training samples.

The node-wise model should have separate heads for defect probability/segmentation, signed normal surface residual and residual magnitude. Use mask-aware Dice or focal/BCE loss for the sparse defect area and robust Huber-type regression for validated deformation. A point annotation can supervise a seed/localization head. It cannot determine defect shape: the supplied CSV W/H cells are empty, so the exported 5/10/20 mm geodesic dilations are weak-label sensitivity bands. Production segmentation needs polygons, masks, measured width/height, or an independently validated rule that derives extent from the scan.

The 34 heater channels form two 17-zone layers. Internal missing zones are linearly interpolated by zone number only when valid heaters exist on both sides; edge gaps are never extrapolated. Raw values, observed masks and imputation masks remain stored separately. Mapping those values to the CAD requires physical heater-zone footprints or coordinates and the forming direction/contact geometry. The current overlay assigns zones 01→17 uniformly along CAD X for visualization only and sets `heater_projection_valid=false`. Once footprints are provided, replace this with per-node distances/overlaps to upper and lower heater zones, temperature difference, local gradient and time-history features.

Geometry registration must resolve orientation before deformation is calculated. A physical rigid transform has determinant +1. The current 16:00 visually close transform has determinant −1, indicating an unconfirmed handedness or reflection convention. Confirm the scanner coordinate axes and sensor extrinsics, apply any documented coordinate-system conversion, then fit and validate a proper rigid transform using stable geometric features/datums. Report residuals by long arm, bend, leg and component sensor. Until then, `training_valid=false` is correct.

## Physics constraints and risk

Some consistency can be enforced with the current fields. The diagnostic GNN makes deformation magnitude at least the absolute signed normal deformation by construction and penalizes sharp graph-to-graph changes in fitted risk and signed deformation. Smoothness is a spatial prior; it is not evidence that the prediction obeys heat transfer or mechanics. Risk probability is also not a physical state variable, so rules such as “hotter always means more defective” or “more curvature always means more risk” should not be imposed as universal laws.

A heat-equation residual becomes meaningful after heater footprints, temperature time histories, thermal conductivity, heat capacity, density, convection/contact coefficients and initial/boundary conditions are supplied. A thermo-mechanical residual additionally needs sheet thickness, temperature-dependent elastic/viscoelastic or plastic material behavior, pressure/vacuum history, tooling contact, friction, fixtures and displacement/traction boundary conditions. Then a hybrid model can combine supervised risk/defect losses with heat-balance, equilibrium, constitutive and boundary-condition residuals, while keeping separate uncertainty or out-of-distribution scores for new CAD designs.

## Data needed next

Obtain scanner coordinates/handedness, datum/fixture definitions, calibrated pixel-to-surface annotation mapping, part/run/revision identity, positive and reviewed negative defect labels, substrate/coating grades and thickness, and aligned process histories. Add independent good and defective parts across meaningful operating conditions. For thermal-field or stress prediction, obtain CAE/sensor field targets with time, units and BC/material provenance. Define hard machine/material bounds before any real condition optimization. Synthetic Bayesian optimization here is solely an API/algorithm demonstration and must not control production.
