Open liu19951002 opened 3 months ago
it is possible to use meshlab to convert faces and colors into meshes and texture. meshlab also provides python lib.
Could you please show how to export texture files using MeshLab? Currently, I can only export to OBJ format using the following command line, but I don't know how to export the textures.
meshlabserver -i fuse_post2.ply -o fuse_post2.obj -m vc vn
it is possible to use meshlab to convert faces and colors into meshes and texture. meshlab also provides python lib.
Could you please show how to export texture files using MeshLab? Currently, I can only export to OBJ format using the following command line, but I don't know how to export the textures.
meshlabserver -i fuse_post2.ply -o fuse_post2.obj -m vc vn
I'm using pymeshlab. basically there are two steps: firstly, run compute_texcoord_parametrization_triangle_trivial_per_wedge, and then run transfer_attributes_to_texture_per_vertex.
this is how I did: ms = pymeshlab.MeshSet() ms.load_new_mesh('yourpath to ply mesh') ms.compute_texcoord_parametrization_triangle_trivial_per_wedge(textdim='define by yourself') impath = 'your path to save the texture image' ms.transfer_attributes_to_texture_per_vertex(textw=(corresponding to the textdim), texth=(corresponding to the textdim), textname='./texture.png')
try:
ms.save_current_mesh('your path to save obj')
except:
MeshSet = ms[0]
text = MeshSet.textures()
internal = text[impath]
internal.save(impath)
@DabblerGISer Thanks for your kind reply. I have successfully obtained the texture map with your guidance. However, during the process, the following error occurred:
Failed to apply filter: compute_texcoord_parametrization_triangle_trivial_per_wedge
Details: Inter-Triangle border is too much.
Due to this, I had to reduce the number of points.
ms.meshing_decimation_quadric_edge_collapse(targetfacenum=70000)
Although it ran successfully, the quality of the final generated OBJ file significantly decreased. Could you please provide any suggestions on this matter?
@DabblerGISer Thanks for your kind reply. I have successfully obtained the texture map with your guidance. However, during the process, the following error occurred:
Failed to apply filter: compute_texcoord_parametrization_triangle_trivial_per_wedge Details: Inter-Triangle border is too much.
Due to this, I had to reduce the number of points.
ms.meshing_decimation_quadric_edge_collapse(targetfacenum=70000)
Although it ran successfully, the quality of the final generated OBJ file significantly decreased. Could you please provide any suggestions on this matter?
You can increase the dimension
@DabblerGISer Thanks for your kind reply. I have successfully obtained the texture map with your guidance. However, during the process, the following error occurred:
Failed to apply filter: compute_texcoord_parametrization_triangle_trivial_per_wedge Details: Inter-Triangle border is too much.
Due to this, I had to reduce the number of points.
ms.meshing_decimation_quadric_edge_collapse(targetfacenum=70000)
Although it ran successfully, the quality of the final generated OBJ file significantly decreased. Could you please provide any suggestions on this matter?You can increase the dimension
Yeah, you are right. Thanks. However, the texture of the generated OBJ file seems much darker than that of the PLY file, and I am unsure of the reason.
it is possible to use meshlab to convert faces and colors into meshes and texture. meshlab also provides python lib.