# Scratch on unfolded cylinder

**URL:** https://discourse.paraview.org/t/scratch-on-unfolded-cylinder/10774
**Category:** ParaView Support
**Created:** [November 16, 2022, 8:43pm UTC](https://discourse.paraview.org/t/scratch-on-unfolded-cylinder/10774 "2022-11-16T20:43:10Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Marvin](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/2bfe46/32.png) [@Marvin](https://discourse.paraview.org/u/Marvin)
#### Post date: [November 16, 2022, 8:43pm UTC](https://discourse.paraview.org/t/scratch-on-unfolded-cylinder/10774/1 "2022-11-16T20:43:10Z")

</div>

Hi,

I use the following formula to unfold a cylinder  
coordsZ\*iHat+(atan(coordsX/coordsY)+(coordsY/abs(coordsY))_1.57)_(coordsX^2+coordsY^2)^(1/2)_jHat+0_kHat

The cylinder is unfolded but the rendering is not good

 ![unwrap](https://discourse.paraview.org/uploads/default/original/2X/3/32a1aa6a359cb72b269637b5d6046449657d66fe.jpeg)

Do you have any idea what could be the reason ?

Best regards,

---

<div class="post-metadata">

### Author: ![Francois\_Mazen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/francois_mazen/32/6483_2.png) [@Francois\_Mazen](https://discourse.paraview.org/u/Francois_Mazen)
#### Post date: [November 17, 2022, 1:39pm UTC](https://discourse.paraview.org/t/scratch-on-unfolded-cylinder/10774/2 "2022-11-17T13:39:35Z")

</div>

Hello @Marvin !

At a first glance, I would say that there is several elements at the same position.

Could you please share your data?

Best,

---

<div class="post-metadata">

### Author: ![Marvin](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/2bfe46/32.png) [@Marvin](https://discourse.paraview.org/u/Marvin)
#### Post date: [November 17, 2022, 7:11pm UTC](https://discourse.paraview.org/t/scratch-on-unfolded-cylinder/10774/3 "2022-11-17T19:11:54Z")

</div>

Bonjour Francois,

Thank you for your answer.

I think you are right because the problem don’t appear if I “clip” the cylinder. In this case, one part is OK but not the other one.

**Clipping :**

 ![clip](https://discourse.paraview.org/uploads/default/original/2X/a/a62873ae41587fe4be4987a215af1747340dbb8c.jpeg)

**Part OK** :

 ![flat_ok](https://discourse.paraview.org/uploads/default/original/2X/b/b8278bff2f2e2eff8fe847477cb13fed19fbfd3e.jpeg)

**Part NOK :**

 ![flat_nok](https://discourse.paraview.org/uploads/default/original/2X/5/589859dd30431dd8235bffaab0707a6d1b996aa9.jpeg)

I will prepare the data to send.

Thank you

---

<div class="post-metadata">

### Author: ![Marvin](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/2bfe46/32.png) [@Marvin](https://discourse.paraview.org/u/Marvin)
#### Post date: [November 18, 2022, 9:37am UTC](https://discourse.paraview.org/t/scratch-on-unfolded-cylinder/10774/4 "2022-11-18T09:37:44Z")

</div>

Hi !

Here is the link to download the mesh : [model](https://nextcloud.cm-en-transition.fr/s/CRJXGqyqCeDRZs5)

Thank you in advance.

---

<div class="post-metadata">

### Author: ![Francois\_Mazen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/francois_mazen/32/6483_2.png) [@Francois\_Mazen](https://discourse.paraview.org/u/Francois_Mazen)
#### Post date: [November 18, 2022, 5:57pm UTC](https://discourse.paraview.org/t/scratch-on-unfolded-cylinder/10774/5 "2022-11-18T17:57:31Z")

</div>

Looks like you have unconnected elements inside your volume. It maybe the root of the issue.

If I apply extract suface filter, then clip to see inside, I can see internal surfaces (I’ve added a slice with bold lines to emphasize the issue):

 ![image](https://discourse.paraview.org/uploads/default/original/2X/b/b3af2ad5545a271d9721a105a59569c28e79fc48.jpeg)

Could you please share your pipeline ?

Best,  
François

---

<div class="post-metadata">

### Author: ![Marvin](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/2bfe46/32.png) [@Marvin](https://discourse.paraview.org/u/Marvin)
#### Post date: [November 18, 2022, 6:57pm UTC](https://discourse.paraview.org/t/scratch-on-unfolded-cylinder/10774/6 "2022-11-18T18:57:07Z")

</div>

This part is the inlet part of an axial fan. Just after this part, you have the rotating part then an outlet zone with a “rectifier” (not sure regarding the translation).

The same issue appear on the 3 parts.

May be we see on your picture the differents areas from the decomposition ?

Best regards,

---

<div class="post-metadata">

### Author: ![Francois\_Mazen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/francois_mazen/32/6483_2.png) [@Francois\_Mazen](https://discourse.paraview.org/u/Francois_Mazen)
#### Post date: [November 29, 2022, 8:42pm UTC](https://discourse.paraview.org/t/scratch-on-unfolded-cylinder/10774/7 "2022-11-29T20:42:03Z")

</div>

The transformation looks good but the issue is that the cells are still connected (topology is preserved). It means that there are cells between the two sides of the unfolded cylinder.

One solution is to use two clip filters (one is inverted) to “cut” the cylinder, then apply the transformation with the calculator:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/8/881161d7cc73771dcd166e10e77ae96160be2b91.jpeg)

I’ve added a small offset on Y (+/-0.0001) to avoid numerical errors.

Here the associated ParaView state:  
[unfold\_cylinder.py](https://discourse.paraview.org/uploads/short-url/3N6mIt6QenQv8kbrznzP5ruwaRO.py) (9.1 KB)

Hope this helps!

Best Regards,  
François

---

<div class="post-metadata">

### Author: ![Marvin](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/2bfe46/32.png) [@Marvin](https://discourse.paraview.org/u/Marvin)
#### Post date: [November 30, 2022, 11:05am UTC](https://discourse.paraview.org/t/scratch-on-unfolded-cylinder/10774/8 "2022-11-30T11:05:58Z")

</div>

Bonjour François,

Thank you very much, it works !

 ![unfolded](https://discourse.paraview.org/uploads/default/original/2X/1/16b6e347de20e53107f3414ea02e29518d7de7ff.jpeg)

Best regards,
