# Planarity check for a hex element

**URL:** https://discourse.paraview.org/t/planarity-check-for-a-hex-element/7957
**Category:** ParaView Support
**Tags:** vtk
**Created:** [September 8, 2021, 2:32pm UTC](https://discourse.paraview.org/t/planarity-check-for-a-hex-element/7957 "2021-09-08T14:32:34Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Aditya](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/df705f/32.png) [@Aditya](https://discourse.paraview.org/u/Aditya)
#### Post date: [September 8, 2021, 2:32pm UTC](https://discourse.paraview.org/t/planarity-check-for-a-hex-element/7957/1 "2021-09-08T14:32:34Z")

</div>

Hi,

I am using Paraview for first time in order to visualize some meshes for my research project. I am primarily looking to check the mesh quality from which planarity of faces is one main quality measure. As much I could explore, warpage is used to checking the planarity of a quad face but no such direct is available in vtkmesh library of paraivew to do it for a hex element! Can anyone suggest something in this regards?

Also, I am going via a different approach to fulfill my requirement. It is as follows:

1. Applying Surface Extraction filter to mesh with default values of parameters available within it (I am not quite sure about these options).
2. Then checking the warpage of generated quad surfaces for meshes.

Although this seems to work well but obtained warpage value then is little misleading.

 ![image](https://discourse.paraview.org/uploads/default/original/2X/e/efad93fac963eaf085a7614978dae910e80eb566.png)

As you can see from the image, this is one of the plane with quite a visible warpage. Metric value as shown is around 0.036 and according to [https://www.paraview.org/Wiki/images/6/6b/VerdictManual-revA.pdf](https://www.paraview.org/Wiki/images/6/6b/VerdictManual-revA.pdf) , value between 0 and 0.7 is acceptable !!

I would be grateful if anyone can help me out with this by pointing out any mistakes I am doing or suggesting a better way of checking planarity for a hex mesh.

Regards.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [September 8, 2021, 2:45pm UTC](https://discourse.paraview.org/t/planarity-check-for-a-hex-element/7957/2 "2021-09-08T14:45:42Z")

</div>

This is a great idea for a filter to add in VTK ! I’m afraid there is no such filter yet, but adding one seems not that hard to do.

> value between 0 and 0.7 is acceptable !!

A cell should be perfectly planar for VTK rendering to not show any kind of warp.

---

<div class="post-metadata">

### Author: ![Aditya](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/df705f/32.png) [@Aditya](https://discourse.paraview.org/u/Aditya)
#### Post date: [September 8, 2021, 3:26pm UTC](https://discourse.paraview.org/t/planarity-check-for-a-hex-element/7957/3 "2021-09-08T15:26:43Z")

</div>

Thanks for the reply.

> [@mwestphal](#):
>
> A cell should be perfectly planar for VTK rendering to not show any kind of warp.

It may become difficult to inspect visually for every cell, I was referring the verdict document (mentioned in earlier post) and they talks about an acceptable range (0-0.7) of warpage. Visual inspection of a cell with least value of this metric (0.0032) for my problem shows a different behavior which is of concern for me. As you can see metric value is almost zero which is in acceptable range as per document, but visual inspection reveals a very bad warpage of face.

This is my concern that is the range given in document incorrect or the quality measure value as found by paraview ?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [September 8, 2021, 3:27pm UTC](https://discourse.paraview.org/t/planarity-check-for-a-hex-element/7957/4 "2021-09-08T15:27:40Z")

</div>

maybe @dcthomp knows about this.

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.paraview.org/u/Kenichiro-Yoshimi)
#### Post date: [September 9, 2021, 12:06pm UTC](https://discourse.paraview.org/t/planarity-check-for-a-hex-element/7957/5 "2021-09-09T12:06:30Z")

</div>

The definition of v\_quad\_warpage in VerdictManual-revA.pdf is as follows.  
q = 1 - min \{({\hat n}\_0\cdot{\hat n}\_2)^3, ({\hat n}\_1\cdot{\hat n}\_3)^3\}

On the other hand, as you can see from the implementation in the link below, the value of q is not subtracted from 1. That is, it is calculated by the following formula:  
q = min \{({\hat n}\_0\cdot{\hat n}\_2)^3, ({\hat n}\_1\cdot{\hat n}\_3)^3\}

> <https://github.com/certik/paraview/blob/master/VTK/Utilities/verdict/V_QuadMetric.cpp#L634>

Therefore, we can consider [0.3, 1.0] to be an acceptable range of warpage for a quad in ParaView.
