[vtkusers] vtkCellDerivatives (fwd)

Pieter Vos pieterv at radiology.azn.nl
Thu May 16 07:18:12 EDT 2002


Hello,

I'm am looking for a way to compute the gradient of the normals on a mesh.
I'm came as far as below.

vtkPolyDataReader pdReader
    pdReader SetFileName inputMesh.vtk
    pdReader Update

vtkPolyDataNormals normals
#compute point normals
    normals SetInput [pdReader GetOutput]
    normals ComputePointNormalsOn
    normals ComputeCellNormalsOn
    normals ConsistencyOff
    normals SplittingOff

vtkConeSource cone
    cone SetResolution 1
    cone SetHeight 1
    cone SetRadius 0.1
    
vtkGlyph3D glyph
#convert pointnormals to vectors, no cellnormals to vector possible
    glyph SetInput [normals GetOutput]
    glyph SetSource [cone GetOutput]
    glyph SetVectorModeToUseNormal
    glyph SetScaleModeToScaleByVector
    glyph SetScaleFactor 1

vtkCellDerivatives derivs
#output: gradient of input vectors (a tensor)
    derivs SetInput [glyph GetOutput] 
    derivs DebugOn
    derivs SetVectorModeToPassVectors
    derivs SetTensorModeToComputeGradient
    derivs Update

However, when I print the tensor, the values are all like:

-----------------------------------------
-0
0
-0
-0
0
-0
-0
0
-0
-----------------------------------------
-----------------------------------------
-0
0
0
-0
0
0
-0
0
0
-----------------------------------------
-----------------------------------------
0
0
-0
0
0
-0
0
0
-0
-----------------------------------------

Does anyone have a clue?

-- 
Pieter Vos
UMC Radboud Nijmegen
The Netherlands
mailto:pieterv at radiology.azn.nl





More information about the vtkusers mailing list