Following seems pretty clearly to be a bug, but I am seeking comment on the actual problem before putting it in the tracking system. (Using 0.19 #16694 (Git), details below.)
Under certain circumstances Part.makeRevolution() fails indicating "TypeError: function takes at most 6 arguments (7 given)"
The documentation indicates 7 arguments:
Code: Select all
Part.makeRevolution.__doc__
'makeRevolution(Curve,[vmin,vmax,angle,pnt,dir,shapetype]) -- Make a revolved shape\nby rotating the curve or a portion of it around an axis given by (pnt,dir).\nBy default vmin/vmax=bounds of the curve,angle=360,pnt=Vector(0,0,0) and\ndir=Vector(0,0,1) and shapetype=Part.Solid'
Code: Select all
import Part
from FreeCAD import Vector
z = [ Vector(0, 0, 0) , Vector(0, .25, .5), Vector(0, .5, 1.0), Vector(0, .25, 1.5)]
c=Part.BSplineCurve()
c.interpolate(z)
cS = Part.makeRevolution(c, c.FirstParameter, c.LastParameter, 360,
Vector(0,0,0), Vector(0,0,1), Part.Solid)
Code: Select all
eC = c.toShape()
cS = Part.makeRevolution(eC, eC.FirstParameter, eC.LastParameter, 360,
Vector(0,0,0), Vector(0,0,1), Part.Solid)
At the very least the code and error message do not agree. But looking (with no understanding of cpp) at the code following line1307 in FreeCAD/src/Mod/Part/App/AppPartPy.cpp it seems that it may be able to extract the curve from the shape object.
So I think the problem may be that the argument count check is throwing an incorrect error and preventing the code from working. Could someone with some understanding of cpp please comment on this.
OS: Linux Mint 18.1 Serena (X-Cinnamon/cinnamon)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16694 (Git)
Build type: Unknown
Branch: master
Hash: cd74f2e92908e94f9f7bc718e1be52939647b844
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)