Color mesh elements according to point cloud dataset.

Hello everybody.

I’m quite new to Paraview and I’m having trouble finding a solution to my issue. I have two separate files, one with the mesh (it’s a 2D quadrilateral mesh, and I’m currently working with a .stl file, but could produce other formats if that was helpful) and another with the simulation results. The result datasets are point clouds with a scalar value (pressure), and the points are located at the center of the mesh elements.

What I want to do is to color each mesh element according to the result value of the point at the center of said mesh element.

Thank you very much!

Hi @santiagoea01,

Welcome to the ParaView discourse!

Have you tried the “Resample With Dataset” filter in ParaView? If you take your point cloud as the source data set and your mesh as the destination data set it should perform the transport operation you are describing here. If it does not work on the first try, try playing with the tolerance settings for better results seeing as your destination mesh seems to be 2D.

Hope that helps!

Best regards,

Julien

Actually, I don’t think Resample With Dataset is going to work with a point cloud like this. For that to work, you would first have to apply the Point Volume Interpolator to construct a volume from the point cloud.

However, from your description, that is still not going to do exactly what you are asking. As the name implies, the cloud values are going to be interpolated to the points of your mesh rather than grabbing the color from the centroid point. I cannot think of an easy way to find point for each quadrilateral centroid, but there is a trick you can use if both of the following conditions are met.

  1. The number of quadrilaterals matches exactly the number points in your cloud.
  2. The order of the quadrilaterals in the stl file is exactly the order of the points in your cloud.

To combine the two, you first have to make sure that the scalar value is actually cell data. That is easily done by applying the Convert to Point Cloud and setting Cell Generation Mode to Vertex cells. Then run the Point Data to Cell Data filter.

After that, you can use the Append Attributes filter to pull the point cloud data into the mesh data. Be warned though that the Append Attributes filter is a little janky because it assumes that the mesh structure for both inputs are the same. You may have to play with the input order a bit to get it to output the mesh structure instead of the points.

All that said, it might be easier if your simulation just wrote out something like a .vtk file that wrote out the quadrilaterals and the pressure data in the same file.