-
Notifications
You must be signed in to change notification settings - Fork 511
Modeling - Infinite loop when Simplifying Fuse operation, CPU to 100% #557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…de-SAS#544 Minor refactoring of RelocatePCurvesToNewUorigin(). RelocatePCurvesToNewUorigin() can no longer stuck in infinite loop if it found the edge that is not present in theVEmap. Test bug_gh544 is added to check the fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the function RelocatePCurvesToNewUorigin() to prevent an infinite loop when the edge is missing from the vertex‐to‐edge map, and it adds a test to verify the fix.
- Updated RemoveEdgeFromMap() with improved documentation and iteration style.
- Introduced getCurveParams() to consolidate curve parameter extraction based on edge orientation.
- Refactored RelocatePCurvesToNewUorigin() to use clearer variable names and break conditions to avoid infinite loops.
Files not reviewed (1)
- tests/bugs/modalg_8/bug_gh544: Language not supported
Comments suppressed due to low confidence (2)
src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx:569
- Consider extracting the repeated logic for obtaining and creating a trimmed curve from an edge into a helper function to reduce code duplication between the starting edge and subsequent edges.
Handle(Geom2d_Curve) CurPCurve = BRep_Tool::CurveOnSurface(aCurrentEdge, theRefFace, anEdgeStartParam, anEdgeEndParam);
src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx:625
- [nitpick] Consider adding an inline comment explaining the rationale behind checking both the direct tolerance and the period-offset tolerance to improve clarity for future maintenance.
if (!(Abs(anOffset) < theCoordTol || Abs(Abs(anOffset) - thePeriod) < theCoordTol))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses an infinite loop issue in the Simplify Fuse operation by refactoring the RelocatePCurvesToNewUorigin() function and improving edge removal from the vertex‑to‑edge map.
- Refactors RemoveEdgeFromMap() to use clearer documentation and updated parameter names.
- Introduces a new helper function, getCurveParams(), to simplify retrieval of curve parameter endpoints.
- Adjusts loop logic in RelocatePCurvesToNewUorigin() to prevent infinite loops when an edge is absent in the map.
Files not reviewed (1)
- tests/bugs/modalg_8/bug_gh544: Language not supported
Comments suppressed due to low confidence (1)
src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx:289
- Consider renaming the calling variable from 'theVEmap' to 'theVertexToEdges' in RelocatePCurvesToNewUorigin() to maintain consistency with the updated parameter name in RemoveEdgeFromMap().
static bool RemoveEdgeFromMap(const TopoDS_Edge& theEdge, TopTools_IndexedDataMapOfShapeListOfShape& theVertexToEdges)
…557 Minor refactoring of RelocatePCurvesToNewUorigin(). RelocatePCurvesToNewUorigin() can no longer stuck in infinite loop if it found the edge that is not present in theVEmap. Test bug_gh544 is added to check the fix.
Minor refactoring of RelocatePCurvesToNewUorigin(). RelocatePCurvesToNewUorigin() can no longer stuck in infinite loop if it found the edge that is not present in theVEmap. Test bug_gh544 is added to check the fix.