Code: Select all
import FreeCAD, Draft, Part, math
from FreeCAD import Base
from FreeCAD import Vector
import DraftVecUtils
try:
FreeCAD.closeDocument("test")
except NameError:
pass
doc = FreeCAD.newDocument("test")
doc.Label = "test"
p1 = Vector ( 0, 0, 0)
p2 = Vector ( 0, 2, 0)
p3 = Vector ( 1, 1, 0)
thread_section = Part.Wire([Part.makeLine (p1, p2), Part.makeLine (p2, p3), Part.makeLine (p1, p3)])
thread_section.rotate ( Vector(0,0,0),Vector(1,0,0),90)
thread_section_pipe = Part.Wire( Part.makeHelix(2, 5, 1) ).makePipeShell([thread_section],True,True)
#Part.show(thread_section_pipe)
cyl = Part.makeCylinder(1,1)
#Part.show(cyl)
result = thread_section_pipe.cut(cyl)
Part.show(result)
Gui.activateWorkbench("ArchWorkbench")
Gui.activateWorkbench("DraftWorkbench")
cylinder:
result (and also result helix became full black) :