[Paraview] pythonnurbs inside ProgrammableFilter

Oliver Borm oli.borm at web.de
Fri Jan 8 04:12:33 EST 2010


Hello,

I am using pythonnurbs from http://pypi.python.org/pypi/PythonNURBS in
conjunction with the python bindings from vtk. As a standalone script it
works perfectly, but if I want to use it inside paraview with the
ProgrammableFilter it just works once a time. After that some errors
occur. Here is a simple python test code:

from pythonnurbs import NurbsCurve, NurbsPoint
curve=NurbsCurve.NurbsCurved()
curve.makeCircle(NurbsPoint.Point3Dd(0.0,0.0,0.0), 100.0)
u = 0.5
print curve.pointAt(u).getx(), curve.pointAt(u).gety(),
curve.pointAt(u).getz()

The following output is printed:

-100.0 0.0 0.0


If one changes for example:
u = 0.25

and want to re-execute the ProgrammableFilter again, the following error
occured

Traceback (most recent call last):

File "<string>", line 23, in <module>

File "<string>", line 5, in RequestData

File "/usr/lib64/python2.6/site-packages/pythonnurbs/NurbsCurve.py",
line 277, in makeCircle

def makeCircle(*args): return _NurbsCurve.NurbsCurved_makeCircle(*args)

NotImplementedError: Wrong number of arguments for overloaded function
'NurbsCurved_makeCircle'.

Possible C/C++ prototypes are:

makeCircle(PLib::NurbsCurve< double,3 > *,PLib::Point_nD< double,3 >
const &,PLib::Point_nD< double,3 > const &,PLib::Point_nD< double,3 >
const &,double,double,double)

makeCircle(PLib::NurbsCurve< double,3 > *,PLib::Point_nD< double,3 >
const &,double,double,double)

makeCircle(PLib::NurbsCurve< double,3 > *,PLib::Point_nD< double,3 >
const &,double)


while running the same code a second time in a normal python shell, the
output looks like the following:
0.0 100.0 0.0

One has to restart paraview and the python code in the
ProgrammableFilter works as expected (once a time). The error message is
not very helpful, as it says that this method is not implemented in the
way I'm using it. But that is not correct. Does anybody has an idea
what's the real problem? At first one could expect the problem is in
pythonnurbs (maybe it is, but not in the way the error message says),
but as the code works once a time, why does it not works twice?

Best regards,
Oliver Borm



More information about the ParaView mailing list