[vtkusers] How to generate a surface normal glyph for a triangle cell

Elvis Dowson elvis.dowson at mac.com
Thu Oct 9 14:28:07 EDT 2008


Hi,
         Thanks to inputs from Mike and Prasanth, I was able to learn  
the correct procedure to generate the surface normal glyph for a  
triangle cell! :-)

The procedure is to first use vtkPolyDataNormals and set  
ComputeCellNormalsOn and then pass the results to vtkCellCenters to  
generate the normal at the center of the cell.

vtkPolyDataNormals triangleCellNormals
   triangleCellNormals SetInputConnection  
[triangleCellDataSetSurfaceFilter GetOutputPort]
   triangleCellNormals ComputePointNormalsOff
   triangleCellNormals ComputeCellNormalsOn
   triangleCellNormals SplittingOff
   triangleCellNormals FlipNormalsOff
   triangleCellNormals ConsistencyOn
   triangleCellNormals AutoOrientNormalsOn

vtkCellCenters triangleCellNormalsAtCellCenters
   triangleCellNormalsAtCellCenters SetInputConnection  
[triangleCellNormals GetOutputPort]

After that you can pass the normal co-ordinates to vtkGlyph3D for  
generating the surface normal glyph.

The full source code is attached with this email.

Best regards,

Elvis Dowson

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081009/6b96be41/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TriangleWithSurfaceNormalGlyph.tcl
Type: application/octet-stream
Size: 2680 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081009/6b96be41/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081009/6b96be41/attachment-0001.htm>


More information about the vtkusers mailing list