[vtkusers] Parametric Function segfault

Martin Saturka kvutza at gmail.com
Sun Mar 2 07:36:40 EST 2008


Dear Sirs,
I have tried to use vtkParametricFunction class in my Python script.
I created a simple class off the vtkParametricFunction, but it just
segfaults when I create an object of the new class. It works without
a problem for the already precreated classes like the ellipsoid one.

I run VTK 5.0.3 through Python 2.5 on an Ubuntu 7.10 64bit Linux box.
The code is as below:

#!/usr/bin/env python

import vtk

class myParFnc(vtk.vtkParametricFunction):
  def __init__(self):
    self.MinimumU = 0.0
    self.MinimumV = 0.0
    self.MaximumU = 1.0
    self.MaximumV = 1.0
    self.JoinU = 0
    self.JoinV = 0
    self.TwistU = 0
    self.TwistV = 0
    self.ClockwiseOrdering = 1
    self.DerivativesAvailable = 1

  def GetDimension(self):
    return 2

  def Evaluate(self, uvw, Pt, Duvw):
    Pt[0] = uvw[0]
    Pt[1] = uvw[1]
    Pt[2] = 1.0

    for ind in range(9):
      Duvw[ind] = 0.0

  def EvaluateScalar(self, uvw, Pt, Duvw):
    return 0

# Up to now, nothing happens. However, the line below
# leads to a direct segmentation fault.

mpf = myParFnc()



More information about the vtkusers mailing list