Hi, I am using BRepAlgoAPI_Splitter to split a shell by a plane. This is the code we are using:
The problem is that splitShape is a TopoDS_Shell. If I analyze the shell I can see that the faces have been split but what I need is two different shells, not one shell with split faces. Right now we are dividing the shell checking if it is in front or behind the plane. It seems to work, but I don't think is the best way.
Thanks!
C++:
// Object
TopTools_ListOfShape objectShapes = myShell;
// Tools
TopTools_ListOfShape toolShapes;
gp_Pnt planePoint(pos.x, pos.y, pos.z);
gp_Dir planeNormal(dir.x, dir.y, dir.z);
const Handle(Geom_Surface) planeSurface = new Geom_Plane(planePoint, planeNormal);
TopoDS_Face planeFace;
BRep_Builder builder;
builder.MakeFace(planeFace, planeSurface, 0.001);
toolShapes.Append(planeFace);
// Splitter
BRepAlgoAPI_Splitter splitter;
splitter.SetArguments(objectShapes);
splitter.SetTools(toolShapes);
splitter.Build();
// result
TopoDS_Shape splitShape = splitter.Shape();
The problem is that splitShape is a TopoDS_Shell. If I analyze the shell I can see that the faces have been split but what I need is two different shells, not one shell with split faces. Right now we are dividing the shell checking if it is in front or behind the plane. It seems to work, but I don't think is the best way.
Thanks!