code wiki / (root) / nx_meshthick.nx

nx_meshthick.nx

buildroot/runtime/nx_meshthick.nx

6718 B155 linesdepth 3pulls 6 transitivereach 18 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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 2 imports · 4 importers

nx_mesh3.nx nx_vecmath.nx nx_meshthick.nx nx_castview.nx nx_meshseg3d.nx nx_meshthick_gate.nx nx_wallstat.nx

imports: nx_mesh3.nxnx_vecmath.nx

imported by: nx_castview.nxnx_meshseg3d.nxnx_meshthick_gate.nxnx_wallstat.nx

structs

none

consts

11const MTK_ONE: i64 = 256 // 1.0 in fx256
12const MTK_EPS: i64 = 64 // 0.25 real: skip self/coplanar hits (t must exceed this)
13const MTK_BIG: i64 = 4611686018427387904 // "no hit" sentinel thickness

functions

15func mtk_fxmul(a: i64, b: i64) -> i64 { return (a * b) / MTK_ONE }
called by 1: mtk_ray_tri
16func mtk_fxdiv(a: i64, b: i64) -> i64 { if b == 0 { return 0 } return (a * MTK_ONE) / b }
called by 1: mtk_ray_tri
17func mtk_abs(a: i64) -> i64 { if a < 0 { return 0 - a } return a }
called by 2: mtk_ray_trimain
20func mtk_isqrt(n: i64) -> i64 { return vm_isqrt(n) }
called by 1: mtk_face_normal calls 1: vm_isqrt
24func mtk_ray_tri(ox: i64, oy: i64, oz: i64, dx: i64, dy: i64, dz: i64,
65func mtk_cast(base: i64, ox: i64, oy: i64, oz: i64, dx: i64, dy: i64, dz: i64, skip_tri: i64) -> i64
87func mtk_face_normal(base: i64, ti: i64, out3: *i64) -> i64
110func mtk_centroid(base: i64, ti: i64, out3: *i64) -> i64
called by 1: mtk_face_thickness calls 2: m3_trim3_vert
122func mtk_face_thickness(base: i64, ti: i64) -> i64
135func mtk_min_thickness(base: i64, out_face: *i64) -> i64
called by 1: main calls 2: m3_hdrmtk_face_thickness
151func mtk_is_underbuilt(min_thick: i64, threshold_fx: i64) -> i64
called by 1: main