# Unsymmetric contour rendered by symmetric data

**URL:** https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118
**Category:** ParaView Support
**Tags:** vtk
**Created:** [April 20, 2020, 2:32am UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118 "2020-04-20T02:32:25Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Jingle](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@Jingle](https://discourse.paraview.org/u/Jingle)
#### Post date: [April 20, 2020, 2:32am UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/1 "2020-04-20T02:32:25Z")

</div>

Hi all,

I’m a green hand of Paraview. I have a test dataset (UNSTRUCTURED\_GRID) that is symmetic about the x axis, however the contour is unsymmetric rendered by Paraview. I am puzzled and can’t find out the reason. The followings are the contour and dataset:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/1/1cf655abd1eb303fb4a077cc6f8882e8a15ed4ec.png)  
[test.vtk](https://discourse.paraview.org/uploads/short-url/hpn3z4Yz2vygMSuNGtqvJYX4E93.vtk) (358 Bytes)

---

<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: [April 20, 2020, 2:56am UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/2 "2020-04-20T02:56:56Z")

</div>

I do not see any not symmetric things here, can you point it out ?

---

<div class="post-metadata">

### Author: ![Jingle](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@Jingle](https://discourse.paraview.org/u/Jingle)
#### Post date: [April 20, 2020, 3:08am UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/3 "2020-04-20T03:08:45Z")

</div>

In my understanding, a symmetric contour should be like this:

 ![Symmetric pattern](https://discourse.paraview.org/uploads/default/original/2X/1/1d83aa3688ef81c4d93c7cc052c0adef4b5d3964.png)

---

<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: [April 20, 2020, 3:19am UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/4 "2020-04-20T03:19:13Z")

</div>

Ok, got it.

Well you would need to share your original dataset for us to try and reproduce the problem.

---

<div class="post-metadata">

### Author: ![Jingle](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@Jingle](https://discourse.paraview.org/u/Jingle)
#### Post date: [April 20, 2020, 3:23am UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/5 "2020-04-20T03:23:01Z")

</div>

Thanks a lot. This is my original dataset:

```
 # vtk DataFile Version 3.0
 StrainSum
ASCII
DATASET UNSTRUCTURED_GRID
POINTS 8 float
-1	-4 0
 1	-4 0
-1	-2 0
 1	-2 0
-1 2 0
 1 2 0
-1 4 0
 1 4 0

CELLS 2 10
    4 0 1 3 2
    4 4 5 7 6
		
CELL_TYPES 2
9
9

Point_DATA 8
SCALARS StrainSum_xx float
LOOKUP_TABLE custom_table_1
0
1
1
0
1
0
0
1

```

Also in attachment:  
[test.vtk](https://discourse.paraview.org/uploads/short-url/hpn3z4Yz2vygMSuNGtqvJYX4E93.vtk) (358 Bytes)

---

<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: [April 20, 2020, 3:25am UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/6 "2020-04-20T03:25:27Z")

</div>

Your dataset is just not symmetric.

It should read.

```
0
1
1
0
0
1
1
0
```

---

<div class="post-metadata">

### Author: ![Jingle](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@Jingle](https://discourse.paraview.org/u/Jingle)
#### Post date: [April 20, 2020, 3:39am UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/7 "2020-04-20T03:39:12Z")

</div>

Unlike what you said, if a dataset is symmetric about the x-axis, it should be arranged like this

 ![data interpretation](https://discourse.paraview.org/uploads/default/original/2X/1/117aa8c331ae61a6e415e149672d5101094a762a.png)  
Therefore the data should be  
0  
1  
1  
0  
1  
0  
0  
1

---

<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: [April 20, 2020, 3:43am UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/8 "2020-04-20T03:43:21Z")

</div>

my bad, this is due to the way the interpolation is done. The data is actually symmetrical.

---

<div class="post-metadata">

### Author: ![Jingle](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@Jingle](https://discourse.paraview.org/u/Jingle)
#### Post date: [April 20, 2020, 3:45am UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/9 "2020-04-20T03:45:25Z")

</div>

So what can I do to get a symmetrical contour in 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: [April 20, 2020, 3:47am UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/10 "2020-04-20T03:47:18Z")

</div>

In order to get a symmetrical visual result you would need to invert the order of the points of the second cell.

(this is not a contour in the ParaView sense, just an visual interpolation of the data on the point)

---

<div class="post-metadata">

### Author: ![Jingle](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@Jingle](https://discourse.paraview.org/u/Jingle)
#### Post date: [April 20, 2020, 5:23am UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/11 "2020-04-20T05:23:16Z")

</div>

Thanks for your suggestion.  
I’m trying to understand the way that Paraview renders the contour. It seem that Paraview render the field value by 1-D interpolation along diagonal so that you recommend to invert the order of the points.

 ![interpolation](https://discourse.paraview.org/uploads/default/original/2X/5/5d03dbb3862d1c0f27a2771dac3c88c69b615dff.png)

I’m wondering if Paraview can render the contour by 2-D interpolation so that the visual looks better, just like the following produced by python

 ![python](https://discourse.paraview.org/uploads/default/original/2X/8/8d243fd0ecf5e6fac9848295f2a79ccd78073533.png)

---

<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: [April 20, 2020, 12:03pm UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/12 "2020-04-20T12:03:04Z")

</div>

That’s a very good question, but, afaik this is not supported by ParaView yet.

---

<div class="post-metadata">

### Author: ![Jingle](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@Jingle](https://discourse.paraview.org/u/Jingle)
#### Post date: [April 20, 2020, 12:26pm UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/13 "2020-04-20T12:26:42Z")

</div>

That’s a pity. Thanks for your useful information!

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [April 20, 2020, 2:04pm UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/14 "2020-04-20T14:04:30Z")

</div>

I just wanted to add a little clarity of what is happening. ParaView is loading your data correctly, but rendering it a bit wrong. The asymmetry you are seeing is an artifact from the rendering library that ParaView is using. Just about every rendering system will take quadrilaterals and internally divide them into triangles before rendering. This is because interpolating colors/texture coordinates is a lot faster for a triangle. This is true for pretty much every OpenGL implementation I have encountered as well as the OSPRay rendering backend. This is why you are seeing that either red or blue diagonal line through the squares. You are seeing the triangles the rendering system is interpolating on.

Even though the rendering system is simplifying your data, ParaView itself will do a proper bilinear interpolation. So for example, in the following screenshot I have run the `Resample To Image` filter on your data. You can see that when a ParaView filter probes your data, you get the correct interpolation. (The blue in between is just the resample filter trying to probe the empty space between your quadrilaterals.)

 ![Capture](https://discourse.paraview.org/uploads/default/original/2X/9/930f7b26e8cc327f31e0fa903fb472850fe1e252.png)

---

<div class="post-metadata">

### Author: ![Jingle](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@Jingle](https://discourse.paraview.org/u/Jingle)
#### Post date: [April 21, 2020, 1:44am UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/15 "2020-04-21T01:44:34Z")

</div>

Thank you Moreland,  
Your comments are really constructive. I got a perfect contour following your guides.

---

<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: [April 21, 2020, 2:25am UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/16 "2020-04-21T02:25:18Z")

</div>

Thanks @Kenneth_Moreland

---

<div class="post-metadata">

### Author: ![Seweryn](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@Seweryn](https://discourse.paraview.org/u/Seweryn)
#### Post date: [April 29, 2020, 10:20am UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/17 "2020-04-29T10:20:54Z")

</div>

This thread also explains why I get the asymmetric visualization of my symmetric data. The problem is a mesh of quadrilaterals under point load which creates symmetric deformation about vertical axis in the middle. Similarly reduced Von Mieses stresses are symmetric. However due to this internal subdivision of quads into triangles the bi-linear interpolation produces wrong impression of asymmetry. See the attached screenshots of deformation (displacements) and Von Mieses stress and the data vtu file.[bous\_T1.0000000000e 00\_P1.vtu](https://discourse.paraview.org/uploads/short-url/u7EZi3e46kNbiZ0luIFoyFjxwQS.vtu) (6.8 KB)

 ![boussinesq_pv_disp_wrap_map](https://discourse.paraview.org/uploads/default/original/2X/6/6a58c4773adee6e76d79bb7d8ca177af8eaf7c6f.png)  
 ![bous_Smieses_pv](https://discourse.paraview.org/uploads/default/original/2X/9/9df2d7766d4ad5d0d4005dae97928af24fa9801f.png)

Edit: I know there are some mechanical and civil engineering software which render this kind of problems correctly. I will find and show a screenshot from a program how it should be rendered.

Edit 2: Below is the Von Mieses stress map from Cast3m software

 ![boussinesq_cast3m_Mieses_stress](https://discourse.paraview.org/uploads/default/original/2X/1/1395902bea458ec86b858af41ee9dba91e27d41d.png)

Edit 3: I found more insightful resources on the interpolation of quadrilaterals:

> **[53544051.pdf](https://core.ac.uk/download/pdf/53544051.pdf)**
>
> 1750.95 KB

  
[http://reedbeta.com/blog/quadrilateral-interpolation-part-1/](http://reedbeta.com/blog/quadrilateral-interpolation-part-1/)  
[http://reedbeta.com/blog/quadrilateral-interpolation-part-2/](http://reedbeta.com/blog/quadrilateral-interpolation-part-2/)

---

<div class="post-metadata">

### Author: ![Seweryn](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@Seweryn](https://discourse.paraview.org/u/Seweryn)
#### Post date: [May 7, 2020, 6:43pm UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/18 "2020-05-07T18:43:48Z")

</div>

Looking at what other dedicated finite element visualization software is doing with symmetric quad data I found that they seems to split a quadrilateral into _four_ triangles (instead of only two). It involves creation of additional node at the quad centroid (sum of x coordinates / 4, sum of y coordinates / 4, value at the centroid sum of values at nodes divided by four). I include here two python matplotlib scripts which illustrate this procedure.  
[quad\_2el\_paraview\_quad22tri.py](https://discourse.paraview.org/uploads/short-url/g5TryQ1IGU93tALvA7IWN0pU5NC.py) (1.5 KB)  
[quad\_2el\_paraview\_quad24tri.py](https://discourse.paraview.org/uploads/short-url/h5aeLFCTEeKxZxl73zY1SMwpaOA.py) (2.7 KB)

And below are the plots they are producing:  
 ![quad-2el-paraview_quad22tri](https://discourse.paraview.org/uploads/default/original/2X/9/92197a7ce6f3a4c00ec540d7f87972813bba670f.png)  
 ![quad-2el-paraview_quad24tri](https://discourse.paraview.org/uploads/default/original/2X/e/e609e06ebaf96008882eb9e220839544d0a896a4.png)

Perhaps in Paraview this kind of internal splitting for quadrilateral can be applied?

---

<div class="post-metadata">

### Author: ![Jingle](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@Jingle](https://discourse.paraview.org/u/Jingle)
#### Post date: [December 14, 2020, 9:43am UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/19 "2020-12-14T09:43:25Z")

</div>

Further issue:  
What if the geometry is curving? Resample filter cannot help.

---

<div class="post-metadata">

### Author: ![cricket](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/dc4da7/32.png) [@cricket](https://discourse.paraview.org/u/cricket)
#### Post date: [February 18, 2021, 4:13pm UTC](https://discourse.paraview.org/t/unsymmetric-contour-rendered-by-symmetric-data/4118/20 "2021-02-18T16:13:44Z")

</div>

I am having similar issues in VTK, described here:

[https://discourse.vtk.org/t/vtkwarpscalar-produces-hexagonal-peaks/5208/5](https://discourse.vtk.org/t/vtkwarpscalar-produces-hexagonal-peaks/5208/5)

Can someone please help me out. Greatly appreciated.
