nx_csg.nx
buildroot/runtime/nx_csg.nx
about
nx_csg.nx -- CSG solid -> watertight mesh via marching tetrahedra over an SDF.
Samples a two-primitive boolean field (nx_sdf) on a grid, splits every cube into
6 tetrahedra (Kuhn subdivision along the 0-7 diagonal -> shared faces split
identically, no cracks), and emits the zero-isosurface. Edge crossings are
computed in a CANONICAL endpoint order so a grid edge shared by two tets yields
the IDENTICAL point (watertight, the same fix the slicer needed). Triangle
winding is forced outward via an inside-reference test. Output is a pipeline-
native Q14-mm NxMesh -> flows to nx_stl_write_mesh -> slicer, like every other
solid. Robust by construction: SDF booleans never fail the way B-rep does.
license_tier: ORIGINAL
dependencies 3 imports · 12 importers
diagram shows first 10 each side; +0 more imports, +2 more importers in the complete lists below.
imports: nx_syscalls.nxnx_mesh.nxnx_sdf.nx
imported by: nx_cad_exceed.nxnx_cad_page.nxnx_cad_prims2_test.nxnx_csg_fillet_test.nxnx_csg_scene.nxnx_csg_scene_gate.nxnx_csg_test.nxnx_csg_torus_test.nxnx_vessel_csg.nxnx_vessel_csg_test.nxnx_vessel_emit.nxnx_vessel_gcode.nx
structs
| none |
consts
| none |
functions
| 19 | func mt_cross(out: *i64, P: *i64, i: i64, j: i64, D: *i64) -> i64 called by 1: mt_tet |
| 40 | func mt_emit(tribuf: *i64, ntri: *i64, cap: i64, p0: *i64, p1: *i64, p2: *i64, called by 1: mt_tet |
| 67 | func mt_tet(tribuf: *i64, ntri: *i64, cap: i64, P: *i64, D: *i64, |
| 107 | func nx_csg_extract(a: *NxSdfPrim, b: *NxSdfPrim, op: i64, |
| 209 | func nx_csg_box_minus_cyl(hx: i64, hy: i64, hz: i64, r: i64, res: i64) -> *NxMesh |
| 220 | func nx_csg_roundbox_mesh(H: i64, r: i64, res: i64) -> *NxMesh |
| 228 | func nx_csg_torus_mesh(R: i64, r: i64, res: i64) -> *NxMesh |
| 238 | func nx_csg_two_sphere_fillet(r: i64, sep: i64, k: i64, res: i64) -> *NxMesh |