nx_meshgen_domain_candidate_t337.nx
buildroot/runtime/nx_meshgen_domain_candidate_t337.nx
about
nx_meshgen.nx -- sovereign SURFACE NETS: turn ANY signed-distance FIELD into a watertight triangle MESH
(generator-path R1, operator 2026-07-04: the ecosystem must EMIT geometry, not hand-craft). This is the
BRIDGE: the pioneer SDF (sdf_body/sdf_head) -- or a t2mesh/i2mesh-generated field -- becomes real emitted
verts+faces. Dual method (naive surface nets): (1) each grid CUBE straddling the 0-surface gets ONE vertex
at the mean of its edge zero-crossings; (2) each grid EDGE that crosses the surface emits a QUAD (2 tris)
linking the 4 cubes around it. Integer fx1024; deterministic. license_tier: ORIGINAL
dependencies 2 imports · 3 importers
imports: nx_syscalls.nxnx_sdfrender.nx
imported by: nx_meshgen_cell_audit_t337.nxnx_meshgen_domain_gate_t337.nxnx_meshgen_domain_locations_t337.nx
structs
| none |
consts
| 10 | const MG_N: i64 = 56 // grid resolution (cells per axis) |
| 11 | const MG_GR: i64 = 1500 // world half-range fx1024 (body fits [-1500,1500]) |
| 12 | const MG_MAXV: i64 = 200000 |
| 13 | const MG_MAXF: i64 = 400000 |
functions
| 15 | func mg_step() -> i64 { return 2 * MG_GR / MG_N } |
| 17 | func mg_fi(i: i64, j: i64, k: i64) -> i64 { return (i * (MG_N + 1) + j) * (MG_N + 1) + k } |
| 18 | func mg_ci(i: i64, j: i64, k: i64) -> i64 { return (i * MG_N + j) * MG_N + k } |
| 19 | func mg_wc(idx: i64) -> i64 { return 0 - MG_GR + idx * mg_step() } // grid idx -> world coord fx1024 calls 1: mg_step |
| 24 | func mg_sample_sdf_box(base: i64, F: *i64, origin: i64, step: i64) -> i64 |
| 43 | func mg_extract_box(F: *i64, cubevi: *i64, vbuf: *i64, fbuf: *i64, out: *i64, origin: i64, step: i64) -> i64 |
| 183 | func mg_build(base: i64, F: *i64, cubevi: *i64, vbuf: *i64, fbuf: *i64, out: *i64) -> i64 |
| 190 | func mg_sample_sdf(base:i64,F:*i64)->i64{return mg_sample_sdf_box(base,F,0-MG_GR,mg_step())} |
| 191 | func mg_extract(F:*i64,cubevi:*i64,vbuf:*i64,fbuf:*i64,out:*i64)->i64{return mg_extract_box(F,cubevi,vbuf,fbuf,out,0-MG_GR,mg_step())} |