Skip to content

Modelling - Fix infinite loop in IntWalk_IWalking::ComputeOpenLine()#1263

Open
AtheneNoctuaPt wants to merge 2 commits intoOpen-Cascade-SAS:IRfrom
AtheneNoctuaPt:intwalk_inf_loop
Open

Modelling - Fix infinite loop in IntWalk_IWalking::ComputeOpenLine()#1263
AtheneNoctuaPt wants to merge 2 commits intoOpen-Cascade-SAS:IRfrom
AtheneNoctuaPt:intwalk_inf_loop

Conversation

@AtheneNoctuaPt
Copy link
Copy Markdown
Collaborator

Infinite loop occurred in IntWalk_IWalking::ComputeOpenLine() inside 'while (!Arrive)' loop.
Fixed by checking for degenerate case after very large amount of iterations have passed.

Infinite loop occurred in IntWalk_IWalking::ComputeOpenLine() inside 'while (!Arrive)' loop.
Fixed by checking for degenerate case after very large amount of iterations have passed.
@AtheneNoctuaPt AtheneNoctuaPt requested a review from dpasukhi May 4, 2026 17:59
@AtheneNoctuaPt AtheneNoctuaPt self-assigned this May 4, 2026
@AtheneNoctuaPt AtheneNoctuaPt added 2. Bug Something isn't working 1. Modeling Boolean operations, offsets, primitives, any conversion, brep builders and etc... labels May 4, 2026
@dpasukhi dpasukhi requested a review from Copilot May 4, 2026 21:36
Copy link
Copy Markdown

Copilot AI left a 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 adds a retry cap to IntWalk_IWalking so the walking algorithms stop instead of looping indefinitely when root finding keeps failing during intersection-line construction. In the OCCT modeling pipeline, this affects how open and closed surface/surface intersection lines are advanced in IntWalk.

Changes:

  • Hoists shared walk/deflection constants into a file-scope anonymous namespace.
  • Adds aNbBadRootIter guards in ComputeOpenLine() to stop after too many consecutive Root() > Tolerance() iterations.
  • Applies the same retry-limit logic in ComputeCloseLine().

Comment thread src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_IWalking.gxx
Comment thread src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_IWalking.gxx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1. Modeling Boolean operations, offsets, primitives, any conversion, brep builders and etc... 2. Bug Something isn't working

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants