# vtkHexahedron node ordering question

**URL:** https://discourse.vtk.org/t/vtkhexahedron-node-ordering-question/4111
**Category:** Support
**Created:** [August 31, 2020, 2:23pm UTC](https://discourse.vtk.org/t/vtkhexahedron-node-ordering-question/4111 "2020-08-31T14:23:57Z")
**Posts on this page:** 6
**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: [August 31, 2020, 2:23pm UTC](https://discourse.vtk.org/t/vtkhexahedron-node-ordering-question/4111/1 "2020-08-31T14:23:57Z")

</div>

Hi all,

I am looking at [VTK conventions for node ordering](https://lorensen.github.io/VTKExamples/site/VTKBook/05Chapter5/#Figure%205-2) especially for vtkHexahedron.  
I am also looking at the VTK [documentation](https://vtk.org/doc/nightly/html/classvtkHexahedron.html#details) stating : **The hexahedron is defined by the eight points (0-7) where (0,1,2,3) is the base of the hexahedron which, using the right hand rule, forms a quadrilaterial whose normal points in the direction of the opposite face (4,5,6,7)**.

My question : what does “base” means? Is it the bottom face? I don’t really think it makes sens since it can be hard in some cases to define what is the bottom face (i.e. diamond orientation).

If “base” means “whatever face”, I guess that these two below hexahedra are valid from a VTK point of view. Could you confirm please?  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/e/e964e9cb48ce16eb74e6aa6d8e93c076ec0d0f48.png) vs ![image](https://discourse.vtk.org/uploads/default/original/2X/0/056a715ea41f583f0d3b082a623a7da02187c08b.png)

The same question may apply to vtkTetrahedron (and to all kinds of polyhedra which have not a single particular face based on its node count).

---

<div class="post-metadata">

### Author: ![Yohann\_Bearzi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/yohann_bearzi/32/671_2.png) [@Yohann\_Bearzi](https://discourse.vtk.org/u/Yohann_Bearzi)
#### Post date: [August 31, 2020, 4:03pm UTC](https://discourse.vtk.org/t/vtkhexahedron-node-ordering-question/4111/2 "2020-08-31T16:03:32Z")

</div>

> If “base” means “whatever face”, I guess that these two below hexahedra are valid from a VTK point of view. Could you confirm please?

Yes, those 2 hexahedra are correct. “Base” might not be the correct geometric term to describe hexahedron’s topology. All the documentation is trying to say is that to build an hexahedron, you need to have the normal of quadrilaterals 0-1-2-3 and 4-5-6-7 points outside of the hexahedron. Edges 0-4, 1-5, 2-6, 3-7 are actually not explicitly defined, we would need to at least define one of them to remove any ambiguity regarding topology.

As for tetrahedra, the whole point is to define face orientations as well. You can connect any 4 points and get a “correct tetrahedron”, however you need to force one face orientation in order to consistently infer the orientation of the whole tetrahedron, which discards any spatial combination making the tetrahedron normals “inside-out”.

---

<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: [August 31, 2020, 4:16pm UTC](https://discourse.vtk.org/t/vtkhexahedron-node-ordering-question/4111/3 "2020-08-31T16:16:27Z")

</div>

Thanks a lot for your quick and detailed answer.

First, an illustration as a reminder  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/8/8e6b810a5abf66e50f8773d6bd6dfa9168eefea2.png)

Second, just some few remarks:

> [@Yohann\_Bearzi](#):
>
> you need to have the normal of quadrilaterals 0-1-2-3 and 4-5-6-7 points outside of the hexahedron

Following Right hand rule, I think that :

- the normal of quadrilaterals 0-1-2-3 is pointing **inside**.
- the normal of quadrilaterals 4-5-6-7 is pointing outside.

> [@Yohann\_Bearzi](#):
>
> Edges 0-4, 1-5, 2-6, 3-7 are actually not explicitly defined, we would need to at least define one of them to remove any ambiguity regarding topology

Totally agree, that was another wonder on my thought which you have answered before I ask. Thanks!

---

<div class="post-metadata">

### Author: ![Yohann\_Bearzi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/yohann_bearzi/32/671_2.png) [@Yohann\_Bearzi](https://discourse.vtk.org/u/Yohann_Bearzi)
#### Post date: [August 31, 2020, 4:22pm UTC](https://discourse.vtk.org/t/vtkhexahedron-node-ordering-question/4111/4 "2020-08-31T16:22:12Z")

</div>

My mistake, your figure was actually incorrect. Quadrilateral 0-1-2-3 is not correctly oriented. If you are not sure about other `vtk3DCell` topology, you can look in the `.cxx` files where the topology of each cell is drawn in ASCII art. Just Ctrl-Find topology in the files.

---

<div class="post-metadata">

### Author: ![Yohann\_Bearzi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/yohann_bearzi/32/671_2.png) [@Yohann\_Bearzi](https://discourse.vtk.org/u/Yohann_Bearzi)
#### Post date: [August 31, 2020, 4:26pm UTC](https://discourse.vtk.org/t/vtkhexahedron-node-ordering-question/4111/5 "2020-08-31T16:26:46Z")

</div>

I got confused. Your figures were actually correct, and looking closer, the normal of 0-1-2-3 points inside, as well as normal of 7-6-5-4.

---

<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: [August 31, 2020, 4:27pm UTC](https://discourse.vtk.org/t/vtkhexahedron-node-ordering-question/4111/6 "2020-08-31T16:27:41Z")

</div>

> [@Yohann\_Bearzi](#):
>
> Your figures were actually correct, and looking closer, the normal of 0-1-2-3 points inside, as well as normal of 7-6-5-4.

Perfect, everything is now clear! Thanks again!
