# Compare Geometries

**URL:** https://discourse.paraview.org/t/compare-geometries/2266
**Category:** ParaView Support
**Tags:** vtk
**Created:** [July 19, 2019, 11:49am UTC](https://discourse.paraview.org/t/compare-geometries/2266 "2019-07-19T11:49:34Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Terry](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/b9e5f3/32.png) [@Terry](https://discourse.paraview.org/u/Terry)
#### Post date: [July 19, 2019, 11:49am UTC](https://discourse.paraview.org/t/compare-geometries/2266/1 "2019-07-19T11:49:34Z")

</div>

Hi there,  
I have vtk files representing the interface of two-phase simulations (openFoam) and want to compare their geometric parameters. What I hope to see is a reprensentation of their difference over time (video).

So far everything I found was only useable on two datasets with the same underlying geometrie.  
Kind regards,  
Terry

---

<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: [July 19, 2019, 1:53pm UTC](https://discourse.paraview.org/t/compare-geometries/2266/2 "2019-07-19T13:53:07Z")

</div>

You could try to use **Resample with Dataset** to resample the data arrays from one dataset to the other to get them onto a common underlying geometry.

---

<div class="post-metadata">

### Author: ![Terry](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/b9e5f3/32.png) [@Terry](https://discourse.paraview.org/u/Terry)
#### Post date: [July 19, 2019, 1:54pm UTC](https://discourse.paraview.org/t/compare-geometries/2266/3 "2019-07-19T13:54:27Z")

</div>

Thanks, I will try that.

---

<div class="post-metadata">

### Author: ![Terry](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/b9e5f3/32.png) [@Terry](https://discourse.paraview.org/u/Terry)
#### Post date: [July 20, 2019, 6:16am UTC](https://discourse.paraview.org/t/compare-geometries/2266/4 "2019-07-20T06:16:42Z")

</div>

I tried Resample with Dataset and it doesn’t seem to be what I need.  
I do not need the difference of the field of my dataset but the difference between the geometrie (surface, mesh…).

Or maybe I just do it all wrong…  
Maybe I should first create a field out of the geometry, for example with the Elevation Filter, use Resample with Dataset after and compare the Elevation? I will try that.

–edit1-- No, that did not work either.

–edit2-- Seems like vtkDistancePolyDataFilter might be what I need!

---

<div class="post-metadata">

### Author: ![Terry](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/b9e5f3/32.png) [@Terry](https://discourse.paraview.org/u/Terry)
#### Post date: [July 20, 2019, 8:02am UTC](https://discourse.paraview.org/t/compare-geometries/2266/5 "2019-07-20T08:02:35Z")

</div>

-edit–  
Thie code i tried for vtkDistancePolyDataFilter:  
import vtk  
model1=inputs[0].VTKObject  
model2=inputs[1].VTKObject  
df=vtk.vtkDistancePolyDataFilter()  
df.SetInputData(0,model2)  
df.SetInputData(1,model1)  
df.Update()  
self.GetOutput().ShallowCopy(df.GetOutput())

I think I am close enough now. I can now compare two interfaces written out by openFoam as vtk. If anyone knows a better way please share.

Kind regards,  
Terry
