Transfer Point Dataset to other Cell datatset

I have two datasets : the first one is a point data set and the second one is a dataset containing point data as well as cell data (UnStructuredGrid). It happens that the points of the first dataset are precisely the centroids of the cells of the second dataset.
And I would like to pass the data of the first dataset (data at the cell centroids of the second dataset) as celldata to the second dataset. I tried different combinations of Resample with Dataset, PointDatatoCellData, etc… The most promising seems to be :

  1. PointDatasetInterpolator (input = first dataset with the centroid data ; source = second dataset with the cells)
  2. PointDatatoCellData

But still, it is not very satisfying, especially when the field data to transfer is not continuous.
My problem is similar to that one (, except that I want to do the exact opposite : transfer data from a point cloud to an Unstructured mesh.

Any hints on how to achieve this ?


The attached Python scripts does exactly what you want.
I have created an hexahedral grid, then I have extracted its cell centers. I have added random PointData to it for the purpose of the demonstration.
That PointData array has a number of tuples equal to the number of cell centers. I can then attach it to the hexahedral grid’s CellData. (3.3 KB)

Thank you very much ! It works great.