Skip to content

Modelling - ShapeUpgrade_UnifySameDomain crash#876

Merged
dpasukhi merged 2 commits intoOpen-Cascade-SAS:IRfrom
AtheneNoctuaPt:UnifySameDomain_fix
Dec 4, 2025
Merged

Modelling - ShapeUpgrade_UnifySameDomain crash#876
dpasukhi merged 2 commits intoOpen-Cascade-SAS:IRfrom
AtheneNoctuaPt:UnifySameDomain_fix

Conversation

@AtheneNoctuaPt
Copy link
Copy Markdown
Collaborator

Improved handling of degenerated curves in ShapeUpgrade_UnifySameDomain

Improved handling of degenerated curves in ShapeUpgrade_UnifySameDomain
@AtheneNoctuaPt AtheneNoctuaPt self-assigned this Dec 3, 2025
@AtheneNoctuaPt AtheneNoctuaPt added the 2. Bug Something isn't working label Dec 3, 2025
@AtheneNoctuaPt AtheneNoctuaPt added the 1. Modeling Boolean operations, offsets, primitives, any conversion, brep builders and etc... label Dec 3, 2025
@dpasukhi dpasukhi requested a review from Copilot December 4, 2025 18:57
@github-project-automation github-project-automation bot moved this from Todo to Integration in Maintenance Dec 4, 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 addresses a crash in ShapeUpgrade_UnifySameDomain by adding null checks for degenerated curves before attempting to evaluate them. The fix prevents dereferencing null curve handles that can occur when processing edges with degenerated 2D curve representations.

Key changes:

  • Added null safety checks for BRepAdaptor_Curve2d::Curve() before evaluating curve parameters
  • Modernized variable declarations with const qualifiers
  • Replaced conditional assignment with std::min for cleaner code

Comment on lines +340 to +341
const gp_Pnt2d FirstP2d = BAcurve2d.Value(BAcurve2d.FirstParameter());
const gp_Pnt2d LastP2d = BAcurve2d.Value(BAcurve2d.LastParameter());
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable declarations should follow OCCT naming conventions. According to the OCCT guidelines, local variables should use the pattern aVariableName, not FirstP2d and LastP2d. These should be renamed to aFirstP2d and aLastP2d respectively.

Copilot generated this review using guidance from repository custom instructions.
@dpasukhi dpasukhi merged commit 733a8b4 into Open-Cascade-SAS:IR Dec 4, 2025
24 checks passed
@github-project-automation github-project-automation bot moved this from Integration to Done in Maintenance Dec 4, 2025
dpasukhi pushed a commit to dpasukhi/OCCT that referenced this pull request Dec 5, 2025
- Added null safety checks for `BRepAdaptor_Curve2d::Curve()` before evaluating curve parameters
- Modernized variable declarations with `const` qualifiers
- Replaced conditional assignment with `std::min` for cleaner code
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.

3 participants