topology.trimming_tools green
- Layer
- 41
- Upstream lines
- 2,885
- Functions
- 49
- Rust module
topology::trimming_tools
Status history
- todo 2,878 lines
- partial 2,878 lines
- green 2,878 lines
Source: crates/solidcore/src/topology/trimming_tools.rs
Upstream: source/SMLib/inc/SmTrimmingTools.h, source/SMLib/src/SmTrimmingTools.cpp
Port-plan notes
These notes preserve historical port measurements and limitations, not current CI results.
GREEN: difftest 3303 cases, 3303 pass, 0 deferred, 0 failed. Rust B-reps: the B-rep ops build wire, face and network sources with own_builder::build_as and read .smb files with own_builder::read_with, so no C++ export reaches the Rust side. Two CheckLoop fixes, always on since #16998 retired their flags (#14246): (1) #476 (PR #691 by fkirill): a shared vertex zone tolerance widens the gap limit (WR-381); (2) PR #709 by fkirill: WR-440 periodic-seam lift of projected loop ends. The trimming goldens rows they move are listed in their flag-removed addenda. Prior validation/history: GREEN: difftest 3263 cases, 3263 pass, 0 deferred, 0 failed, max_rel_err 0. face_has_seam_problem wired to topology::face::p4::has_seam_problem_in_brep using HealLoopHandle; C++ shim OP_B_DEFERRED kind 0 lifts TT_NOT_RUN to SmTrimmingTools::SplitAtSeams. Earlier notes: PARTIAL: difftest 3263 cases (2063 fixture: upstream.json re-expresses SM_API_test TestSmOrderCurves, TestSmCreatePlanarFaces, TestSmCreatePlanarCircle; edge_cases.json: empty/open/off-plane/degenerate loops, tolerance-limit gaps, 1e-6..1e6 scales, nested and side-by-side loops, zero-area loops (UB-119), iso/mirror tolerance limits, curve-loop scripts; seams.json; rv_ellipse.json: review cases, SmEllipse (inside-out, tiny radii) and SmLine UV curves in MirrorCurve / IsIsoCurve / IsIsoCurveOnSeam; breps.json: AreUVCurvesPresent, GetEdgeUVExtremes, CheckLoop, CheckFace, FixTrimLoopTinyParameterSpaceGaps, EnsureLastEdgeuseUVCorrect, FixBackwardsOuterLoopOnSeam (with a MirrorCurve pre-step making seam jumps), FixTrimLoopOrientation/Order on the 15 topology.vertexuse .smb files; 1200 generated over real SmBSplineCurve/SmLine/SmEllipse/circle arcs and SmBSplineSurface (open, closed in u or v, pinched, C0, rational)/SmPlane/SmCurveBoundedSurface), 2842 pass bit-identical, 421 deferred (topology.face_p3 318: SmFace::ComputeLoopOrientation, CreateUVTrimCurves; topology.face_p2 87; intersect.surface_drop_lib_p3 7: SmSurface::DropCurve in GetOrCreateUVTrimCurve (topology.edgeuse_p3 wired in PR #117: it no longer defers, FixTrimLoopOrder's call takes the kernel); topology.face_p4 9: GetEdges, HasSeamProblem), max_rel_err 0; --perturb SENSITIVE (2842/2842). After merging main (PR #52 surface.surface_p3) the 265 CheckLoop cases that deferred at GetSingularities pass bit-identical. UV trim curves that are SmEllipse/SmHyperbola/SmParabola run the inherited SmBSplineCurve GetCanonical/SetCanonical/EditEndPoint (review fix). B-rep ops normalise analytic geometry to B-spline copies as heal.gap. Back-edges wired: SmSurface::CreatePlaneWith3DCurves (surface.surface_p2) now calls OrderCurvesIntoLoops/FindOuterLoops (takes the Kernel). Upstream issues WR-96, WR-97, WR-98 (ported as is), UB-119, UB-120. Plan notes: 49 fns; largest: SmTrimmingTools::OrderCurvesIntoLoops, SmTrimmingTools::FindOuterLoops, SmTrimmingTools::CheckLoop, SmTrimmingTools::CheckFace; cycle back-edges (call into later units; stub or co-port): topology.face_p3(4), topology.edge(2), topology.face_p1(2), topology.face_p4(2), topology.brep_p2(1), topology.brep_p7(1); unit-SCC #22 (220 units); 168 upstream test entry points reach this unit [topology.face_p3 wired (PR #139, CreateUVTrimCurves, ComputeLoopOrientation): 3263 cases, 2842 pass, 0 failed, 421 deferred (topology.face_p2 392, intersect.surface_drop_lib_p3 17, topology.face_p4 12); the 318 topology.face_p3 deferrals now defer inside them] PR #183: trim_surface_with_model_space_curves takes a NotifyEnv for topology.brep_p7's MakeFaceWithCurves, which now calls topology.brep_p9's MakeShellVertex. topology.face_p4 (PR #239): with face_p3 and the face_p4 getters wired, CreateUVTrimCurves runs in Rust, so the shim now runs it too and both sides compare its status and every edge use's UV trim curve: 3263 cases, 2850 pass, 0 failed, 413 deferred (was 2842/421). UPDATE (PR #204, topology.brep_p3): trim_surface_with_model_space_curves (and its private make_face_with_curves) take &mut Kernel, as topology::brep::p7::make_face_with_curves now does (its wire edges are topology.brep_p3's Owner zone-tol cache (surface/owner-zone-tol): 3263 cases, 3259 pass, 0 fail, 4 deferred. Shim runs CheckFace/FixTrimLoopOrientation/FixTrimLoopOrder (stale TT_NOT_RUN lifted).
Goldens
This is committed inventory, not a runtime result or a correctness proof. A golden records what solidcore produced when blessed. Current results require the canonical CI gate, not these counts.
- Golden records
- 3,305
- Stored error outcomes
- 9
- Stored deferrals
- 0
- Stored harness rejections
- 0
- Known-failure entries
- 0
Metadata counts describe fields in the stored records; they are not passes or live failures.
Source at f9704ee3b:
golden JSONL ·
known-failure list.
Dependencies
Depends on: curve.curve_p2 green geom.assert_array green geom.extent1d green geom.extent2d green geom.extent3d green geom.object green geom.point_set green geom.solution_array green geom.tol green geom.vector2d green geom.vector3d green nurbs.b_spline_curve_p1 green nurbs.b_spline_curve_p2 green topology.edgeuse_p1 green topology.face_p2 partial topology.loopuse green
Soft dependencies: curve.curve_p1 green curve.curve_p4 green curve.curve_p6 green curve.curve_p9 green geom.context green geom.tools green intersect.curve_class_p1 green nurbs.b_spline_curve_n_lib green nurbs.b_spline_surface_p1 green nurbs.b_spline_surface_p2 green surface.surface_p2 partial surface.surface_p4 green surface.surface_p5 green surface.surface_p6 green surface.surface_p7 green topology.brep_p8 green topology.proto_topology_p1 green topology.shell green topology.vertexuse green
Dependents: primitive.api_curve_ops green primitive.api_trim_ops partial topology.brep_validation green
Soft dependents: blend.fillet_geom_p4 partial topology.brep_p3 partial topology.face_p1 green
Upstream functions
| Upstream function | Defined at | Lines | Rust (from the file header) |
|---|---|---|---|
SmCurveIntersections::SmCurveIntersections | SmTrimmingTools.h:46 | 9 | |
SmIsoXSectSegment::SmIsoXSectSegment | SmTrimmingTools.h:79 | 1 | |
SmIsoXSectSegment::~SmIsoXSectSegment | SmTrimmingTools.h:82 | 1 | |
SmIsoXSectSegment::GetMinIndex | SmTrimmingTools.h:85 | 4 | |
SmIsoXSectSegment::GetMaxIndex | SmTrimmingTools.h:90 | 4 | |
SmCurveLoops::SmCurveLoops | SmTrimmingTools.h:125 | 1 | |
SmCurveLoops::~SmCurveLoops | SmTrimmingTools.h:134 | 1 | |
SmCurveLoops::IsValid | SmTrimmingTools.h:140 | 1 | |
SmCurveLoops::GetNumLoops | SmTrimmingTools.h:141 | 1 | |
SmTrimmingTools::GetClassType | SmTrimmingTools.h:531 | 1 | [TYPE], [class_type] |
SmTrimmingTools::TrimSurfaceWithModelSpaceCurves | SmTrimmingTools.cpp:87 | 185 | [trim_surface_with_model_space_curves], [TrimInput] |
SmTrimmingTools::AreUVCurvesPresent | SmTrimmingTools.cpp:535 | 22 | [loop_uv_curves_present], [face_uv_curves_present] |
SmTrimmingTools::AreUVCurvesPresent | SmTrimmingTools.cpp:563 | 14 | [loop_uv_curves_present], [face_uv_curves_present] |
SmTrimmingTools::CreateUVTrimCurves | SmTrimmingTools.cpp:612 | 21 | [create_uv_trim_curves] |
SmTrimmingTools::ClearUVTrimCurves | SmTrimmingTools.cpp:656 | 17 | [clear_uv_trim_curves] |
SmTrimmingTools::SplitAtSeams | SmTrimmingTools.cpp:784 | 42 | [split_at_seams] |
SmTrimmingTools::FixTrimLoopTinyParameterSpaceGaps | SmTrimmingTools.cpp:1215 | 87 | [fix_loop_tiny_parameter_space_gaps], [fix_face_tiny_parameter_space_gaps] |
SmTrimmingTools::FixTrimLoopTinyParameterSpaceGaps | SmTrimmingTools.cpp:1308 | 20 | [fix_loop_tiny_parameter_space_gaps], [fix_face_tiny_parameter_space_gaps] |
SmTrimmingTools::EnsureLastEdgeuseUVCorrect | SmTrimmingTools.cpp:1334 | 49 | [ensure_last_edgeuse_uv_correct] |
SmTrimmingTools::FixBackwardsOuterLoopOnSeam | SmTrimmingTools.cpp:1390 | 103 | [fix_backwards_outer_loop_on_seam] |
SmTrimmingTools::FixTrimLoopOrientation | SmTrimmingTools.cpp:1499 | 29 | [fix_loop_orientation], [fix_face_loop_orientations] |
SmTrimmingTools::FixTrimLoopOrientation | SmTrimmingTools.cpp:1535 | 18 | [fix_loop_orientation], [fix_face_loop_orientations] |
SmTrimmingTools::FixTrimLoopOrder | SmTrimmingTools.cpp:1564 | 125 | [fix_trim_loop_order] |
SmTrimmingTools::OrderCurvesIntoLoops | SmTrimmingTools.cpp:1739 | 360 | [order_curves_into_loops], [OrderedLoops] |
SmTrimmingTools::FindOuterLoops | SmTrimmingTools.cpp:2149 | 312 | [find_outer_loops] |
SmTrimmingTools::CheckFace | SmTrimmingTools.cpp:2709 | 209 | [check_face], [check_faces] |
SmTrimmingTools::CheckFaces | SmTrimmingTools.cpp:2924 | 21 | [check_face], [check_faces] |
sm_IsLoopUVGapWithinTolerance | SmTrimmingTools.cpp:2953 | 92 | [is_loop_uv_gap_within_tolerance] |
SmTrimmingTools::CheckLoop | SmTrimmingTools.cpp:3076 | 234 | [check_loop] |
SmTrimmingTools::GetEdgeUVExtremes | SmTrimmingTools.cpp:3323 | 116 | [edge_uv_extremes], [EdgeUvExtremes], [edge_uv_ends] |
SmTrimmingTools::GetEdgeUVExtremes | SmTrimmingTools.cpp:3445 | 9 | [edge_uv_extremes], [EdgeUvExtremes], [edge_uv_ends] |
SmTrimmingTools::SurfaceContinuityCheck | SmTrimmingTools.cpp:3460 | 30 | [surface_continuity_check] |
SmTrimmingTools::MirrorCurve | SmTrimmingTools.cpp:3496 | 42 | [mirror_curve] |
SmTrimmingTools::IsIsoCurve | SmTrimmingTools.cpp:3625 | 29 | [is_iso_curve_at] |
SmTrimmingTools::IsIsoCurve | SmTrimmingTools.cpp:3660 | 25 | [is_iso_curve_at] |
SmTrimmingTools::IsIsoCurveOnSeam | SmTrimmingTools.cpp:3691 | 19 | [is_iso_curve_on_seam] |
SmTrimmingTools::Min | SmTrimmingTools.cpp:3919 | 8 | [min] |
SmCurveLoops::SmCurveLoops | SmTrimmingTools.cpp:4030 | 32 | |
SmCurveLoops::Reset | SmTrimmingTools.cpp:4068 | 11 | |
SmCurveLoops::GetLoopStartIndex | SmTrimmingTools.cpp:4085 | 20 | |
SmCurveLoops::GetLoopStartEnd | SmTrimmingTools.cpp:4111 | 30 | |
SmCurveLoops::FindAdjacentLoopCurve | SmTrimmingTools.cpp:4147 | 30 | |
SmCurveLoops::FindEnteringAndLeaving | SmTrimmingTools.cpp:4186 | 77 | |
SmCurveLoops::SampleNearbyPoints | SmTrimmingTools.cpp:4269 | 59 | |
SmCurveLoops::IsSameSideIntersection | SmTrimmingTools.cpp:4335 | 66 | |
SmCurveLoops::AppendLoop | SmTrimmingTools.cpp:4407 | 33 | |
SmCurveLoops::InsertIntoLoops | SmTrimmingTools.cpp:4447 | 37 | |
SmCurveLoops::InsertIsoXSectSegment | SmTrimmingTools.cpp:4491 | 178 | |
SmCurveLoops::UpdateSolutionObjects | SmTrimmingTools.cpp:4676 | 50 |
Module file-header table (24 rows)
| Rust | Upstream |
|---|---|
[TYPE], [class_type] | SmTrimmingTools_TYPE, SmTrimmingTools::GetClassType |
[trim_surface_with_model_space_curves], [TrimInput] | SmTrimmingTools::TrimSurfaceWithModelSpaceCurves (region overload) |
[loop_uv_curves_present], [face_uv_curves_present] | SmTrimmingTools::AreUVCurvesPresent (loop, face) |
[create_uv_trim_curves] | SmTrimmingTools::CreateUVTrimCurves (face) |
[clear_uv_trim_curves] | SmTrimmingTools::ClearUVTrimCurves (face) |
[split_at_seams] | SmTrimmingTools::SplitAtSeams (face) |
[fix_loop_tiny_parameter_space_gaps], [fix_face_tiny_parameter_space_gaps] | SmTrimmingTools::FixTrimLoopTinyParameterSpaceGaps (loop, face) |
[ensure_last_edgeuse_uv_correct] | SmTrimmingTools::EnsureLastEdgeuseUVCorrect |
[fix_backwards_outer_loop_on_seam] | SmTrimmingTools::FixBackwardsOuterLoopOnSeam |
[fix_loop_orientation], [fix_face_loop_orientations] | SmTrimmingTools::FixTrimLoopOrientation (loop, face) |
[fix_trim_loop_order] | SmTrimmingTools::FixTrimLoopOrder |
[order_curves_into_loops], [OrderedLoops] | SmTrimmingTools::OrderCurvesIntoLoops |
next_round_the_vertex (private) | fork-only sm_NextRoundTheVertex (WR-591) |
[find_outer_loops] | SmTrimmingTools::FindOuterLoops |
[check_face], [check_faces] | SmTrimmingTools::CheckFace, CheckFaces |
[is_loop_uv_gap_within_tolerance] | sm_IsLoopUVGapWithinTolerance (static) |
[check_loop] | SmTrimmingTools::CheckLoop |
[edge_uv_extremes], [EdgeUvExtremes], [edge_uv_ends] | SmTrimmingTools::GetEdgeUVExtremes (with and without weights) |
[surface_continuity_check] | SmTrimmingTools::SurfaceContinuityCheck |
[mirror_curve] | SmTrimmingTools::MirrorCurve |
[is_iso_curve_at] | SmTrimmingTools::IsIsoCurve(curve, side, low, tol) |
[is_iso_curve] | SmTrimmingTools::IsIsoCurve(curve, &side, ¶m) |
[is_iso_curve_on_seam] | SmTrimmingTools::IsIsoCurveOnSeam |
[min] | SmTrimmingTools::Min |
Upstream tests reaching this unit
SM_API_test:TestSmOrderCurves, SM_API_test:TestSmCurves, SM_API_test:TestSmCreatePlanarCircle, SM_API_test:TestSmCreatePlanarFaces, prog_test:my_test_single_periodic_vertexuse, SM_API_test:TestSmPlanarFacesFailureCleanup