Code: Select all
import Part
doc = FreeCAD.newDocument('Slice')
Gui.activeDocument().activeView().viewAxonometric()
b = Part.makeBox(10,10,10,Base.Vector(0,0,0),Base.Vector(0,0,1))
box = doc.addObject("Part::Box","Box")
box.Shape = b
planes = []
for i in range(2,10,2):
p = Part.makePlane(14,14, Base.Vector(-2,-2,i), Base.Vector(0,0,1))
plane = doc.addObject("Part::Plane",("Plane%s" % (i)))
plane.Shape = p
planes.append(p)
import Part
doc = FreeCAD.newDocument('Slice')
Gui.activeDocument().activeView().viewAxonometric()
b = Part.makeBox(10,10,10,Base.Vector(0,0,0),Base.Vector(0,0,1))
box = doc.addObject("Part::Box","Box")
box.Shape = b
planes = []
for i in range(2,10,2):
p = Part.makePlane(14,14, Base.Vector(-2,-2,i), Base.Vector(0,0,1))
plane = doc.addObject("Part::Plane",("Plane%s" % (i)))
plane.Shape = p
planes.append(p)
Gui.SendMsgToActiveView("ViewFit")
I am trying to slice the box with the planes using: r = Part.BOPTools.SplitAPI.slice(b, planes, "Split",tolerance = 0.0), but I cannot get the result I need. Thank you for your help.