I am having the folowing script, where I do a cut of a shape:
Code: Select all
# cut shape with cutting box
doc.addObject('Part::Cut', 'cut')
doc.cut.Base = doc.shape
doc.cut.Tool = doc.cut_box
doc.recompute()
# create cutting surface
cut_surf_wires = list()
for i in doc.cut.Shape.slice(App.Vector(0, 0, 1), 0):
cut_surf_wires.append(i)
cut_surf = Part.Compound(cut_surf_wires)
add_cut_surf = doc.addObject('Part::Feature', 'cut_surf')
add_cut_surf.Shape = cut_surf
Any hint would be appreciated
Tom