Skip to content

Modelling - Boolean fuse segfaults on loft#860

Merged
dpasukhi merged 2 commits intoOpen-Cascade-SAS:IRfrom
AtheneNoctuaPt:CR783
Nov 29, 2025
Merged

Modelling - Boolean fuse segfaults on loft#860
dpasukhi merged 2 commits intoOpen-Cascade-SAS:IRfrom
AtheneNoctuaPt:CR783

Conversation

@AtheneNoctuaPt
Copy link
Copy Markdown
Collaborator

BOPAlgo_PaveFiller::FillPaves() and CorrectWires() are now skipping edges without geometry.
Minor refactoring of some functions in BOPAlgo_PaveFiller is performed.

BOPAlgo_PaveFiller::FillPaves() and CorrectWires() are now skipping
edges without geometry.
Minor refactoring of some functions in BOPAlgo_PaveFiller is performed.
@AtheneNoctuaPt AtheneNoctuaPt self-assigned this Nov 28, 2025
@AtheneNoctuaPt AtheneNoctuaPt added 2. Bug Something isn't working 1. Modeling Boolean operations, offsets, primitives, any conversion, brep builders and etc... labels Nov 28, 2025
@AtheneNoctuaPt AtheneNoctuaPt linked an issue Nov 28, 2025 that may be closed by this pull request
@dpasukhi dpasukhi requested a review from Copilot November 28, 2025 14:10
@dpasukhi dpasukhi added this to the Release 7.9.3 milestone Nov 28, 2025
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 fixes a segmentation fault that occurred during Boolean fuse operations on lofted shapes. The fix adds null checks for edge geometry in two critical functions: FillPaves() and CorrectWires(), preventing crashes when encountering edges without associated geometric curves. Additionally, the code includes refactoring improvements to BOPAlgo_PaveFiller::ProcessDE() and FindPaveBlocks() for better readability and modern C++ practices.

Key changes:

  • Added null checks for 2D curve handles to prevent dereferencing null geometry
  • Refactored ProcessDE() to use modern C++ idioms (auto, structured bindings, range-based iteration patterns)
  • Simplified FindPaveBlocks() using a lambda function to reduce code duplication

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
BOPTools_AlgoTools_1.cxx Added null check for 2D curve before parameter extraction in CorrectWires()
BOPAlgo_PaveFiller_8.cxx Added null check in FillPaves(), refactored ProcessDE() and FindPaveBlocks() for cleaner code structure

Comment thread src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_8.cxx
Comment thread src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_8.cxx
Comment thread src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_8.cxx
Comment thread src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_8.cxx
Comment thread src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_8.cxx
Comment thread src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_8.cxx
@dpasukhi
Copy link
Copy Markdown
Member

New test crash SEGFAL on old version with new fixed.
I suppose GTest much better then anything else.

@github-project-automation github-project-automation bot moved this from Todo to Integration in Maintenance Nov 29, 2025
@dpasukhi dpasukhi merged commit 29631c6 into Open-Cascade-SAS:IR Nov 29, 2025
23 checks passed
@github-project-automation github-project-automation bot moved this from Integration to Done in Maintenance Nov 29, 2025
dpasukhi pushed a commit to dpasukhi/OCCT that referenced this pull request Dec 5, 2025
- Added null checks for 2D curve handles to prevent dereferencing null geometry
- Refactored `ProcessDE()` to use modern C++ idioms (auto, structured bindings, range-based iteration patterns)
- Simplified `FindPaveBlocks()` using a lambda function to reduce code duplication
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: Done

Development

Successfully merging this pull request may close these issues.

Boolean fuse segfaults on loft

3 participants