Let’s say I have a simple mesh with points on it. I want to color this mesh according to a value coresponding to the X,Y,Z coordinates of this points. How can I do that? Basically it is like coloring the hight, but instead of hight we need to color another atribute. Namelly Cp value.
Here’s a way to apply the colours based on the boundingbox of the mesh. I.e. the red, green, and blue components are normalised to always go from minimum to maximum.
Here is a visual example of exactly what I want to do. I have a table with coordinates and corresponding values:
X Y Z Value
|-55.1234|43.4541|16.0733|0.656874|
|55.1221|43.4567|16.0738|0.429775|
|-56.2218|43.4781|16.0726|0.333916|
|56.2198|43.4768|16.0727|0.635001|
|58.3018|69.5851|15.3748|0.032365|
|-58.3015|69.5849|15.3748|-0.0997031|
|15.2787|43.5949|15.4692|0.814485|
|-15.2788|43.5949|15.4692|0.726578|
|-12.8615|43.592|15.846|0.934393|
|12.8613|43.5919|15.846|0.2255057|
The mesh you posted contains 2887 vertices, the csv file you posted contains 2778 measurements. They cannot be matched up 1:1.
If they could, then you’ll have to use the Deconstruct Mesh component to get the vertices of your original mesh, then the Closest Point component to figure out which of the vertices in the mesh was closest to your parsed coordinate. You can then use the indices of this closest point search to sort your colours into the correct order and use Mesh colours once again to apply them.
Actually it’s easier. Assuming you have a list of 2887 points + colours, you then useClosest Point the other way around and you can extract the correct colour directly using List Item. No sorting required.
Yes! This absolutely did the trick! And you are right, the point number have to be greater in the analysed mesh. My friend, you are brilliant! Thank you so much for your amazing help!
Final problem. I need to output in a Panel the Cp values for the original coordinates. After closest point, I am guessing that the points from my original mesh and the mesh from the analysis are paired. Now I just need the points from the analysed mesh to send the Cp values to the point of the original mesh.
You should only have a single mesh now, the one from the dxf file. You can use Closest Point to find which measurement in your csv file relates to each vertex. Whether you then use that index to get the associated colour, or whether you use it to get the associated value is the same operation. You just have to hook it up to the fourth output of the List Item component instead of the Gradient object.