# Help with 3D plot of displaced surface

**URL:** https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033
**Category:** ParaView Support
**Created:** [February 27, 2024, 9:27am UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033 "2024-02-27T09:27:14Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![egomezp2002](https://discourse.paraview.org/user_avatar/discourse.paraview.org/egomezp2002/32/13749_2.png) [@egomezp2002](https://discourse.paraview.org/u/egomezp2002)
#### Post date: [February 27, 2024, 9:27am UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/1 "2024-02-27T09:27:14Z")

</div>

Hey, there.

I just ran across this discussion, I feel I’m having the same problem mentioned here. I obtained some displacements in FEniCS and I’d like to have a 3dimensional plot with Paraview. I already have my 2d solution:

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

I tried by changing Surface to Volume but I get a void

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

Is this the correct way to go?

Thanks!

---

<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: [February 27, 2024, 9:28am UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/2 "2024-02-27T09:28:15Z")

</div>

Please share your data

---

<div class="post-metadata">

### Author: ![egomezp2002](https://discourse.paraview.org/user_avatar/discourse.paraview.org/egomezp2002/32/13749_2.png) [@egomezp2002](https://discourse.paraview.org/u/egomezp2002)
#### Post date: [February 27, 2024, 9:30am UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/3 "2024-02-27T09:30:31Z")

</div>

Excuse me, I’m new to this. Do you mean my .pvd?

---

<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: [February 27, 2024, 9:31am UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/4 "2024-02-27T09:31:10Z")

</div>

your .pvd, but also other files associated with it, most likely .vtp, .vtu files…

---

<div class="post-metadata">

### Author: ![egomezp2002](https://discourse.paraview.org/user_avatar/discourse.paraview.org/egomezp2002/32/13749_2.png) [@egomezp2002](https://discourse.paraview.org/u/egomezp2002)
#### Post date: [February 27, 2024, 9:32am UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/5 "2024-02-27T09:32:49Z")

</div>

[displacements.pvd](https://discourse.paraview.org/uploads/short-url/5jkk8sOLU03nIIT1FuoyxpbEz9X.pvd) (175 Bytes)  
[displacements000000.vtu](https://discourse.paraview.org/uploads/short-url/1glfi3HpDEQZqygghuCtvaRwtOM.vtu) (4.3 KB)

This should do. Thanks!

---

<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: [February 27, 2024, 9:34am UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/6 "2024-02-27T09:34:07Z")

</div>

Your data is a 2D plane, you cant Volume render a plane:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/0/058b4c7c582190cdfa8ec0ea27b28f53ad029f0c.png)

---

<div class="post-metadata">

### Author: ![egomezp2002](https://discourse.paraview.org/user_avatar/discourse.paraview.org/egomezp2002/32/13749_2.png) [@egomezp2002](https://discourse.paraview.org/u/egomezp2002)
#### Post date: [February 27, 2024, 9:36am UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/7 "2024-02-27T09:36:03Z")

</div>

I implemented a small code in Python for another FEniCS program that I’m working on. In this case, It was easier to use numpy to obtain the displacements (see figure). My idea was to have something similar to this in Paraview. Is that possible?

 ![RN M3 Sigmarz](https://discourse.paraview.org/uploads/default/original/2X/a/ab67b1ec654897448acb5dcdbe1b39d172f1bb3b.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: [February 27, 2024, 9:44am UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/8 "2024-02-27T09:44:07Z")

</div>

> [@egomezp2002](#):
>
> My idea was to have something similar to this in Paraview. Is that possible?

This has nothing to do with volume rendering, its a 3D plot.

In any case, yes, you can create such rendering in ParaView although 3D plots is not what ParaView excels at.

However your data does not contain the data needed to create such a plot, but here is an example:

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

---

<div class="post-metadata">

### Author: ![egomezp2002](https://discourse.paraview.org/user_avatar/discourse.paraview.org/egomezp2002/32/13749_2.png) [@egomezp2002](https://discourse.paraview.org/u/egomezp2002)
#### Post date: [February 27, 2024, 1:05pm UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/9 "2024-02-27T13:05:46Z")

</div>

What else would I need to do this in Paraview? Which files? Thanks again

---

<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: [February 27, 2024, 1:34pm UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/10 "2024-02-27T13:34:36Z")

</div>

Its all about data. ParaView can create a 3D plot from a planar data if you have vectors that are orthogonal to the plane. This is not the case in the data you shared.

---

<div class="post-metadata">

### Author: ![egomezp2002](https://discourse.paraview.org/user_avatar/discourse.paraview.org/egomezp2002/32/13749_2.png) [@egomezp2002](https://discourse.paraview.org/u/egomezp2002)
#### Post date: [February 27, 2024, 3:38pm UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/11 "2024-02-27T15:38:06Z")

</div>

Okay, I think I have to read more on the implementation of this 3D plot. Thanks a lot!!

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [February 27, 2024, 7:22pm UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/12 "2024-02-27T19:22:16Z")

</div>

> [@mwestphal](#):
>
> However your data does not contain the data needed to create such a plot, but here is an example:

You data does have a “Displacement” vector data array. However, all the displacements appear to be in the plane of the data:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/6/6633d1a9202dd5b6cc76aaa6bd236ccf9a6d965f.jpeg)

The [**Warp By Vector**](https://docs.paraview.org/en/latest/UsersGuide/filteringData.html#warp-by-vector) filter works fine on your data, it just produces a shift of the points in the negative x direction:

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

Note that there is also a [**Warp By Scalar**](https://docs.paraview.org/en/latest/UsersGuide/filteringData.html#warp-by-scalar) filter if your data has only a single component (i.e., it is scalar data). It warps along a direction you define by a magnitude proportional to the scalar component.

---

<div class="post-metadata">

### Author: ![egomezp2002](https://discourse.paraview.org/user_avatar/discourse.paraview.org/egomezp2002/32/13749_2.png) [@egomezp2002](https://discourse.paraview.org/u/egomezp2002)
#### Post date: [February 27, 2024, 7:55pm UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/13 "2024-02-27T19:55:34Z")

</div>

As far as I’m concerned right now, when I completely end my implementation on FEniCS, displacements should be a 2 components vector, being u=(ux, uy). This displacements should NOT be in the same plane that the 2D region is defining.

So, in theory, I could use warp by vector to obtain this “3d” plot, should that be correct?

Thanks!!

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [February 27, 2024, 9:27pm UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/14 "2024-02-27T21:27:30Z")

</div>

> [@egomezp2002](#):
>
> So, in theory, I could use warp by vector to obtain this “3d” plot, should that be correct?

Should work, I think, but you’ll need to create a 3-component vector, which you can do with the **Calculator** filter and an expression like `jHat*u_X + kHat*u_Y` - it’s not clear to me how your 2-component vectors are oriented with respect to the 3D space.

---

<div class="post-metadata">

### Author: ![egomezp2002](https://discourse.paraview.org/user_avatar/discourse.paraview.org/egomezp2002/32/13749_2.png) [@egomezp2002](https://discourse.paraview.org/u/egomezp2002)
#### Post date: [February 27, 2024, 9:46pm UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/15 "2024-02-27T21:46:20Z")

</div>

I think I get It. I’ll come back if I need It. Thanks to both of you.

---

<div class="post-metadata">

### Author: ![egomezp2002](https://discourse.paraview.org/user_avatar/discourse.paraview.org/egomezp2002/32/13749_2.png) [@egomezp2002](https://discourse.paraview.org/u/egomezp2002)
#### Post date: [February 29, 2024, 11:06am UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/16 "2024-02-29T11:06:51Z")

</div>

Hello again.

As I mentioned, I kept implementing my FEniCS solution. Now, displacements should be a vector that is not contained in the plane of the data.

With your information, I managed to use warp by vector, but I think I’m not doing it right:

(See figure) Displacements are in the same plane of the data, but they should not be. I am unsure if it is a problem with the displacements information or if it is a problem with how I’m using paraview.

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

The only thing I did was applying the warp by vector filter on the displacements information. I also add here my new pvd and vtu, as a working example.

Thanks once again.

[displacements.pvd](https://discourse.paraview.org/uploads/short-url/5jkk8sOLU03nIIT1FuoyxpbEz9X.pvd) (175 Bytes)  
[displacements000000.vtu](https://discourse.paraview.org/uploads/short-url/5gU7Lc6D20JQTvrxj25GUGewbms.vtu) (296.0 KB)

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [February 29, 2024, 11:41am UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/17 "2024-02-29T11:41:16Z")

</div>

ParaView can only do things with the data you provide it. As I mentioned earlier in this thread, you will likely need to use a **Calculator** filter to change your 2D displacement into a 3D displacement to displace the surface out of the plane.

---

<div class="post-metadata">

### Author: ![egomezp2002](https://discourse.paraview.org/user_avatar/discourse.paraview.org/egomezp2002/32/13749_2.png) [@egomezp2002](https://discourse.paraview.org/u/egomezp2002)
#### Post date: [February 29, 2024, 11:44am UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/18 "2024-02-29T11:44:05Z")

</div>

Yes! Using jHat and kHat. Can I ask for more information about this? Maybe an example, or any documentation on this. Thanks.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [February 29, 2024, 11:49am UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/19 "2024-02-29T11:49:17Z")

</div>

[https://docs.paraview.org/en/latest/UsersGuide/filteringData.html#calculator](https://docs.paraview.org/en/latest/UsersGuide/filteringData.html#calculator)

Set your expression to something like (I don’t know what components you need to map to the X, Y, and Z dimensions) `Displacement_X*jHat + Displacement_Y*kHat`.

`jHat` is the unit vector in Y and `kHat` is the unit vector in Z, so the expression above corresponds to:

Displacement\_X\*(0, 1, 0) + Displacement\_Y\*(0, 0, 1) = (0, Displacement\_X, 0) + (0, 0, Displacement\_Y) = (0, Displacement\_X, Displacement\_Z)

---

<div class="post-metadata">

### Author: ![egomezp2002](https://discourse.paraview.org/user_avatar/discourse.paraview.org/egomezp2002/32/13749_2.png) [@egomezp2002](https://discourse.paraview.org/u/egomezp2002)
#### Post date: [February 29, 2024, 11:53am UTC](https://discourse.paraview.org/t/help-with-3d-plot-of-displaced-surface/14033/20 "2024-02-29T11:53:22Z")

</div>

Okay! I’ll focus on the documentation and implement it. Thanks once again.
