# Point set interpolation using python vtk package

**URL:** https://discourse.paraview.org/t/point-set-interpolation-using-python-vtk-package/15625
**Category:** ParaView Support
**Tags:** vtk, python
**Created:** [October 24, 2024, 8:52am UTC](https://discourse.paraview.org/t/point-set-interpolation-using-python-vtk-package/15625 "2024-10-24T08:52:57Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![picpic](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@picpic](https://discourse.paraview.org/u/picpic)
#### Post date: [October 24, 2024, 8:52am UTC](https://discourse.paraview.org/t/point-set-interpolation-using-python-vtk-package/15625/1 "2024-10-24T08:52:57Z")

</div>

Following the question raised in https://discourse.paraview.org/t/how-to-interpolate-a-2d-point-cloud-from-vtp-with-obstacles-like-cylinders/11942, I would like to ask if there is a way to interpolate the results on a plane while preserving the obstacle area. Directly use interpolate function in scipy will lead to problem.

 ![image](https://discourse.paraview.org/uploads/default/original/2X/0/0ae0a15de4f0349bab9481d8b609d11c95332f1d.jpeg)  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/e/e22347a0e477aeb20ded6e96fdc5b81382b656e7.jpeg)

Since I only have point data, directly using the boolean operation may have influence on the interpolated result. Should I go back then recreate the mesh (previously I have mesh for the point data), and assign those points to the corresponding mesh?

---

<div class="post-metadata">

### Author: ![picpic](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@picpic](https://discourse.paraview.org/u/picpic)
#### Post date: [October 24, 2024, 9:39am UTC](https://discourse.paraview.org/t/point-set-interpolation-using-python-vtk-package/15625/2 "2024-10-24T09:39:36Z")

</div>

Any possible solution or discussion is welcomed. Thankss!

---

<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: [October 24, 2024, 11:35am UTC](https://discourse.paraview.org/t/point-set-interpolation-using-python-vtk-package/15625/3 "2024-10-24T11:35:52Z")

</div>

There is no trivial solution for this in ParaView, but could you share your data ?  
You do not have the original mesh ? Only the Point Cloud ?

---

<div class="post-metadata">

### Author: ![picpic](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@picpic](https://discourse.paraview.org/u/picpic)
#### Post date: [October 24, 2024, 2:16pm UTC](https://discourse.paraview.org/t/point-set-interpolation-using-python-vtk-package/15625/5 "2024-10-24T14:16:20Z")

</div>

Sure, I’ve attached the data and visualization script here. Actually I do have the origin mesh but the point cloud is only data extracted from a sub-region of the origin mesh, since the original data is simulated is under a larger domain. I can also package and upload my code for processing the original .vtk file later if needed.

[interp\_pv.rar](https://discourse.paraview.org/uploads/short-url/5xKsgJvJyQZWvAshyJFO9O5Tru7.rar) (2.7 MB)

---

<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: [October 25, 2024, 7:51am UTC](https://discourse.paraview.org/t/point-set-interpolation-using-python-vtk-package/15625/6 "2024-10-25T07:51:15Z")

</div>

> [@picpic](#):
>
> can also package and upload my code for processing the original .vtk file later if needed.

Yes please, your data only contains numpy data which cannot be opened with ParaView out of the box.

---

<div class="post-metadata">

### Author: ![picpic](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@picpic](https://discourse.paraview.org/u/picpic)
#### Post date: [October 26, 2024, 4:03am UTC](https://discourse.paraview.org/t/point-set-interpolation-using-python-vtk-package/15625/7 "2024-10-26T04:03:00Z")

</div>

Thanks! I’ve attached my data processing script here. [https://drive.google.com/file/d/1npAnxXD\_3CWx-x3CllO3RHG8KRHTBebF/view?usp=drive\_link](https://drive.google.com/file/d/1npAnxXD_3CWx-x3CllO3RHG8KRHTBebF/view?usp=drive_link)

---

<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: [October 28, 2024, 6:10am UTC](https://discourse.paraview.org/t/point-set-interpolation-using-python-vtk-package/15625/8 "2024-10-28T06:10:40Z")

</div>

You need to provide access

---

<div class="post-metadata">

### Author: ![picpic](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@picpic](https://discourse.paraview.org/u/picpic)
#### Post date: [October 28, 2024, 8:04am UTC](https://discourse.paraview.org/t/point-set-interpolation-using-python-vtk-package/15625/9 "2024-10-28T08:04:01Z")

</div>

Sry for trouble, I’ve updated the link. 🙂

---

<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: [October 28, 2024, 8:19am UTC](https://discourse.paraview.org/t/point-set-interpolation-using-python-vtk-package/15625/10 "2024-10-28T08:19:35Z")

</div>

Using your .vtk data it is then trivial:

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

---

<div class="post-metadata">

### Author: ![picpic](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@picpic](https://discourse.paraview.org/u/picpic)
#### Post date: [October 28, 2024, 11:56am UTC](https://discourse.paraview.org/t/point-set-interpolation-using-python-vtk-package/15625/12 "2024-10-28T11:56:24Z")

</div>

Thank you so much for your respond.

Yes, since this is the original .vtk file used for preparing the data for comparison. Now the non-trivial thing is if I update or change the value of previous point data (now I only have updated .npy data and the previous mesh structure in .vtk file), how to do the interpolation?

---

<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: [October 28, 2024, 4:18pm UTC](https://discourse.paraview.org/t/point-set-interpolation-using-python-vtk-package/15625/13 "2024-10-28T16:18:46Z")

</div>

You should be able to use ResampleWithDataSet

---

<div class="post-metadata">

### Author: ![picpic](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@picpic](https://discourse.paraview.org/u/picpic)
#### Post date: [November 7, 2024, 12:14pm UTC](https://discourse.paraview.org/t/point-set-interpolation-using-python-vtk-package/15625/15 "2024-11-07T12:14:19Z")

</div>

Thanks for your help. ‘Pointset → Delaunay3D → ResampleWithDataSet’ works for me.
