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
4.3 KiB
Vendored
4.3 KiB
Vendored
surface.surface_p8
GlobalPointSolve_0wired (review of PR #118).Surface::global_point_solve_0takes the kernel and the surface's handle (surface: O, asGlobalLineIntersectdoes), builds the cache and runsSpGlobalSolverwithlocal_solve_branch;Surface::global_point_solvegainedsurface: Option<O>(Nonefor callers without a handle, which then cannot maximize) and the out-parameter formglobal_point_solve_into.SpGlobalSolver::may_contain_answersreads the cache through the solver'ssurface_cache(nosm_IsNodeValidgap left).- Statics only Rust-tested.
extract_iso_curve(sm_ExtractIsoCurve) andintersect_srf_bndry_crv(sm_IntersectSrfBndryCrv) are file-local statics ofSmSurface.cppthat cannot be linked; they are covered by Rust unit tests and will be exercised throughLiftCurve/ the surface intersector (surface.surface_p11,intersect.surface_intersector_*). - Blend rails that are
SmLine(disagreement, not fixed).CreateBlendSurface(.., line rail, ..): C++ differs from the port from the second cross section on (e.g. line(1.595, 1.519, -0.110)to(-1.564, -0.859, -1.738), interval[0, 4.276], B-spline rail on[0, 1], plane and surface of revolution: C++ point(-1.78, -1.02, -1.85)at u = 0.25, Rust(0.81, 0.92, -0.52)). The same line as a B-spline gives identical results. Suspected cause:SmLine::GetNaturalIntervalreturns the analytic domain untilSyncronizeKnotsOfCurvescreates the NURB (SmLine.cpp:796), so the rail intervals used to remap the intersection parameters differ; the port's line rail is its base B-spline. The FFI guard rejects line rails for the blend op and the generator avoids them;Curve/Lineops with line curves compare fine. - Plane line-intersect fallback (review of PR #118, fixed).
SmPlane::GlobalLineIntersectfor a line in the plane whose clipped ends have the same line parameter (SM_ARE_SAME(tStart, tEnd): a tiny domain or a huge line vector) callsSmSurface::GlobalLineIntersecton the plane. Probe: plane o=0, n=z,op=line,dom=[0,0,1e-9,1e-9], p=0, v=(1e6,1e6,0), tol=1e-6: the second solution's value was C++7.071067811865476e-10, Rust6.585445079827193e-10(andt-5.0e-16against-4.657e-16; withdom=1e-10the solution counts differed, 28 against 41 values). Cause: the leaf solve's boundary solves buildSmIsoCurve(*pSrfEval, ..)over the plane (SmSurface.cpp:18568,:18696), andSmIsoCurve::Evaluatecalls the surface's virtualEvaluate, i.e.SmPlane's analytic one;surface::surface::p9::implicit_isobuilt it over the plane's NURB, whose bilinear interpolation over the +-1234567 analytic domain rounds at the ulp of 1e6 (the closest point of the line to a domain corner moved by 2^-31). A flat B-spline of the same size agreed because C++ evaluates it through the NURB too.implicit_isonow builds the iso curve over the plane itself (IsoCurve::from_surface). Coverage:fixtures/surface.surface_p8/plane_line_fallback.json(54 cases: tiny domains 1e-10..2e-6, line vectors along an axis, diagonal and anti-diagonal, with and without interval and ray, tilted plane); all agree. The remainingSmIsoCurvegap over a plane insurface::surface::p5/p6(iso_curve_of,boundary_iso_curve, see surface.surface_p5 above) is unchanged. - Cache cost at tiny scale (HANG-15): generated surfaces start at scale
1e-3. The case that seemed to hang (GlobalCurveIntersect, 5 x 6 net of scale1e-4, sliver domain) is not an infinite loop:SubdivideToTolerancesstops only at the minimum side ratio, which absolute tolerances make unreachable for such a net; the C++ takes 15 s, the port 121 s. The bound is the cache's existing subdivision limit (MAX_SUBDIVISION_DEPTH). CreateBlendSurfaceheap corruption (UB-157): seeplan/upstream-issues.md; the shim probes it and the port returnsInvalidInput.- Unwired by this unit:
SmSurface::DropCurve(intersect.surface_drop_lib_p3).smsurf_CheckShapeMatch(surface.surface_p3, merged) and the stalesurface.surface_p6stubs insurface::surface::p10(LocalCurveIntersect,ClassifyIntersectingRangeSolution) are wired. The 373 deferred cases left all namesurface.surface_point_solve_p3(GlobalPointSolve_1,LocalPointSolve_1).topology::loopusestill has its ownUNPORTED(surface.surface_p5)DropPoint stub (not this unit's code).