nx_meshthick.nx
buildroot/runtime/nx_meshthick.nx
about
nx_meshthick.nx -- R5 of the CAD car-twin ladder (cadtwin P6a): MESH WALL-THICKNESS by ray-casting (the
GOM/ZEISS-INSPECT "ray method"), the GEOMETRIC half of "identify underbuilt parts when flipping cars"
(R6 nx_underbuilt_board is the DATA half). For each triangle face: from its centroid, cast a ray along the
INWARD normal and find the nearest OTHER face -> that hit distance is the local wall thickness. The MIN over
all faces = the thinnest wall = the underbuilt candidate. A data-driven THRESHOLD (passed in, never
hardcoded) classifies a part OK vs UNDERBUILT. All fixed-point fx256 (256 = 1.0), deterministic. Composes
nx_mesh3 (real tri-mesh + STL interchange). Ray-triangle = Moller-Trumbore, KAT-gated. license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_mesh3.nx
imported by: nx_meshseg3d.nxnx_meshthick_gate.nx
structs
| none |
consts
| 10 | const MTK_ONE: i64 = 256 // 1.0 in fx256 |
| 11 | const MTK_EPS: i64 = 64 // 0.25 real: skip self/coplanar hits (t must exceed this) |
| 12 | const MTK_BIG: i64 = 4611686018427387904 // "no hit" sentinel thickness |
functions
| 14 | func mtk_fxmul(a: i64, b: i64) -> i64 { return (a * b) / MTK_ONE } called by 1: mtk_ray_tri |
| 15 | func mtk_fxdiv(a: i64, b: i64) -> i64 { if b == 0 { return 0 } return (a * MTK_ONE) / b } called by 1: mtk_ray_tri |
| 16 | func mtk_abs(a: i64) -> i64 { if a < 0 { return 0 - a } return a } |
| 19 | func mtk_isqrt(n: i64) -> i64 called by 1: mtk_face_normal |
| 29 | func mtk_ray_tri(ox: i64, oy: i64, oz: i64, dx: i64, dy: i64, dz: i64, |
| 70 | func mtk_cast(base: i64, ox: i64, oy: i64, oz: i64, dx: i64, dy: i64, dz: i64, skip_tri: i64) -> i64 |
| 92 | func mtk_face_normal(base: i64, ti: i64, out3: *i64) -> i64 |
| 115 | func mtk_centroid(base: i64, ti: i64, out3: *i64) -> i64 |
| 127 | func mtk_face_thickness(base: i64, ti: i64) -> i64 |
| 140 | func mtk_min_thickness(base: i64, out_face: *i64) -> i64 |
| 156 | func mtk_is_underbuilt(min_thick: i64, threshold_fx: i64) -> i64 called by 1: main |