Shape Healing

Hi, body,

I suffer from a problem.
I construct a TopoDS_Solid from three TopoDS_Shell by using the BRep_Builder. The shading mode of the build solid is working well in AIS_InteractiveContext, but the result is false if I perform a Boolean cut with another TopoDS_Shape (e.g., BRepBuilderAPI_MakeBox). Through the introduction from Lauzou ( I checked the Solid by BRepCheck_Analyzer and found the errors, e.g.,
1. TopoDS_SHELL: BRepCheck_UnorientableShape, BRepCheck_NotConnected, BRepCheck_NotClosed
2. TopoDS_FACE: BRepCheck_UnorientableShape

By using two methods I have tried to heal the Solid. At first, Applying the “ShapeFix_Face” to fix the “UnorientableShape” error. Then, using “ShapeFix_Shape” to fix the global Solid.
The results of BRepCheck_Analyzer showed that the Shells have not been closed (BRepCheck_NotClosed).

Could Someone tell me, which ShapeHealing methods I should use for a checking errors of TopoDS_Solid or the same Shape.


Francois Lauzon's picture

Hi Du,
When you create a Solid from shells, you must make sure that some contiguous edges and vertex are shared between shells, BRep_Builder don't do that, you have to do it yourself, maybe that's why you have an invalid solid. You might also use BRepOffsetAPI_Sewing which will try to do that for you, or use ShapeUpgrade_ShellSewing and passing your invalid solid and it will try to sew each shell together.

Good Luck,

DU's picture

Hi, lauzou,

I have just applied the method "ShapeUpgrade_ShellSewing" that you have said, OK, It works very well!

Thank you!