Skip to content

Enhance fillet handling and add validation for geometry integrity#1293

Open
angelobartolome wants to merge 7 commits into
Open-Cascade-SAS:IRfrom
angelobartolome:fix/fillet
Open

Enhance fillet handling and add validation for geometry integrity#1293
angelobartolome wants to merge 7 commits into
Open-Cascade-SAS:IRfrom
angelobartolome:fix/fillet

Conversation

@angelobartolome

@angelobartolome angelobartolome commented Jun 3, 2026

Copy link
Copy Markdown

This pull request addresses issue #1177 by improving the robustness of fillet and chamfer operations when the radius or distance is large enough to entirely consume adjacent faces. The changes ensure that degenerate or invalid faces are detected and removed, allowing fillets and chamfers to meet cleanly without leaving behind problematic geometry. Additional regression tests are added to verify correct behavior in these edge cases.

Robustness improvements for fillet/chamfer operations:

  • Added the function ChFi3d_RemoveConsumedFaces in ChFi3d_Builder.cxx to detect and remove faces that have been fully consumed (collapsed to a negligible area) by fillet or chamfer operations, and to re-stitch the remaining faces into a valid solid or shell. This function is now called during the result assembly in ChFi3d_Builder::Compute(). [1] [2]
  • Introduced helper functions ChFi3d_IsConsumedFace and ChFi3d_IsPlanar to identify faces that should be removed.

Intersection and hatching logic improvements:

  • Updated intersection checks in ChFi3d_Builder_0.cxx and ChFi3d_Builder_C1.cxx to distinguish between transversal (invalid) and tangential (valid) fillet/chamfer intersections, allowing tangentially meeting fillets/chamfers to proceed without error. [1] [2] [3]
  • Modified hatching logic in ChFi3d_Builder_SpKP.cxx to retain points and segments, enabling valid domains to be created even when a fillet's tangency line coincides with a face boundary.

Regression tests for consumed faces and edge cases:

  • Added comprehensive regression tests in BRepFilletAPI_MakeFillet_Test.cxx and BRepFilletAPI_MakeChamfer_Test.cxx to verify that fillet and chamfer operations succeed and produce valid solids when faces are fully consumed, including cases where fillets/chamfers meet on opposing edges or remove entire faces. [1] [2]

Dependency and include updates:

  • Added necessary includes for geometry, bounding, and sewing operations in ChFi3d_Builder.cxx.

Discussion
Issue #172

