How to split a solid

Forums: 

I'm trying to split a very complex solid in 2 portion using a prism. I keep getting an error:
 

RuntimeError: StdFail_NotDone
BRep_API: command not done

Here is a snippet that reproduce the problem

box = BRepPrimAPI_MakeBox(5,5,5).Shape()
profile = BRepBuilderAPI_MakeEdge(gp_Pnt(-1., 2., 0.),gp_Pnt(6, 2., 0.)).Edge()
direction = gp_Dir(0,0,1)
prism = BRepPrimAPI_MakePrism(profile,direction).Shape()
ShapeCut = BRepAlgoAPI_Cut(box, prism).Shape()

The "cutter" seems more to work as a subtraction, but how do I simply divide a solid in 2 distinct portions?

HeshamNasif's picture

you have to make it in two steps

the second step by inverting your direction and get prism again in the oppo