Skip to content

Modeling - BRepBuilderAPI_GTransform face stretch crash#875

Merged
dpasukhi merged 5 commits intoOpen-Cascade-SAS:IRfrom
AtheneNoctuaPt:CR872
Dec 4, 2025
Merged

Modeling - BRepBuilderAPI_GTransform face stretch crash#875
dpasukhi merged 5 commits intoOpen-Cascade-SAS:IRfrom
AtheneNoctuaPt:CR872

Conversation

@AtheneNoctuaPt
Copy link
Copy Markdown
Collaborator

Added degenerated curves handling to Geom2dAdaptor_Curve and GeomAdaptor_Curve.

@AtheneNoctuaPt AtheneNoctuaPt self-assigned this Dec 3, 2025
@AtheneNoctuaPt AtheneNoctuaPt added 2. Bug Something isn't working 1. Modeling Boolean operations, offsets, primitives, any conversion, brep builders and etc... labels Dec 3, 2025
@dpasukhi
Copy link
Copy Markdown
Member

dpasukhi commented Dec 3, 2025

@AtheneNoctuaPt Could you please generate a GTest to cover that changes?

@github-project-automation github-project-automation bot moved this from Todo to Integration in Maintenance Dec 3, 2025
@dpasukhi dpasukhi requested a review from Copilot December 4, 2025 18:57
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 crash in BRepBuilderAPI_GTransform during face stretching operations by adding support for degenerated curves (curves with zero or near-zero length) in both GeomAdaptor_Curve and Geom2dAdaptor_Curve classes.

Key Changes:

  • Modified parameter validation to allow curves where theUFirst > theULast within Precision::Confusion() tolerance
  • Updated documentation to reflect the new tolerance-based validation
  • Added comprehensive test suites for both 2D and 3D curve adaptors

Reviewed changes

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

Show a summary per file
File Description
src/ModelingData/TKG3d/GeomAdaptor/GeomAdaptor_Curve.hxx Updated parameter validation logic and documentation to support degenerated 3D curves
src/ModelingData/TKG3d/GTests/GeomAdaptor_Curve_Test.cxx Added comprehensive test coverage for 3D degenerated curve handling
src/ModelingData/TKG3d/GTests/FILES.cmake Registered new 3D test file in build system
src/ModelingData/TKG2d/Geom2dAdaptor/Geom2dAdaptor_Curve.hxx Updated parameter validation logic and documentation to support degenerated 2D curves
src/ModelingData/TKG2d/GTests/Geom2dAdaptor_Curve_Test.cxx Added comprehensive test coverage for 2D degenerated curve handling
src/ModelingData/TKG2d/GTests/FILES.cmake Registered new 2D test file in build system

GeomAdaptor_Curve(const Handle(Geom_Curve)& theCurve) { Load(theCurve); }

//! Standard_ConstructionError is raised if theUFirst>theULast
//! Standard_ConstructionError is raised if theUFirst > theULast + Precision::PConfusion()
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.

The documentation references Precision::PConfusion() but the actual implementation uses Precision::Confusion(). The documentation should match the implementation and use Precision::Confusion() instead.

Copilot uses AI. Check for mistakes.
}

//! Standard_ConstructionError is raised if theUFirst>theULast
//! Standard_ConstructionError is raised if theUFirst > theULast + Precision::PConfusion()
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.

The documentation references Precision::PConfusion() but the actual implementation uses Precision::Confusion(). The documentation should match the implementation and use Precision::Confusion() instead.

Copilot uses AI. Check for mistakes.
}

//! Standard_ConstructionError is raised if theUFirst>theULast
//! Standard_ConstructionError is raised if theUFirst > theULast + Precision::PConfusion()
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.

The documentation references Precision::PConfusion() but the actual implementation uses Precision::Confusion(). The documentation should match the implementation and use Precision::Confusion() instead.

Suggested change
//! Standard_ConstructionError is raised if theUFirst > theULast + Precision::PConfusion()
//! Standard_ConstructionError is raised if theUFirst > theULast + Precision::Confusion()

Copilot uses AI. Check for mistakes.
@dpasukhi dpasukhi merged commit 244c54a 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
…-SAS#875)

- Modified parameter validation to allow curves where `theUFirst > theULast` within `Precision::Confusion()` tolerance
- Updated documentation to reflect the new tolerance-based validation
- Added comprehensive test suites for both 2D and 3D curve adaptors
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.

BRepBuilderAPI_GTransform face stretch crash (Standard_ConstructionError)

3 participants