code wiki / (root) / nx_mechparts.nx

nx_mechparts.nx

buildroot/runtime/nx_mechparts.nx

9689 B176 linesdepth 3pulls 3 transitivereach 4 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_mechparts.nx -- proper procedural MECHANICAL PRIMITIVES for the CAD car-twin viewer (cadtwin R1b-lite): real tessellated cylinders (24-gon), hex nuts WITH a real through-hole, bolts (shaft + hex head), washers, L-brackets, plates -- so /explodelab parts read as actual HARDWARE instead of the crude octagon-prism stand-ins. Emits straight into the nx_explode3d part buffers (ex3_vert/ex3_tri), all <=16 args, wasm-safe (no mmap in loops -- uses the e[13] scratch), deterministic integer. NOT a STEP B-rep tessellation (that needs a fixed-point B-spline evaluator = the deeper R1b rung); these are parametric primitives, the way CAD part catalogs themselves generate standard hardware. license_tier: ORIGINAL

dependencies 1 imports · 2 importers

nx_explode3d.nx nx_mechparts.nx nx_mechparts_gate.nx nx_wasm_explodelab.nx

imports: nx_explode3d.nx

imported by: nx_mechparts_gate.nxnx_wasm_explodelab.nx

structs

none

consts

9const K_MAGIC_16384: i64 = 16384
10const K_MAGIC_15827: i64 = 15827
11const K_MAGIC_4240: i64 = 4240
12const K_MAGIC_14189: i64 = 14189
13const K_MAGIC_8192: i64 = 8192
14const K_MAGIC_11585: i64 = 11585
15const K_MAGIC_1183: i64 = 1183
16const K_MAGIC_1024: i64 = 1024

functions

19func mp_ring(k: i64, nseg: i64, out2: *i64) -> i64
called by 2: mp_prismmp_annulus
50func mp_pt(e: *i64, cx: i64, cy: i64, cz: i64, rc: i64, rs: i64, along: i64, axis: i64, color: i64) -> i64
called by 2: mp_prismmp_annulus calls 1: ex3_vert
58func mp_prism(e: *i64, cx: i64, cy: i64, cz: i64, r: i64, hh: i64, axis: i64, nseg: i64, color: i64) -> i64
98func mp_annulus(e: *i64, cx: i64, cy: i64, cz: i64, or_: i64, ir: i64, hh: i64, axis: i64, nseg: i64, color: i64) -> i64
called by 1: mp_hexnut calls 3: mp_ringmp_ptex3_tri
144func mp_hexnut(e: *i64, cx: i64, cy: i64, cz: i64, across: i64, hh: i64, axis: i64, color: i64) -> i64
called by 1: main calls 1: mp_annulus
153func mp_bolt(e: *i64, cx: i64, cy: i64, cz: i64, sr: i64, sl: i64, hr: i64, hd: i64, axis: i64, color: i64) -> i64
called by 1: main calls 1: mp_prism
171func mp_lbracket(e: *i64, cx: i64, cy: i64, cz: i64, leg: i64, th: i64, w: i64, color: i64) -> i64
called by 1: main calls 1: ex3_add_box