Exporting color maps of compared meshes/point clouds

Feel free to ask any question here
Post Reply
meshdifferencing
Posts: 9
Joined: Tue May 21, 2019 5:36 pm

Exporting color maps of compared meshes/point clouds

Post by meshdifferencing »

I've been doing some comparisons between similar meshes, and the result shown in CloudCompare is excellent, and almost exactly what I need. when I compare two meshes, the resulting compared mesh highlights the differences in a bright green color.

However, when I try to view the mesh in an external viewer or after I try to import it into Unity, it appears without the colors that I could see when viewing the mesh in CloudCompare.

Is there a way to save the mesh so that the colors appear when viewed on an app that's not CloudCompare? Are there any file formats that enable you to save this color map of differences between meshes once they are compared using the 'compute cloud/mesh distance''?

CloudCompare v2.10.2
Windows 10
Currently using .obj file format, could change to another file format if it allows me to do what I need
daniel
Site Admin
Posts: 7479
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Exporting color maps of compared meshes/point clouds

Post by daniel »

It's because the colors you see are fake distances that are dynamically applied to the distance values (scalar field). And these distances are not exported when you save the mesh as a file (because almost no format support scalar fields sadly...).

Note that as the colors are dynamically applied by CloudCompare, you can change the ways they are applied (they are several ways to do so, but the most complete is: https://www.cloudcompare.org/doc/wiki/i ... es_Manager)

Now to solve your issue... it won't be easy. You can convert the scalar field values (and the current display parameters) to RGB colors (Edit > Scalar field > Convert to RGB). This will give at least RGB colors to each vertex of the mesh. And then you have to chose a mesh format that support that! In effect I believe there's only PLY or FBX...
Daniel, CloudCompare admin
meshdifferencing
Posts: 9
Joined: Tue May 21, 2019 5:36 pm

Re: Exporting color maps of compared meshes/point clouds

Post by meshdifferencing »

Thank you for your insightful response, I really appreciate it.

I converted the scalar field values to RGB colors as you said, and tried saving it to all the various FBX file formats as well as PLY. However, when I tried viewing them in Windows 3D viewer or Unity, I still only see the original colors, from before the new colors were applied.

Do I have to bake the vertex colors into a texture map in order to get the result I desire?

Or alternatively, I noticed that I can save the 'vertices' file, which is a point cloud with all the correct colors, as a .las file. Is it possible to convert this .las file to a mesh that would have the correct colors?

Thanks again for the help.
meshdifferencing
Posts: 9
Joined: Tue May 21, 2019 5:36 pm

Re: Exporting color maps of compared meshes/point clouds

Post by meshdifferencing »

I've managed to figure out how to get vertex colors to display in Unity; you have to write some code to create a custom shader which must then be applied to the material which will be attached to your 3D mesh (.fbx format).

I'm however having trouble with the Color Scales Manager. When I change the current color scale and move the sliders and click apply, nothing seems to change on my mesh.

How do I make it so that when two meshes are aligned and compared:

- objects that are present in the compared mesh and absent from the reference mesh are shown in a certain color, for example green
- objects that are absent in the compared mesh and present in the reference mesh are shown in a different color, for example red

Thanks again, Daniel
daniel
Site Admin
Posts: 7479
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Exporting color maps of compared meshes/point clouds

Post by daniel »

You have to assign this color scale to the distance scalar field (via the mesh options). You can also spawn the 'Color Scale Manager' dialog directly from the scalar field properties (with the small gear icon next to the field where you select the color scale). This will tie the dialog with the scalar field. This way the display will be updated when you click on 'Apply'.

Once created (and saved) you can apply the same color scale to several entities.
Daniel, CloudCompare admin
amerh82
Posts: 2
Joined: Fri Jul 12, 2019 6:35 pm

Re: Exporting color maps of compared meshes/point clouds

Post by amerh82 »

hi, i have an 3d object fbx and a texture for this model, i know how to convert this object into point cloud but how can i make the point cloud have the texture of the object ?
daniel
Site Admin
Posts: 7479
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Exporting color maps of compared meshes/point clouds

Post by daniel »

Which point cloud?

I'll try to guess: you can't associate a "texture" file to a cloud, but you can sample a point cloud on the mesh (Edit > Mesh > Sample points) and the resulting cloud will be colored with the texture info.
Daniel, CloudCompare admin
Post Reply