# Compute consistent normal vectors from triangle strips

**URL:** <https://discourse.slicer.org/t/compute-consistent-normal-vectors-from-triangle-strips/12926>\
**Category:** Development\
**Created:** [August 10, 2020, 1:50pm UTC](https://discourse.slicer.org/t/compute-consistent-normal-vectors-from-triangle-strips/12926 "2020-08-10T13:50:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![loubna](https://avatars.discourse-cdn.com/v4/letter/l/cab0a1/32.png) [@loubna](https://discourse.slicer.org/u/loubna)\
**Post date:** [August 10, 2020, 1:50pm UTC](https://discourse.slicer.org/t/compute-consistent-normal-vectors-from-triangle-strips/12926/1 "2020-08-10T13:50:52Z")

</div>

Hi,

how can I get consistent normal vectors for each point from triangle strips (after applying vtkStripper filter)?

Thank’s in advance

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [August 10, 2020, 2:11pm UTC](https://discourse.slicer.org/t/compute-consistent-normal-vectors-from-triangle-strips/12926/2 "2020-08-10T14:11:26Z")

</div>

`vtk.vtkPolyDataNormals` can compute normals, and has an option to make normals consistent.

---

<div class="post-metadata">

**Author:** ![loubna](https://avatars.discourse-cdn.com/v4/letter/l/cab0a1/32.png) [@loubna](https://discourse.slicer.org/u/loubna)\
**Post date:** [August 10, 2020, 2:12pm UTC](https://discourse.slicer.org/t/compute-consistent-normal-vectors-from-triangle-strips/12926/3 "2020-08-10T14:12:39Z")

</div>

Thank you very much for answer

---

<div class="post-metadata">

**Author:** ![loubna](https://avatars.discourse-cdn.com/v4/letter/l/cab0a1/32.png) [@loubna](https://discourse.slicer.org/u/loubna)\
**Post date:** [August 11, 2020, 9:12am UTC](https://discourse.slicer.org/t/compute-consistent-normal-vectors-from-triangle-strips/12926/4 "2020-08-11T09:12:31Z")

</div>

Hi Mr;

I have tried compute normal vectors by turning on some features to ensure the consistency and good orientation but It seems normals are oriented in wrong direction when incorporate them in my reconstrution method.

After converting contours to Ribbon model I have Apply vtkStripper filter to get triangles strips then I have applied vtkPolyDataNormals to get PointNormals like this:

vtkSmartPointer normalGenerator = vtkSmartPointer::New();  
normalGenerator-\>SetInputData(polydata);  
normalGenerator-\>ConsistencyOn();  
normalGenerator-\>ComputePointNormalsOn();  
normalGenerator-\>SetFlipNormals(0);  
normalGenerator-\>SetSplitting(0);  
normalGenerator-\>SetAutoOrientNormals(0);  
normalGenerator-\>SetNonManifoldTraversal(1);  
// normalGenerator-\>ComputeCellNormalsOff();  
normalGenerator-\>Update();

Is there another method to compute normals from triangles strips (ribbons) without passing by constructing binary labelMap? Or is it possible to construct binary labelMap from Ribbon then using vtkProbe filter to attribut consistent normals to Ribbon Model points?

thank’s in advance

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [August 11, 2020, 1:23pm UTC](https://discourse.slicer.org/t/compute-consistent-normal-vectors-from-triangle-strips/12926/5 "2020-08-11T13:23:43Z")

</div>

It is only possible to compute consistent normals for closed, watertight mesh - not for a set of ribbons.
