code wiki / (root) / nx_uvunwrap_gate.nx

nx_uvunwrap_gate.nx

buildroot/runtime/nx_uvunwrap_gate.nx

32240 B510 linesdepth 4pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_uvunwrap_gate.nx -- the gate for nx_uvunwrap_lib (/compare/dcc DC5). THE HAZARD THIS GATE IS SHAPED AGAINST. A parameteriser is unusually easy to fake, because the two obvious ways to fail both score well on the obvious metrics: * MAP EVERY VERTEX TO ONE POINT and every triangle is a perfect similarity of nothing. Angle and area distortion computed over non-degenerate triangles are zero because there are no non-degenerate triangles left to average. The tooth that kills it is chart AREA, and it is planted and bitten here. * FOLD THE CHART OVER ITSELF and the per-triangle metrics stay small while the atlas is unusable. The tooth that kills that one is the flipped-triangle count, and the unseamed cylinder below is a real mesh that actually produces it rather than a synthetic case. So the load-bearing structure is: a POSITIVE CONTROL that must come back at essentially zero, a DISCRIMINATION pair that must come back different, and a planted defect for every refusal class. WHY A DEVELOPABLE SURFACE IS THE RIGHT POSITIVE CONTROL, AND WHY THIS IS A HARD CLAIM RATHER THAN A SOFT ONE. A surface with zero Gaussian curvature is EXACTLY parameterisable -- an isometry into the plane exists, so the true minimum of the conformal energy is zero and any distortion measured on one is a bug in the solver, not a property of the input. Three of the fixtures below are developable for three different reasons (a plane, six planes cut apart, a piecewise-flat prism wall with no interior vertex) and all three must read at or under the tolerance. WHY THE CURVED FIXTURE IS A PYRAMID AND NOT THE CYLINDER THE BRIEF SUGGESTED. A cylinder WALL is developable -- it unrolls with no distortion at all -- so a cylinder reading non-zero would be reporting its own TOPOLOGY (an uncut annulus cannot embed in the plane) rather than curvature, and reading that as a curvature measurement would be measuring a different subject than the one being named. The pyramid's apex is a genuine cone point: four faces meet there with a total angle of 282 degrees against the 360 a plane would need, a deficit of 78 degrees that no cutting can remove. It CANNOT be flattened, so its distortion must be non-zero, and this gate prints the number rather than asserting a bound it invented. The cylinder still appears -- in both states -- because it is the only fixture that proves a seam does anything: the same 16 triangles refuse as a fold uncut, and unwrap cleanly with one edge cut. COMPOSES nx_meshvalid_lib rather than carrying a second validity checker, per the brief and per the duplicate-ruler law. 100% sovereign. No hardware writes (Rule 26). license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_meshvalid_lib.nx nx_uvunwrap_lib.nx nx_uvunwrap_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_meshvalid_lib.nxnx_uvunwrap_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_ctr sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_head gv_puts sys_write ↻ ug_quad uv_new sys_mmap ↻ mv_cap_for uv_layout uv_set_vert uv_set_tri gv_check gv_puts ↻ ug_ne ug_eq uv_verdict uv_conformal uvi_solve_chart sys_mmap ↻ uv_pins_for uvi_chart_classes uvi_d2 uv_vx uv_vy

structs

none

consts

40const UG_S: i64 = 1000 // flat quad side
41const UG_CS: i64 = 400 // cube side
42const UG_PA: i64 = 100 // pyramid base half-width
43const UG_PH: i64 = 100 // pyramid height
44const UG_R1: i64 = 100 // octagon short radius component
45const UG_R2: i64 = 241 // octagon long radius component, round(100 * (1 + sqrt(2)))
46const UG_CH: i64 = 200 // cylinder height
47const UG_NSEG: i64 = 8 // cylinder segments
48const UG_QUAD_VERTS: i64 = 4 // the flat quad's four corners
49const UG_QUAD_TRIS: i64 = 2 // and the two triangles they split into
50const UG_PYR_VERTS: i64 = 5 // the pyramid's apex plus its four base corners
51const UG_PYR_TRIS: i64 = 4 // and its four side faces
52const UG_CUBE_FACES: i64 = 6
53const UG_CUBE_TRIS_PER_FACE: i64 = 2
54const UG_CUBE_CORNERS_PER_FACE: i64 = 4
65const UG_FLAT_TOL_PERMIL: i64 = 5
68const UG_CURVED_FLOOR: i64 = 50

functions

70func ug_eq(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 }
called by 1: main
71func ug_ne(a: i64, b: i64) -> i64 { if a != b { return 1 } return 0 }
called by 1: main
72func ug_gt(a: i64, b: i64) -> i64 { if a > b { return 1 } return 0 }
called by 1: main
73func ug_le(a: i64, b: i64) -> i64 { if a <= b { return 1 } return 0 }
called by 1: main
74func ug_pn(label: *u8, v: i64) -> i64 { gv_puts(label); gv_num(v); gv_puts("\n" as *u8); return 0 }
called by 1: main calls 2: gv_putsgv_num
81func ug_class_collisions(m: *i64, nt: i64) -> i64
called by 1: main calls 1: uv_corner_class
101func ug_quad() -> *i64
called by 1: main calls 3: uv_newuv_set_vertuv_set_tri
116func ug_cube(seams: i64) -> *i64
159func ug_pyramid() -> *i64
called by 1: main calls 3: uv_newuv_set_vertuv_set_tri
174func ug_oct_x(i: i64) -> i64
called by 1: ug_cyl
184func ug_oct_y(i: i64) -> i64
called by 1: ug_cyl
200func ug_cyl(seam: i64) -> *i64
223func ug_nonmanifold() -> *i64
called by 1: main calls 3: uv_newuv_set_vertuv_set_tri
237func main(argc: i64, argv: *i64) -> i64