code wiki / (root) / nx_step_nurbs.nx

nx_step_nurbs.nx

buildroot/runtime/nx_step_nurbs.nx

10726 B279 linesdepth 5pulls 7 transitivereach 11 importersview sourcekind librarytopic step
docsdependenciesstructsconstsfunctions

about

nx_step_nurbs.nx -- RATIONAL B-SPLINE SURFACE evaluation from STEP (cadtwin P3a: the ROUND parts, exact). OpenCascade exports cylinders/holes as complex-instance rational B-spline surfaces, degree (1,3): linear along the axis x rational-CUBIC around -- weights (1,1/3,1/3,1) = an EXACT circle arc (NURBS circle). This organ parses the complex instance (control net 2x4 + weights) and evaluates the rational Bezier in fixed point: Bernstein Q12, weights Q20 (fx256 would corrupt 1/3 -> Q20 keeps radius error ~ppm), coords fx256 (1 unit = 3.90625 um). ENGINEERING-TWIN doctrine: dimensional truth first -- the gate measures roundness/radius/positions against the file's own declared values, in integer-exact teeth where the math is exact (t=0, 1/2, 1) and measured-um bounds where it rounds. Units: as1 declares SI_UNIT(.MILLI.,.METRE.) -> mm confirmed at runtime, never assumed. license_tier: ORIGINAL

dependencies 1 imports · 3 importers

nx_step_tess.nx nx_step_nurbs.nx nx_step_nurbs_gate.nx nx_step_tess2.nx nx_step_write.nx

imports: nx_step_tess.nx

imported by: nx_step_nurbs_gate.nxnx_step_tess2.nxnx_step_write.nx

structs

none

consts

11const SN_MAGIC_1000000000000: i64 = 1000000000000
13const SN_Q12: i64 = 4096
14const SN_QW: i64 = 1048576

functions

17func sgn_find(buf: *u8, off: i64, len: i64, pat: *u8) -> i64
35func sgn_int(buf: *u8, p: i64, e: i64, out: *i64) -> i64
47func sgn_realq(buf: *u8, p: i64, e: i64, q: i64, out: *i64) -> i64
88func sgn_rdiv(num: i64, den: i64) -> i64
93func sgn_bern(t: i64, b: *i64) -> i64
called by 2: sgn_evalsgr_eval
107func sgn_parse_surface(nt: *i64, sidx: i64) -> i64
158func sgn_eval(nt: *i64, row: i64, t: i64, out3: *i64) -> i64
called by 2: sgn_tess_facemain calls 2: sgn_bernsgn_rdiv
186func sgn_tess_face(nt: *i64, sidx: i64) -> i64
237func sgn_tessellate_all(nt: *i64) -> i64
261func sgn_unit_mm(st: *i64) -> i64
called by 3: mainmainmain calls 1: sgn_find