Fix self-intersection for shell

Hello Team,
I cannot find the general way how to fix self-intersections for shells.

After importing from STEP I get about 2% of solids with self-intersection problem.
Please advise me a general way.

Thanks.
With respects, Eugene.

Kaylx Null's picture

Hi Eugene,

Did you ever manage to solve this issue?

I am experiencing the same thing.
In my situation after using BRepBuilderAPI_Sewing to create the shell, BRepCheck_Analyzer.IsValid returns true.
However when I then create a solid to perform boolean operations, I get errors about self-interfering shapes.
If I run BRepAlgoAPI_Check on the shell it does report the self-intersections.
I have tried using ShapeFix_Shape/ShapeFix_Shell to correct the shell but it does not produce the desired result.
In the picture attached, the desired result would be 2 shells, however it creates 5 shells; 1 overall shell and 4 shells made of individual faces.

Regards,
Kaylx

Vilo 176's picture

Hi,

Dealing with noisy/bad geometry as input for OCCT is always a hard journey.
Even "apparently very simple & sound geometry" can lead to problems.

The best way I've tested to deal with STEP is :
1. Import the STEP file with STEPControl_Reader => you get a bunch of Solids
2. For each solid, take all its faces and perform a BOPAlgo_MakerVolume on it => you get a new cleaned Solid

The 2nd step can alternatively be performed by BRepBuilderAPI_Sewing, it is much faster than MakerVolume, but less robust.