nx_castview.nx
buildroot/runtime/nx_castview.nx
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
imports: nx_planesweep.nxnx_meshthick.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 16 | const CV_TEXQ: i64 = 40 // texture block size in world (fx256) units -- the historic floor |
| 26 | const CV_TARGET_PX: i64 = 32 |
functions
| 30 | func cv_tex(x: i64, y: i64, z: i64) -> i64 calls 1: cv_tex_q |
| 39 | func cv_tex_q(x: i64, y: i64, z: i64, q: i64) -> i64 |
| 55 | func cv_texq_for(dist: i64, f: i64) -> i64 called by 1: cv_render |
| 65 | func cv_render(mesh: i64, cx: i64, cy: i64, cz: i64, basis: *i64, f: i64, w: i64, h: i64, img: *i64, depth: *i64) -> i64 |
| 76 | func 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 |