# Clarification about quad node ordering

**URL:** https://discourse.vtk.org/t/clarification-about-quad-node-ordering/10023
**Category:** Development
**Created:** [November 30, 2022, 4:10pm UTC](https://discourse.vtk.org/t/clarification-about-quad-node-ordering/10023 "2022-11-30T16:10:02Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![philippeVerney](https://discourse.vtk.org/user_avatar/discourse.vtk.org/philippeverney/32/2484_2.png) [@philippeVerney](https://discourse.vtk.org/u/philippeVerney)
#### Post date: [November 30, 2022, 4:10pm UTC](https://discourse.vtk.org/t/clarification-about-quad-node-ordering/10023/1 "2022-11-30T16:10:02Z")

</div>

Hi all,

Looking at the [vtkQuad documentation](https://vtk.org/doc/nightly/html/classvtkQuad.html#details), I can read:

> vtkQuad is defined by the four points (0,1,2,3) in counterclockwise order

I am wondering what “in counterclockwise order” formally/rigorously means.  
Indeed, when we look at [the associated figure](https://raw.githubusercontent.com/Kitware/vtk-examples/gh-pages/src/Testing/Baseline/Cxx/GeometricObjects/TestLinearCellDemo.png), it is obvious that we see 0 1 2 3 vertices of the quad in counterclockwise order.  
However, what if I go behind (and not front of) my screen. If I could see my screen from behind, the same exact quad vertices would now be clockwise ordered. And of course, this quad would still be valid…

Then, I cannot understand what really mans this constraint especially regarding [vtkTriangle definition](https://vtk.org/doc/nightly/html/classvtkTriangle.html#details) which does not state anything about node ordering.

PS : this report may be related to [this other one](https://discourse.vtk.org/t/bug-in-documentation-figure-on-wedge-node-ordering/9946/1).

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [November 30, 2022, 10:36pm UTC](https://discourse.vtk.org/t/clarification-about-quad-node-ordering/10023/2 "2022-11-30T22:36:30Z")

</div>

> [@philippeVerney](#):
>
> However, what if I go behind (and not front of) my screen. If I could see my screen from behind, the same exact quad vertices would now be clockwise ordered. And of course, this quad would still be valid…

Yes. Because the surface normal is now pointing away from you rather than towards you.

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [December 1, 2022, 5:30am UTC](https://discourse.vtk.org/t/clarification-about-quad-node-ordering/10023/3 "2022-12-01T05:30:54Z")

</div>

Just to build on what @toddy said, the point ordering is critical as you know.  
When you look at the surface, if the normal is pointing directly towards you then ordering has to be anticlockwise.

I’ll be putting up a change to [LinearCellDemo](https://kitware.github.io/vtk-examples/site/Cxx/GeometricObjects/LinearCellDemo/) and the Python version. I noticed that the ordering in the triangle strip example there is in fact clockwise! I will also add a few (commented out) lines that, if uncommented, will show the back face.

---

<div class="post-metadata">

### Author: ![philippeVerney](https://discourse.vtk.org/user_avatar/discourse.vtk.org/philippeverney/32/2484_2.png) [@philippeVerney](https://discourse.vtk.org/u/philippeVerney)
#### Post date: [December 1, 2022, 8:36am UTC](https://discourse.vtk.org/t/clarification-about-quad-node-ordering/10023/4 "2022-12-01T08:36:14Z")

</div>

> [@amaclean](#):
>
> When you look at the surface, if the normal is pointing directly towards you then ordering has to be anticlockwise.

This was the clarification I wanted to get, thanks. The [vtkQuad documentation](https://vtk.org/doc/nightly/html/classvtkQuad.html#details) does not state anything about the normal pointing towards me or not.  
Should I report a bug or do you think that the documentation is enough for the VTK documentation lamda readers?

I guess this rule is generalized to all polygons in VTK?

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [December 1, 2022, 12:19pm UTC](https://discourse.vtk.org/t/clarification-about-quad-node-ordering/10023/5 "2022-12-01T12:19:58Z")

</div>

The documentation should state that a right-hand rule is used to determine the direction of the surface normal.
