Archived issue #0033908
Bad result with BRepAlgoAPI_Cut
Description
Hello,
I try to use BRepAlgoAPI_Cut between 2 shapes. I should have a shape as result but I get an empty TopoDS_Shape.
I try to use BRepAlgoAPI_Cut between 2 shapes. I should have a shape as result but I get an empty TopoDS_Shape.
Steps to reproduce
BRepAlgoAPI_Cut lBuilder ;
BRep_Builder lBRepBuilder ;
TopTools_ListOfShape lArgs ;
TopoDS_Shape lArg, lTool ;
BRepTools::Read(lArg, "Attachment 2 (BREP)", lBRepBuilder) ;
BRepTools::Read(lTool, "Attachment 1 (BREP)", lBRepBuilder) ;
lArgs.Append(lArg) ;
lBuilder.SetArguments(lArgs) ;
TopTools_ListOfShape lTools ;
lTools.Append(lTool) ;
lBuilder.SetTools(lTools) ;
lBuilder.SetFuzzyValue(1e-6) ;
lBuilder.Build() ;
if (lBuilder.IsDone() && !lBuilder.HasErrors())
{
pResultShape = lBuilder.Shape() ;
BRepTools::Write(pResultShape, "Attachment 3 (BREP)") ;
}
BRep_Builder lBRepBuilder ;
TopTools_ListOfShape lArgs ;
TopoDS_Shape lArg, lTool ;
BRepTools::Read(lArg, "Attachment 2 (BREP)", lBRepBuilder) ;
BRepTools::Read(lTool, "Attachment 1 (BREP)", lBRepBuilder) ;
lArgs.Append(lArg) ;
lBuilder.SetArguments(lArgs) ;
TopTools_ListOfShape lTools ;
lTools.Append(lTool) ;
lBuilder.SetTools(lTools) ;
lBuilder.SetFuzzyValue(1e-6) ;
lBuilder.Build() ;
if (lBuilder.IsDone() && !lBuilder.HasErrors())
{
pResultShape = lBuilder.Shape() ;
BRepTools::Write(pResultShape, "Attachment 3 (BREP)") ;
}
Public activity
1 archived note
Participants are labeled by their role within this record.
The Attachment 1 (BREP) consists of two parts: "plane" and "cube". In case of an attempt to cut from the Attachment 2 (BREP) disk only cube, it will return the valid result, so the problem is in the "plane". According to the topology naming this plane is a solid, so it should be a very thin parallelepiped, but in fact it is a plane. It has only 6 plane faces: top, bottom, and 4 outside walls. While it should have 4 more inside walls to be a parallelepiped with a hole. This invalidity made the given shape flat (during any shape healing or from the beginning, I don't know). So cutting a plane from the real solid with volume led to an empty shape as a result.
Related records