Modeling - Infinite loop when Simplifying Fuse operation, CPU to 100%#557
Merged
dpasukhi merged 1 commit intoOpen-Cascade-SAS:IRfrom May 22, 2025
Merged
Modeling - Infinite loop when Simplifying Fuse operation, CPU to 100%#557dpasukhi merged 1 commit intoOpen-Cascade-SAS:IRfrom
dpasukhi merged 1 commit intoOpen-Cascade-SAS:IRfrom
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.
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.
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)
dpasukhi
approved these changes
May 21, 2025
dpasukhi
pushed a commit
that referenced
this pull request
Sep 6, 2025
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.