code wiki / (root) / nx_castview.nx

nx_castview.nx

buildroot/runtime/nx_castview.nx

5669 B106 linesdepth 4pulls 9 transitivereach 0 importersview sourcekind orphan library
docsdependenciesstructsconstsfunctions

about

nx_castview.nx -- render a mesh3 by RAY-CASTING into (textured image, EXACT depth map). WHY: every reconstruction test in this arc has used a flat synthetic plane. That validates the maths but not the case that matters -- a real machined part with curvature, facets, holes and silhouettes. Real PHOTOGRAPHS are the eventual gate, but they are not the only way past a plane: the as1 STEP file gives REAL CAD part geometry, and ray-casting it produces views WITH exact ground-truth depth per pixel. That turns the whole chain into SCAN-vs-CAD dimensional inspection -- reconstruct a part, compare the result against the CAD it came from -- which is a named twin capability and needs no camera. ⚠SCALE: r3_ray returns a Q14 (R3_Q) unit direction; mtk_ray_tri works in fx256. Converting between them is mandatory -- feeding a Q14 direction to the fx256 caster silently mis-scales every hit distance. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_planesweep.nx nx_meshthick.nx nx_castview.nx

imports: nx_planesweep.nxnx_meshthick.nx

imported by: nobody (leaf or entry point)

structs

none

consts

16const CV_TEXQ: i64 = 40 // texture block size in world (fx256) units -- the historic floor
26const CV_TARGET_PX: i64 = 32

functions

30func cv_tex(x: i64, y: i64, z: i64) -> i64
calls 1: cv_tex_q
39func cv_tex_q(x: i64, y: i64, z: i64, q: i64) -> i64
called by 2: cv_texcv_render_q
55func cv_texq_for(dist: i64, f: i64) -> i64
called by 1: cv_render
65func cv_render(mesh: i64, cx: i64, cy: i64, cz: i64, basis: *i64, f: i64, w: i64, h: i64, img: *i64, depth: *i64) -> i64
76func cv_render_q(mesh: i64, cx: i64, cy: i64, cz: i64, basis: *i64, f: i64, w: i64, h: i64, img: *i64, depth: *i64, q: i64) -> i64
called by 1: cv_render calls 3: r3_raymtk_castcv_tex_q