nx_csg_scene_gate.nx
buildroot/runtime/nx_csg_scene_gate.nx
about
nx_csg_scene_gate.nx -- GATE for the N-primitive CSG scene extractor (nx_csg_scene).
Proves a MULTI-feature solid -- a block MINUS two through-holes UNION a riser (4 prims,
mixing DIFF and UNION) -- composes into ONE watertight, printable mesh, beyond what the
2-primitive nx_csg_extract can express.
T1 the scene meshes: non-empty + nx_mesh_validate OK (indices in range).
T2 WATERTIGHT + features: a mid-slice has n_open=0 AND >=3 closed loops (outer + 2 holes).
T3 features present by inside-count: holes REMOVED material, riser ADDED material.
T4 STL round-trip: write -> nx_stl_load_binary verdict OK, header tri count matches.
T5 NEVER-BRICK (#26): pure-integer field + mesh + write; zero hardware-state writes.
T6 LIAR-KILL: displacing a hole far outside the block restores material (field really
depends on the primitive params -- the multi-feature result is not rigged).
expect_exit: 0 license_tier: ORIGINAL
dependencies 11 imports · 0 importers
diagram shows first 10 each side; +1 more imports, +0 more importers in the complete lists below.
imports: nx_syscalls.nxnx_mesh.nxnx_mesh_edit.nxnx_sdf.nxnx_csg.nxnx_csg_scene.nxnx_bvh.nxnx_slice_plane.nxnx_slice_contour.nxnx_stl_write.nxnx_stl.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 29 | const MM: i64 = 16384 |
functions
| 25 | func gw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 26 | func gn(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{sys_write(1,"-\x00" as *u8,1);m=0-m} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 } |
| 32 | func build_scene(hole1_cx: i64) -> *NxCsgScene |
| 45 | func main() -> i64 |