nx_explode3d.nx
buildroot/runtime/nx_explode3d.nx
about
nx_explode3d.nx -- R2 of the CAD car-twin ladder: the 3D EXPLODED-VIEW ENGINE (LIB, no main; gated by
nx_explode3d_gate). Lifts the gated nx_assembly explode law (pos = home + explode_vec * t) to 3D parts in
nx_meshrender's vertex format (Q14 x,y,z,color stride-4). Parts carry: home centroid, UNIT explode
direction (radial from their parent's centroid -- the Li/Agrawala-spirit local separation), and assembly
DEPTH (deeper parts travel further = staged explosion, the explodeview signature look). ex3_pose writes the
world-space vertex array for any t in 0..1024 -- deterministic integer, so the same t is the same bytes.
Geometry here = box/octagon-prism STAND-INS (real STEP face tessellation = R1b, its own rung).
ctx e: *i64 slots: 0=lverts 1=nlverts 2=idx 3=ntris 4=nparts 5=home[] 6=dir[] 7=depth[] 8=vstart[]
9=vcount[] 10=maxv 11=maxt 12=maxp. license_tier: ORIGINAL
dependencies 1 imports · 5 importers
imports: nx_syscalls.nx
imported by: nx_explode3d_gate.nxnx_explodelab_meshes.nxnx_explodelab_treegen.nxnx_mechparts.nxnx_wasm_explodelab.nx
structs
| none |
consts
| 11 | const EX3_MAGIC_3400: i64 = 3400 |
| 12 | const EX3_MAGIC_1500: i64 = 1500 |
| 13 | const EX3_MAGIC_1400: i64 = 1400 |
| 14 | const EX3_MAGIC_16384: i64 = 16384 |
| 15 | const EX3_MAGIC_11585: i64 = 11585 |
| 16 | const EX3_MAGIC_1024: i64 = 1024 |
| 19 | const EX3_ONE: i64 = 16384 |
| 20 | const EX3_STEP: i64 = 3600 |
functions
| 22 | func ex3_init(e: *i64, lverts: *i64, idx: *i64, home: *i64, dir: *i64, depth: *i64, vstart: *i64, vcount: *i64, maxv: i64, maxt: i64, maxp: i64, scratch: *i64) -> i64 |
| 42 | func ex3_rad(d: i64) -> i64 { if d == 1 { return EX3_MAGIC_3400 } if d == 2 { return EX3_MAGIC_1500 } return 800 } |
| 43 | func ex3_dyv(d: i64) -> i64 { if d == 1 { return 0 - EX3_MAGIC_1400 } if d == 2 { return 0 - 1000 } return 0 - 700 } |
| 45 | func ex3_isqrt(n: i64) -> i64 called by 1: ex3_part_begin |
| 54 | func ex3_oct(k: i64, out2: *i64) -> i64 |
| 68 | func ex3_part_begin(e: *i64, hx: i64, hy: i64, hz: i64, dx: i64, dy: i64, dz: i64, dep: i64) -> i64 |
| 97 | func ex3_vert(e: *i64, x: i64, y: i64, z: i64, color: i64) -> i64 |
| 112 | func ex3_tri(e: *i64, a: i64, b: i64, c: i64) -> i64 |
| 124 | func ex3_add_box(e: *i64, cx: i64, cy: i64, cz: i64, hx: i64, hy: i64, hz: i64, color: i64) -> i64 |
| 151 | func ex3_add_prism(e: *i64, cx: i64, cy: i64, cz: i64, r: i64, hh: i64, axis: i64, color: i64) -> i64 |
| 200 | func ex3_disp_mag(t: i64, d: i64) -> i64 { return (t * (EX3_STEP * d)) / EX3_MAGIC_1024 } |
| 203 | func ex3_pose(e: *i64, t: i64, wverts: *i64) -> i64 |
| 230 | func ex3_mean_pairdist(e: *i64, t: i64) -> i64 |
| 266 | func ex3_mean_disp_at_depth(e: *i64, t: i64, d: i64) -> i64 |