Allow to export texture from meshes

To post any request/idea for new functionalities
Post Reply
SAV
Posts: 1
Joined: Tue Jun 30, 2015 7:11 am

Allow to export texture from meshes

Post by SAV »

Hi Daniel,

I know that CloudCompare is a point-cloud-focused piece of software, but it would be nice to be able to export a mesh as an OBJ file that includes the associated JPG texture file.

For example, if I generate a mesh from a point cloud using the Poisson Surface Reconstruction plugin, it allows me to inherit the color from the point cloud. However, if I then save the textured mesh as an OBJ file, it only exports the mesh itself but not the associated texture.

Would be great if that could be added to the development list :)

Anyway, keep up the great work.

Cheers,
SAV
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Allow to export texture from meshes

Post by daniel »

Ah ah that would be cool, but this operation is far from being easy. If anyone know a third party library dedicated to this operation (converting per-vertex color to a texture) then it would be envisageable.

Or of course if someone wants to contribute to the project he/she would be gladly welcome :D

I'll add this to the TODO list anyway (EDIT: it was already there)
Daniel, CloudCompare admin
Etyop
Posts: 8
Joined: Mon Aug 01, 2022 11:21 am

Re: Allow to export texture from meshes

Post by Etyop »

Hey Daniel, sorry for bumping this old thread. Do you know if it is possible now ? Thanks.
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Allow to export texture from meshes

Post by daniel »

I am afraid nothing came up so far...
Daniel, CloudCompare admin
PablerasBCN
Posts: 296
Joined: Sat Jan 20, 2018 1:57 pm

Re: Allow to export texture from meshes

Post by PablerasBCN »

Converting vertex color to textures can be don in Meshlab.

As Daniel says it is not easy out ob the box. If your mesh is somewhat planar, like we're talking like hills terrain it will be easyer.

There are 2 steps.

1) have the mesh with correct UV mapping.
To generate texture the mesh needs texture coordinates. As said if it is a rather planar obj you'r lucky because you can simply create a top down UV mapping which is trivial in any 3d program. It may be even be possible in Meshlab.
Else you've 2 options, per face planar uv mapping which in Meshalb takes FOREVER and also creates a seams on edges bug. In other 3d programs it also takes forever if there are many polygons.
Final option for complex meshes like an statue is to have a complex UV mapping generated with something like Zbrush.

2) bake the points data to a texture. You need to import the RGB point cloud as .ply in meshlab as data source and the mesh separatelly. Then use the Vertex atribute transfer tool.

In this tutorial you can see it more step by step, also you will see the edges bug:
https://gist.github.com/shubhamwagh/0dc ... 53d0f4d66b

Notice intutorial uses other vertex property transver, you need to use the one I pointed. And choose Color, yet you can also transfer Normals or AO.
Start with small texture sizes else time scalates somewhat exponential if not log!.
PablerasBCN
Posts: 296
Joined: Sat Jan 20, 2018 1:57 pm

Re: Allow to export texture from meshes

Post by PablerasBCN »

Once you've your UV mapped mesh in Meshlab.

Image

Image

Search dist is a CRITICAL VALUE that will determine the time it takes aswell as the output quality, the optimal value will depend on the density of your point cloud
Etyop
Posts: 8
Joined: Mon Aug 01, 2022 11:21 am

Re: Allow to export texture from meshes

Post by Etyop »

Thank you, I'll look into it in the next days!
Etyop
Posts: 8
Joined: Mon Aug 01, 2022 11:21 am

Re: Allow to export texture from meshes

Post by Etyop »

Hey, it looks good! It is not perfect and I still some work to do to make it look better, but it's already so satisfying to see my texture properly applied. Thank you so much
PablerasBCN
Posts: 296
Joined: Sat Jan 20, 2018 1:57 pm

Re: Allow to export texture from meshes

Post by PablerasBCN »

awesome, glad it helped!.

Oddly the images I uploaded seem removed :\ but since you where able to do the bake I guess there is enough info for hte ones that come after
Post Reply