code wiki / (root) / nx_step_write.nx

nx_step_write.nx

buildroot/runtime/nx_step_write.nx

11263 B310 linesdepth 6pulls 8 transitivereach 5 importersview sourcekind librarytopic step
docsdependenciesstructsconstsfunctions

about

nx_step_write.nx -- STEP WRITE (cadtwin P3a write half, first rung): emit a valid ISO-10303-21 file from a twin mesh -- FACETED B-rep class (FACETED_BREP + CLOSED_SHELL + FACE/FACE_OUTER_BOUND/POLY_LOOP + shared CARTESIAN_POINTs) with the full product-identity chain (PRODUCT->PDF->PD->PDS->SDR) and DECLARED mm units + uncertainty (the anti-JPL doctrine: our files SAY their units). Coordinates are written as EXACT decimals: fx256 -> "N.XXXXXXXX" (1/256 = 0.00390625 -> 8 fractional digits, lossless) so a round-trip through our own reader is INTEGER-EXACT by construction. Includes the matching FACETED READ path (POLY_LOOP -> triangles) -- the interop pair in one organ. HONEST scope: faceted geometry write (the mesh-twin class); analytic/NURBS B-rep WRITE = the named residual for full parity. NOTE: '#' cannot appear in NishiLang string literals (scanner gotcha) -- every STEP ref emits byte 35 via swb_c. license_tier: ORIGINAL

dependencies 1 imports · 4 importers

nx_step_nurbs.nx nx_step_write.nx nx_explodelab_bomdims.nx nx_explodelab_meshgen.nx nx_step_brepw.nx nx_step_write_gate.nx

imports: nx_step_nurbs.nx

imported by: nx_explodelab_bomdims.nxnx_explodelab_meshgen.nxnx_step_brepw.nxnx_step_write_gate.nx

structs

none

consts

11const K_MAGIC_390625: i64 = 390625
12const K_MAGIC_10000000: i64 = 10000000
13const K_MAGIC_262144: i64 = 262144
14const K_MAGIC_32768: i64 = 32768
15const K_MAGIC_4000: i64 = 4000

functions

18func swb_init(b: *i64, cap: i64) -> i64
24func swb_c(b: *i64, ch: i64) -> i64
31func swb_s(b: *i64, s: *u8) -> i64
39func swb_n(b: *i64, v0: i64) -> i64
50func swb_fx(b: *i64, v0: i64) -> i64
called by 2: sw2_ptsw_write_mesh calls 2: swb_cswb_n
66func swb_ref(b: *i64, id: i64) -> i64
71func swb_ent(b: *i64, id: i64) -> i64
79func sw_write_mesh(mesh: i64, path: *u8, pname: *u8) -> i64
247func sw_read_faceted(st: *i64, mesh: i64) -> i64
291func sw_facet_tri(st: *i64, lidx: i64, mesh: i64, p3: *i64) -> i64