nx_csg_rot_gate.nx
buildroot/runtime/nx_csg_rot_gate.nx
about
nx_csg_rot_gate.nx -- GATE for per-primitive SDF ROTATION in nx_csg_scene (the hook-tilt
capability). A box rotated 45 deg about Y must (a) still be a watertight 2-manifold solid
and (b) present a WIDER X-extent than the un-rotated box (its diagonal), proving the
rotation is real, not a no-op.
Watertight is checked on the MESH (dedup via the STL reader's FNV vertex-merge, then the
2-manifold directed-edge check) NOT via slicing: the marching surface of a TILTED face is
a stair-step that confuses contour-stitching, but the mesh is closed by construction. The
FLAT box is checked the same way as a CONTROL, so the test is fair (method works on both).
T1 the rotated box meshes: tris>0 + valid.
T2 rotation widened the X-extent: max_x(rotated) > max_x(flat) (the box's diagonal).
T3 BOTH flat and rotated solids are watertight 2-manifolds (rotation didn't break it).
T4 NEVER-BRICK (#26).
expect_exit: 0 license_tier: ORIGINAL
dependencies 7 imports · 0 importers
imports: nx_syscalls.nxnx_mesh.nxnx_mesh_print_check.nxnx_sdf.nxnx_csg_scene.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
| 26 | const M: i64 = 16384 |
functions
| 23 | 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 } |
| 24 | 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 } |
| 29 | func box_mesh(ang: i64, res: i64) -> *NxMesh called by 1: main calls 5: nx_csg_scene_newnx_csg_scene_addnx_sdf_makenx_csg_scene_add_rotnx_csg_extract_scene |
| 42 | func watertight(m: *NxMesh) -> i64 |
| 53 | func main() -> i64 |