Resample With Dataset on thin surfaces

Dear all,

I am working with Paraview to post-process some data coming from OpenFOAM runs.
I am comparing the results coming from different geometries in paraview, using the Resample With Dataset on some vtp files. It works fine unless the mapping is performed on very narrow surfaces (for example the two sides of a thin plate). In this case it appears that, on some points, the mapping is executed using the points on the other side of the surface.

I am having this problem with pv 5.7, while previous release like 5.2 worked fine. Could anyone help me with this? Below you will find a snapshot of the mapping performed.

Thanks in advance.

Using operations like Resample With Dataset on surfaces is always tricky. The problem is that a sampling point is never exactly “in” a surface due to imprecision in floating point numbers. Thus, Resample With Dataset needs to find surfaces within some small region.

If you have two surfaces separated by a very small distance, it becomes ever more difficult to determine whether the sample point is supposed to belong to one surface, the other surface, or neither surface.

Resample With Dataset attempts to pick a tolerance region automatically based on your data, but it might get it wrong. Try turning on the advanced properties of Resample With Dataset and uncheck the Compute Tolerance option. You will then be able to enter your own Tolerance value to try to get the filter to pick values on the correct surface.

1 Like

Hi Kenneth, thanks for your contribution.
The image I showed is obtained using a tolerance set by me. Different tolerances give different results, but none of them is satisfying. As mentioned in the first post, this method was working just fine in pv5.2. Any change since then?

Or is there any way to consider the normals of the faces during the mapping?

Thanks

I wasn’t involved in the development of this, so I don’t know the details. It looks like the implementation of the Resample With Dataset filter was changed around that time (c.f. MR !968). It looks like there is an old version of the filter hiding around in the library that is not exposed in the GUI. You could try reverting to it by using the Python shell.

input1 = FindSource('Input1') # Pipeline object with fields to sample
input2 = FindSource('Input2') # Pipeline object with mesh to sample with
resampleWithDataset1 = LegacyResampleWithDataset(Input=input1, Source=input2)

@utkarsh.ayachit, maybe you know more about this transition, or perhaps can forward this on to Sujin who I think did the change.

As Ken mentioned, the code for ResampleWithDataSet has gone through several changes, but I don’t think your use case was ever explicitly handled by the filter. If it worked before, it was probably just a coincidence. I think it should work if you set the tolerance to be much less than the distance between the two surfaces. If it is still not working, could you please file an issue on gitlab (https://gitlab.kitware.com/paraview/paraview/-/issues)?

Currently, there is no way to perform the resampling based on surface normals, but depending on your use case, the two surfaces could be split into two datasets using some filter, perform the resampling on the surfaces separately and then merge the results.

@Kenneth_Moreland i tried with the Legacy version as well, the result did not change.
@sujin the main problem in my case is that the dimension of the faces on the surfaces is greater than the distance of the surfaces. This is why I assume that the filter, on some points, is mapping from the other side of the wall.

I am now trying to code a programmable filter in order to account for the normals orientation. Is there any other way to solve this problem?

Thanks

I cannot think of a better way.

Came across this thread while dealing with my own Resample With Dataset issues…

Just a random suggestion, but maybe use a Transform filter to morph one of your datasets in order to reduce the distance between surfaces, apply the Resample, then transform it back?