… consumed faces (Open-Cascade-SAS#1177)

- Updated hatching process to retain points and segments, allowing for valid domain creation when fillet tangency lines coincide with boundary edges.
- Introduced functions to identify and remove faces that have been collapsed to zero-area bands due to large fillet radii, ensuring proper stitching of remaining faces.
- Adjusted shape computation to incorporate the removal of consumed faces, improving overall geometry integrity.
…lidation

- Enhanced intersection logic to differentiate between genuine crossings and tangential meetings of fillets, improving error handling for large radii cases (issue Open-Cascade-SAS#1177).
- Introduced a new function to check if a face is planar, aiding in the validation of consumed faces during geometry reconstruction.
- Updated the face removal process to ensure invalid planar faces are correctly identified and handled, enhancing overall geometry integrity.
…-Cascade-SAS#1177

- Introduced a new test case to validate the chamfering of every edge of a 50x50x10 slab with a distance of 5, ensuring that the operation completes without crashing.
- Verified that the resulting shape is valid and that no degenerate mid edges are left after the chamfering process.
…is_CheckSmallFace

- Replaced the previous bounding box and surface properties checks with a more efficient method using ShapeAnalysis_CheckSmallFace.
- Improved the logic for identifying consumed faces by checking for zero-width bands and spots, enhancing geometry validation during fillet operations.
… for improved readability

- Adjusted spacing in variable declarations to enhance code clarity and maintain consistency across the files.
- No functional changes were made; this is purely a formatting improvement.
… readability

- Combined return statements in the ChFi3d_IsConsumedFace function to streamline the code.
- No functional changes were made; this is a minor formatting improvement aimed at enhancing code clarity.
@dpasukhi

dpasukhi commented Jun 4, 2026

Copy link
Copy Markdown
Member

Amazing job! If you will need anything from me - let me know.
I'm open to the call/emails to discuss the patch.

In case when you complete the implementation, I would be happy to review and prepare to the OCCT rules and maybe fix something (usually the final steps I do by myself, they are mostly specific for the project).
I also will run full test round on your patch when you will ask me (even on the intermediate version).

@dpasukhi dpasukhi added the 3. CLA approved User has the signed CLA and ready to review or integration processes label Jun 4, 2026
@angelobartolome

Copy link
Copy Markdown
Author

Thanks @dpasukhi !

I think this PR is good to go as is right now, it will solve a bunch of use cases already.

I'm exploring extending this to allow for overflowing fillets/chamfers, but that is harder and bigger task, I'll probably do it in another PR or discussion if I succeed.

I see two failing checks in the pipelines, I think we need to check those before continuing

@dpasukhi
dpasukhi changed the base branch from master to IR June 4, 2026 18:00
@angelobartolome
angelobartolome marked this pull request as ready for review June 5, 2026 14:33
@dpasukhi

dpasukhi commented Jun 5, 2026

Copy link
Copy Markdown
Member

I will analyze regressions and also will have a full circle of testing (on our side we have x2+ tests)
It will take some time, but assume up to that Sunday evening I will have some patch/report to you. I will push to your branch In case of some patches.
(sorry for delay, now I'm a little busy with hot patch for 8.0.0 :(

@dpasukhi

dpasukhi commented Jun 7, 2026

Copy link
Copy Markdown
Member

17 FAILED Test failed (regression)
3 IMPROVEMENT Possible improvement

only 2 real regressions, but it is anyway were before, all the other FAILED - improvements.

There is a issue with performance, because you add BRepCheck + Sewing on each operation, which is not cheap.
I will clean up the code from most of the comments and some other generic clean up and code improvements.
+9-100% on some operations (it depends)

But it will take me some time to analyze the possibility to avoid BRepCheck and Sewing, because it is too expensive just to be and we usually avoid extra complex operations on the middle of others.

Also
Don't feel it right ;) I will need some time to somehow improve that part

    try
    {
      OCC_CATCH_SIGNALS
      BRepCheck_Analyzer anAnalyzer(theShape);
      isShapeValid = anAnalyzer.IsValid();
    }
    catch (const Standard_Failure&)
    {
      isShapeValid = true;
    }

@angelobartolome

Copy link
Copy Markdown
Author

Sounds good, and I agree with the performance issue, let me know if I can help in anyway!

@luzpaz

luzpaz commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

@dpasukhi have you had more thoughts on how to workaround the performance and methodology issues you raised in #1293 (comment) ?

@dpasukhi

Copy link
Copy Markdown
Member

@dpasukhi have you had more thoughts on how to workaround the performance and methodology issues you raised in #1293 (comment) ?

There are no needs to thoughts. The fix will require the deep debug and proper writing the cases.
The problem is not performance, but the complexity of the solution.

That part still pending when I will have at least a few day to debug.
But using BRepCheck+Sewing inside the other operatings unfortunately is not acceptable to merge.

@jhaand

jhaand commented Jul 18, 2026

Copy link
Copy Markdown

Any update on this?

@dpasukhi dpasukhi added this to the Release 8.1 milestone Jul 18, 2026
@dpasukhi

Copy link
Copy Markdown
Member

I started to work on it. It will take about 1+-1 week for me approximately (I can't fully allocate the time on R&D :(
The task is planned to dev release or 8.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. CLA approved User has the signed CLA and ready to review or integration processes

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

4 participants