code wiki / (root) / nx_step_tess.nx

nx_step_tess.nx

buildroot/runtime/nx_step_tess.nx

14284 B349 linesdepth 4pulls 6 transitivereach 13 importersview sourcekind librarytopic step
docsdependenciesstructsconstsfunctions

about

nx_step_tess.nx -- PLANAR-FACE TESSELLATION from STEP B-rep (cadtwin P3a geometry half): turn the file's actual topology into real triangles. Walk ADVANCED_FACE -> bound -> EDGE_LOOP -> ORIENTED_EDGE (.T. start / .F. end vertex) -> EDGE_CURVE -> VERTEX_POINT -> CARTESIAN_POINT; project the loop onto the PLANE's 2D basis (origin/normal/refdir from AXIS2_PLACEMENT_3D); EAR-CLIP the polygon (integer 2D cross products -- correct for CONCAVE faces like the L-bracket, where a naive fan is wrong); emit triangles into mesh3. SELF-CHECK invariant: the signed ear areas must sum EXACTLY to the polygon shoelace area (same integer coords) -- any ear-clip bug shows as a mismatch count, not silent bad geometry. HONEST scope v1: single-bound planar faces; multi-bound (holes/rims), curved surfaces (cylinder/B-spline) counted+skipped; curved EDGES on planar faces become chords (counted). Composes nx_step_geom (STEP reals) + nx_mesh3. license_tier: ORIGINAL

dependencies 2 imports · 2 importers

nx_step_geom.nx nx_mesh3.nx nx_step_tess.nx nx_step_nurbs.nx nx_step_tess_gate.nx

imports: nx_step_geom.nxnx_mesh3.nx

imported by: nx_step_nurbs.nxnx_step_tess_gate.nx

structs

none

consts

none

functions

19func sgt_refs(buf: *u8, off: i64, len: i64, out: *i64, cap: i64) -> i64
39func sgt_arg_ref(st: *i64, idx: i64, k: i64, out2: *i64) -> i64
48func sgt_flag_T(st: *i64, idx: i64, k: i64, out2: *i64) -> i64
61func sgt_tuple_of(st: *i64, id: i64, out3: *i64) -> i64
68func sgt_face_plane(tt: *i64, idx: i64) -> i64
99func sgt_loop_verts(tt: *i64, loopid: i64) -> i64
150func sgt_project(tt: *i64, n: i64) -> i64
called by 2: sgt_facesgt2_face
169func sgt_shoelace(p2: *i64, n: i64) -> i64
called by 2: sgt_facesgt2_face
181func sgt_cross3(p2: *i64, a: i64, b: i64, c: i64) -> i64
189func sgt_inside(p2: *i64, tri3: *i64, p: i64) -> i64
called by 1: sgt_earclip calls 1: sgt_cross3
201func sgt_earclip(tt: *i64, n: i64, vbase: i64) -> i64
275func sgt_face(tt: *i64, idx: i64) -> i64
339func sgt_tessellate(tt: *i64) -> i64
called by 2: mainmain calls 2: sp_name_issgt_face