code wiki / (root) / nx_meshvalid_lib.nx

nx_meshvalid_lib.nx

buildroot/runtime/nx_meshvalid_lib.nx

15341 B367 linesdepth 2pulls 2 transitivereach 36 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_meshvalid_lib.nx -- THE MESH VALIDITY REFEREE: it REFUSES a broken asset instead of shipping it. /compare/dcc DC3, and it is the tooth the retopology and sculpt rungs both bind their claims to. WHY THIS AND NOT AN OVERLAY. Blender, ZBrush and Maya all SHOW mesh problems to an artist in a viewport overlay; none of them REFUSES on one, because a person is always there to look. An estate that emits assets from rules with no person in the loop needs the opposite: a named count, the offending element index, and a non-zero verdict. nx_spendgate found no incumbent -- nx_meshgen BUILDS watertight meshes by construction (surface nets) and nx_step_tess2 tessellates with hole bridging, but nothing in the estate VALIDATES a mesh it did not itself produce, which is exactly the case an importer creates. EVERY DEFECT IS ITS OWN NAMED CLASS, never a single boolean. A compound assertion that will not name its failing conjunct is a false-alarm generator: the reader always guesses the alarming one. Six classes, each with a count AND a first-offender index, and a manifold verdict composed from them. COMPLEXITY IS DECLARED, NOT DISCOVERED. Edge and vertex identity both go through an open-addressing hash table whose capacity is DERIVED from the input size (next power of two at or above four times the element count, a load factor at or below one quarter), so the check is linear in triangles rather than the quadratic pairwise scan the naive version would be. There is no fixed table size to outgrow and no cap to silently hit. All integer: the zero-area test is an exact cross product, never a float epsilon, so DEGENERATE here means exactly degenerate rather than nearly so. 100% sovereign. No hardware writes (Rule 26). license_tier: ORIGINAL

dependencies 1 imports · 4 importers

nx_syscalls.nx nx_meshvalid_lib.nx nx_body_skin_junction_gate_t345.nx nx_meshvalid_gate.nx nx_uvunwrap_gate.nx nx_uvunwrap_lib.nx

imports: nx_syscalls.nx

imported by: nx_body_skin_junction_gate_t345.nxnx_meshvalid_gate.nxnx_uvunwrap_gate.nxnx_uvunwrap_lib.nx

structs

none

consts

24const MV_H_NV: i64 = 0
25const MV_H_NT: i64 = 1
26const MV_H_ECAP: i64 = 2
27const MV_H_VCAP: i64 = 3
28const MV_H_ERR: i64 = 4
29const MV_H_RAN: i64 = 5
38const MV_HDR: i64 = 24
39const MV_I64: i64 = 8
42const MV_C_DEGEN: i64 = 6
43const MV_C_INDEX: i64 = 7
44const MV_C_NONMAN: i64 = 8
45const MV_C_BOUND: i64 = 9
46const MV_C_WIND: i64 = 10
47const MV_C_DUPV: i64 = 11
48const MV_FIRST_STRIDE: i64 = 8
50const MV_OK: i64 = 0
51const MV_E_INDEX: i64 = 0 - 1
52const MV_E_DEGEN: i64 = 0 - 2
53const MV_E_NONMAN: i64 = 0 - 3
54const MV_E_BOUND: i64 = 0 - 4
55const MV_E_WIND: i64 = 0 - 5
56const MV_E_DUPV: i64 = 0 - 6
57const MV_E_ARGS: i64 = 0 - 7
58const MV_E_NOTRUN: i64 = 0 - 8
63const MV_MUL_A: i64 = 1099511628211
64const MV_MUL_B: i64 = 2654435761
65const MV_LOAD_NUM: i64 = 4
68const MV_TREC: i64 = 4
69const MV_T_K0: i64 = 0
70const MV_T_K1: i64 = 1
71const MV_T_CNT: i64 = 2
72const MV_T_BAL: i64 = 3
73const MV_EMPTY: i64 = 0 - 999999999
81const MV_VCOMP: i64 = 3 // components per vertex: [x, y, z]
82const MV_VX: i64 = 0
83const MV_VY: i64 = 1
84const MV_VZ: i64 = 2
85const MV_TVERT: i64 = 3 // vertices per triangle: [a, b, c] -- and a triangle contributes exactly
87const MV_TA: i64 = 0
88const MV_TB: i64 = 1
89const MV_TC: i64 = 2
94const MV_BOUNDARY_FACES: i64 = 1
95const MV_MANIFOLD_FACES: i64 = 2
100const MV_VKEY_FOLD: i64 = 3

functions

102func mv_err_name(e: i64) -> *u8
called by 1: main
116func mv_cap_for(n: i64) -> i64
124func mv_verts_off(m: *i64) -> i64 { return MV_HDR }
125func mv_tris_off(m: *i64) -> i64 { return MV_HDR + m[MV_H_NV] * MV_VCOMP }
called by 2: mv_set_trimv_check
126func mv_etab_off(m: *i64) -> i64 { return MV_HDR + m[MV_H_NV] * MV_VCOMP + m[MV_H_NT] * MV_TVERT }
127func mv_vtab_off(m: *i64) -> i64 { return mv_etab_off(m) + m[MV_H_ECAP] * MV_TREC }
called by 1: mv_vert_touch calls 1: mv_etab_off
129func mv_words_for(nv: i64, nt: i64, ecap: i64, vcap: i64) -> i64
called by 1: mv_new
133func mv_new(nv: i64, nt: i64) -> *i64
148func mv_set_vert(m: *i64, i: i64, x: i64, y: i64, z: i64) -> i64
158func mv_set_tri(m: *i64, i: i64, a: i64, b: i64, c: i64) -> i64
168func mv_count(m: *i64, slot: i64) -> i64
175func mv_first(m: *i64, slot: i64) -> i64
called by 1: main
182func mv_bump(m: *i64, slot: i64, idx: i64) -> i64
called by 1: mv_check
188func mv_mix(a: i64, b: i64, cap: i64) -> i64
197func mv_edge_touch(m: *i64, a: i64, b: i64, dir: i64) -> i64
called by 1: mv_check calls 2: mv_etab_offmv_mix
229func mv_vert_touch(m: *i64, i: i64) -> i64
261func mv_is_degenerate(m: *i64, a: i64, b: i64, c: i64) -> i64
called by 1: mv_check calls 1: mv_verts_off
283func mv_check(m: *i64) -> i64
361func mv_manifold(m: *i64) -> i64
called by 2: mainuvi_validate
367func mv_verdict(m: *i64) -> i64 { return m[MV_H_ERR] }
called by 1: main