# Computation of tangent vectors on polyData

**URL:** https://discourse.vtk.org/t/computation-of-tangent-vectors-on-polydata/6502
**Category:** Development
**Created:** [August 30, 2021, 2:07pm UTC](https://discourse.vtk.org/t/computation-of-tangent-vectors-on-polydata/6502 "2021-08-30T14:07:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![omarElsayed](https://discourse.vtk.org/user_avatar/discourse.vtk.org/omarelsayed/32/5819_2.png) [@omarElsayed](https://discourse.vtk.org/u/omarElsayed)
#### Post date: [August 30, 2021, 2:07pm UTC](https://discourse.vtk.org/t/computation-of-tangent-vectors-on-polydata/6502/1 "2021-08-30T14:07:39Z")

</div>

Hello,

I am trying to compute the tangent vectors at each vertex of an STL file. Using proper macros as declared in vtkPolyDataTangents “[https://vtk.org/doc/nightly/html/vtkPolyDataTangents\_8h\_source.html](https://vtk.org/doc/nightly/html/vtkPolyDataTangents_8h_source.html)”. The output data is “none”. I am using VTK ver 9.0 and python. Is there a way to retrieve the tangent vectors at each vertex?

Regards

---

<div class="post-metadata">

### Author: ![LucasGandel](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lucasgandel/32/1831_2.png) [@LucasGandel](https://discourse.vtk.org/u/LucasGandel)
#### Post date: [August 31, 2021, 4:34pm UTC](https://discourse.vtk.org/t/computation-of-tangent-vectors-on-polydata/6502/2 "2021-08-31T16:34:43Z")

</div>

vtkPolyDataTangents requires a triangulated polydata with normals and texture coordinates.  
Can you check that your STL model meets those requirements?

You can use [vtkTriangleFilter](https://vtk.org/doc/nightly/html/classvtkTriangleFilter.html) to triangulate, [vtkPolyDataNormals](https://vtk.org/doc/nightly/html/classvtkPolyDataNormals.html) to add normals, and [vtkTextureMapToPlane](https://vtk.org/doc/nightly/html/classvtkTextureMapToPlane.html#details) or similar to add tcoords.
