code wiki / (root) / nx_dcc_slice_watertight_gate.nx

nx_dcc_slice_watertight_gate.nx

buildroot/runtime/nx_dcc_slice_watertight_gate.nx

4932 B94 linesdepth 9pulls 15 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_dcc_slice_watertight_gate.nx -- REGRESSION GATE for the two slicer fixes that let DCC-authored slanted/curved geometry print: (1) canonical edge-intersection rounding in nx_slice_edge_at_z (shared edges compute the IDENTICAL crossing point regardless of traversal direction), (2) the BVH right-child-adjacency fix in nx_bvh_fill_subtree (every triangle is visited EXACTLY once -- no duplicate, no orphan). Both bugs manifested as non-closing contours on non-axis-aligned meshes. This gate asserts WATERTIGHT slicing (closed contours, exact segment counts) on a pyramid, octahedron, and icosphere -- the shapes that exposed the bugs. A 1-segment dup or a dropped face re-opens a contour and trips n_open. expect_exit: 0.

dependencies 7 imports · 0 importers

nx_syscalls.nx nx_mesh.nx nx_mesh_edit.nx nx_mesh_sculpt.nx nx_bvh.nx nx_slice_plane.nx nx_slice_contour.nx nx_dcc_slice_watertight_gate.n

imports: nx_syscalls.nxnx_mesh.nxnx_mesh_edit.nxnx_mesh_sculpt.nxnx_bvh.nxnx_slice_plane.nxnx_slice_contour.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap w sys_write nx_mesh_make_pyramid nx_mesh_alloc sys_mmap ↻ nx_mesh_set_vertex nx_mesh_set_triangle slice_stats nx_bvh_build nx_bvh_build_with_threshol sys_mmap ↻ nx_bvh_compute_tri_info nx_mesh_print_tri_v nx_mesh_get_vertex_x nx_mesh_get_vertex_y nx_mesh_get_vertex_z nx_bvh_tri_at nx_bvh_min3 nx_bvh_max3 nx_bvh_build_subtree nx_bvh_alloc_node nx_bvh_fill_subtree nx_bvh_node_at nx_bvh_range_aabb nx_bvh_longest_axis nx_bvh_partition_by_axis nx_bvh_alloc_node ↻ nx_bvh_fill_subtree ↻ nx_slice_plane nx_slice_soup_new sys_mmap ↻ nx_slice_walk_node nx_bvh_node_at ↻ nx_slice_one_tri nx_mesh_print_tri_v ↻ nx_mesh_get_vertex_x ↻ nx_mesh_get_vertex_y ↻ nx_mesh_get_vertex_z ↻

structs

none

consts

none

functions

20func w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: chkmain calls 1: sys_write
21func wn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
30func chk(cond: i64, pass: *i64, fail: *i64, label: *u8) -> i64
called by 1: main calls 1: w
35func eqi(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 }
called by 1: main
38func slice_stats(model: *NxMesh, plane_z: i64, out3: *i64) -> i64
48func main() -> i64