mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-22 00:20:58 +00:00
916b91e8d0
solidcore's main at c0d3cc0124, rewritten to one commit per same-author run per PR (2,800 commits, author credit kept; tree identical). Full original history: tangency-labs/solidcore archive/full-history. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> git-subtree-dir: solidcore git-subtree-mainline:44525da669git-subtree-split:c440e5f892
1.6 KiB
Vendored
1.6 KiB
Vendored
nlib.srf_common (NL_SrfCommon.cpp)
No Rust-vs-C++ disagreement: 1550 of 1550 difftest cases bit-identical (50 fixtures from
TestSmCreateSurfaceFromCornerPoints, TestSmCreateExtrude, TestSmCreateRuledSurface,
TestSmCreateSurfaceRevolution, my_test_surf_methods and the .smc curves in
pt_TestFiles, plus 1500 generated). No UNPORTED(nlib.srf_common) stubs existed.
Upstream behaviour worth knowing:
N_CreateRevolvedSrfstores the circle weights fromN_CalcCircWeightsin a localNL_REAL wi[9]. A quartic (NL_QUARTIC) revolution of 241 degrees or more has 13 weights and overflows the stack buffer (undefined behaviour). Upstream callers only passNL_QUADRATICor a caller-chosenrtp(NL_SrfFit.cpp:13242,:13828). The port keeps all the weights; the ffi wrapper rejects those inputs so difftest never runs the overflow.- The routines change their input curves in place:
N_CreateSrfExtrudeCrvmakes a 2D curve 3D (after thedircheck, before the direction is normalised, so a zero direction still converts the curve),N_CreateRuledSrfmakes both curves compatible (and keeps the changes made before a failure),N_CreateRevolvedSrfmakes the profile rational and 3D. The port takes&mut Curve; difftest compares the curves after the call. N_CreateCylConereads the indices and knots of the top circle when there is one, else of the bottom circle; a collapsed circle (radius at mostNL_MTOL) becomes its centre weighted by the other circle's weights.N_CreateRuledSrftakesnfrom curve B andp,m,Ufrom curve A (equal afterN_CrvsMakeCompatible).