nx_mechparts.nx
buildroot/runtime/nx_mechparts.nx
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
imports: nx_explode3d.nx
imported by: nx_mechparts_gate.nxnx_wasm_explodelab.nx
structs
| none |
consts
| 9 | const K_MAGIC_16384: i64 = 16384 |
| 10 | const K_MAGIC_15827: i64 = 15827 |
| 11 | const K_MAGIC_4240: i64 = 4240 |
| 12 | const K_MAGIC_14189: i64 = 14189 |
| 13 | const K_MAGIC_8192: i64 = 8192 |
| 14 | const K_MAGIC_11585: i64 = 11585 |
| 15 | const K_MAGIC_1183: i64 = 1183 |
| 16 | const K_MAGIC_1024: i64 = 1024 |
functions
| 19 | func mp_ring(k: i64, nseg: i64, out2: *i64) -> i64 |
| 50 | func mp_pt(e: *i64, cx: i64, cy: i64, cz: i64, rc: i64, rs: i64, along: i64, axis: i64, color: i64) -> i64 |
| 58 | func mp_prism(e: *i64, cx: i64, cy: i64, cz: i64, r: i64, hh: i64, axis: i64, nseg: i64, color: i64) -> i64 |
| 98 | func mp_annulus(e: *i64, cx: i64, cy: i64, cz: i64, or_: i64, ir: i64, hh: i64, axis: i64, nseg: i64, color: i64) -> i64 |
| 144 | func mp_hexnut(e: *i64, cx: i64, cy: i64, cz: i64, across: i64, hh: i64, axis: i64, color: i64) -> i64 |
| 153 | func mp_bolt(e: *i64, cx: i64, cy: i64, cz: i64, sr: i64, sl: i64, hr: i64, hd: i64, axis: i64, color: i64) -> i64 |
| 171 | func mp_lbracket(e: *i64, cx: i64, cy: i64, cz: i64, leg: i64, th: i64, w: i64, color: i64) -> i64 |