Code: Select all
import FreeCAD, Draft, Part wall_thickness = 4.0 length = 40.0 diameter = 100.0 verts = [(0,0,0),(0,wall_thickness,0),(length,wall_thickness,0),(length,0,0)] outline = Draft.makeWire(verts,closed=True) profile = Part.Face(outline) # Things die here solid = profile.revolve((0,diameter/2,0),(1,0,0),360)
Traceback (most recent call last):
File "C:/stuff/revolve_test.py", line 10, in <module>
profile = Part.Face(outline)
<class 'Part.OCCError'>: Argument list signature is incorrect.
...which would seem to indicate that I could feed Part.Face with a wire, which I would have thought would have been the output of makeWire. But I must be missing something. When I try type(outline), I get <type 'FeaturePython'>, which isn't real informative. The Python console prints it out as a <Part::Part2DObject>. I can take the output of the makeWire(), and use the "Revolve" button on the Part workbench to get the ultimate revolution I'm after, so the wire seems like it must be valid and closed. I'm probably missing something very basic.
FWIW, I was trying to steal ideas from: https://forum.freecadweb.org/viewtopic. ... 792#p37621 in my search for how to programmatically make a revolution.
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13515 (Git)
Build type: Release
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)