>>>>> "Jelle" == jelle feringa <[EMAIL PROTECTED]> writes:
Jelle> Hi, I haven't been able to find out how one can add a
Jelle> filter such as Curvatures that isn't part of the
Jelle> pre-defined mayavi filters, in mayavi rather than ivtk.
Jelle> Speaking of Curvatures: my goal is to apply subdivision,
Jelle> just there where there is a strong curvature. In order to
Jelle> do so, I would need to be able to select those areas of the
Jelle> polygons via the Curvatures filter. That's the part I don't
Jelle> get... If someone could show how that's done, I would be
Jelle> *much* obliged! I've been trying to do so using boolean
Jelle> textures, but I'm afraid I haven't managed to do so yet.
I've never used the Curvatures filter. I think the way it works is
when you get the output of a vtkCurvatures filter it adds data arrays
to the output called "Gauss_Curvature" or "Mean_Curvature" depending
on the filter options. If you set these as the active arrays, you can
plot the curvature at each point and then perhaps do what you'd want
to. The curvatures filter does not allow you to select any points it
simply computes the curvature at each point and adds that data to the
input.
Here is some experimentation on IPython for you:
import mayavi
v = mayavi.mayavi()
v.open_vtk('cyl_2.vtk')
v.load_filter('WarpScalar')
v.load_filter('PolyDataNormals')
c = v.load_filter('UserDefined:vtkCurvatures')
o = c.GetOutput()
pd = o.GetPointData()
pd.GetNumberOfArrays()
# Prints out 4
pd.GetArrayName(3)
# Prints "Gauss_Curvature"
pd.SetActiveScalars('Gauss_Curvature')
v.load_module('SurfaceMap') # To view the curvatures.
It should be easy to create a simple Curvatures filter that does this
for you automatically. The idea is you provide a simple UI to choose
the nature of the curvature and automatically set the currently active
scalar to the chosen one and then do whatever further processing you
need to.
HTH.
cheers,
prabhu
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
MayaVi-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mayavi-users