Search code examples
3dinterpolationpoint-clouds

How to interpolate color of a irregular point cloud from values only given to a few points?


I have a 3D model which is a bust (so an irregular shape), I also have taken measurements of the composition (XRF) at random points over the surface of the object (I know where they are from reference photos). I would like to:

a) select/isolate the vertex on the 3D model which represents the closest to where they XRF measurement was taken, and assign a value to it from the data. There are not so many of these so I can do this manually. The main question is:

b) create a color ramp based on the values assigned to the vertices (n = 20 out of the 2 million vertices for the model) and interpolate the color of all of the rest of the vertices based on these values. So essentially I would show differences in elemental composition over the surface of the object.

What I would like to achieve would look somewhat like:

example

I am happy to use any software or language which would achieve this. I assume I'm looking for some form of interpolation tool that also allows for a variable search radius. The ability to interpolate the colors on the point cloud is enough, I can create a mesh/texture from there with MeshLab.


Solution

  • I achieved this using the pyvista interpolate tool https://docs.pyvista.org/examples/01-filter/interpolate.html and from there could export a vtk that could be opened elsewhere