code wiki / (root) / nx_explode3d.nx

nx_explode3d.nx

buildroot/runtime/nx_explode3d.nx

10988 B288 linesdepth 2pulls 2 transitivereach 10 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_explode3d.nx nx_explode3d_gate.nx nx_explodelab_meshes.nx nx_explodelab_treegen.nx nx_mechparts.nx nx_wasm_explodelab.nx

imports: nx_syscalls.nx

imported by: nx_explode3d_gate.nxnx_explodelab_meshes.nxnx_explodelab_treegen.nxnx_mechparts.nxnx_wasm_explodelab.nx

structs

none

consts

11const EX3_MAGIC_3400: i64 = 3400
12const EX3_MAGIC_1500: i64 = 1500
13const EX3_MAGIC_1400: i64 = 1400
14const EX3_MAGIC_16384: i64 = 16384
15const EX3_MAGIC_11585: i64 = 11585
16const EX3_MAGIC_1024: i64 = 1024
19const EX3_ONE: i64 = 16384
20const EX3_STEP: i64 = 3600

functions

22func 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
42func ex3_rad(d: i64) -> i64 { if d == 1 { return EX3_MAGIC_3400 } if d == 2 { return EX3_MAGIC_1500 } return 800 }
called by 2: mainmain
43func ex3_dyv(d: i64) -> i64 { if d == 1 { return 0 - EX3_MAGIC_1400 } if d == 2 { return 0 - 1000 } return 0 - 700 }
called by 2: mainmain
45func ex3_isqrt(n: i64) -> i64
called by 1: ex3_part_begin
54func ex3_oct(k: i64, out2: *i64) -> i64
68func ex3_part_begin(e: *i64, hx: i64, hy: i64, hz: i64, dx: i64, dy: i64, dz: i64, dep: i64) -> i64
called by 4: mainmainmainworld_init calls 1: ex3_isqrt
97func ex3_vert(e: *i64, x: i64, y: i64, z: i64, color: i64) -> i64
112func ex3_tri(e: *i64, a: i64, b: i64, c: i64) -> i64
124func ex3_add_box(e: *i64, cx: i64, cy: i64, cz: i64, hx: i64, hy: i64, hz: i64, color: i64) -> i64
151func ex3_add_prism(e: *i64, cx: i64, cy: i64, cz: i64, r: i64, hh: i64, axis: i64, color: i64) -> i64
called by 1: main calls 3: ex3_octex3_vertex3_tri
200func ex3_disp_mag(t: i64, d: i64) -> i64 { return (t * (EX3_STEP * d)) / EX3_MAGIC_1024 }
203func ex3_pose(e: *i64, t: i64, wverts: *i64) -> i64
called by 2: mainrender_at calls 1: ex3_disp_mag
230func ex3_mean_pairdist(e: *i64, t: i64) -> i64
called by 1: main calls 1: ex3_disp_mag
266func ex3_mean_disp_at_depth(e: *i64, t: i64, d: i64) -> i64
called by 1: main calls 1: ex3_disp_mag