PyMeshLab icon indicating copy to clipboard operation
PyMeshLab copied to clipboard

save_current_mesh specify the property type: double to float

Open baichuan05 opened this issue 3 years ago • 1 comments

Hello,

I am trying to convert .obj to .ply with some filters. In the output .ply, I got

property double x
property double y
property double z
property double nx
property double ny
property double nz
property float texture_u
property float texture_v

Is that possible to save it in float type? I tried the same steps with a Meshlab 2021.07 on windows 10 which outputs float by default.

Here is my code.

import pymeshlab

ms = pymeshlab.MeshSet()
ms.load_new_mesh("./5/google_16k/textured.obj")
ms.transform_translate_center_set_origin(traslmethod="Center on Scene BBox")
ms.transform_scale_normalize(axisx=1000)  # m to mm
ms.convert_perwedge_uv_into_pervertex_uv()

ms.save_current_mesh(
    file_name="test.ply",
    binary=False,
    save_vertex_quality=False,
    save_vertex_flag=False,
    save_vertex_color=False,
    save_vertex_coord=True,
    save_vertex_normal=True,
    save_vertex_radius=False,
    save_face_quality=False,
    save_face_flag=False,
    save_face_color=False,
    save_wedge_color=False,
    save_wedge_texcoord=False,
    save_wedge_normal=False,
)

Thank you!

baichuan05 avatar Aug 07 '21 03:08 baichuan05

Hi, sorry but right now it is not possible. It is a feature that could be useful also in meshlab (especially in the double precision version). I'll try to code this whenever I'll find time, but I don't know when. Or, PRs are always welcome :)

alemuntoni avatar Aug 09 '21 09:08 alemuntoni