PyMeshLab
PyMeshLab copied to clipboard
color vertex to texture issues
Hi,
I am trying to use the filter parametrization_voronoi_atlas()
on some .ply
files with color per vertex in order to extract the corresponding texture maps. While on some files it seems to work quite nicely and fast, on some others it takes forever to process without any specific reason (amount of vertices/faces is similar), thus I have to kill the script myself. What I've noticed though is that I am getting the following message no matter whether the filter will complete or not:
Reading PLY file: ../data/json_test/box_1/frag_1.ply[========================================] 100%
Number meshes: 1
Mesh id: 0
Mesh label:
Full name:
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
Non Manifold Vertices
I've then checked for non manifold vertices through the gui, but it doesn't seem any to exist. Thus, I would appreciate any feedback.
Initially I used parametrization_trivial_per_triangle()
filter which though it works it has a strange effect where the borders of the triangles are kind of baked into the texture:
It seems that this is something that others are facing as well.
I am using the latest versions of both Meshlab and PyMeshlab, also I've tested it on both linux and windows computers with the same result in each case.
Hi, could you please share a model and the script that is causing the issue? Without them I cannot replicate the issue and try to solve it.
Hi @alemuntoni,
Sure, please check below:
import pymeshlab
def main():
# create a new MeshSet
ms = pymeshlab.MeshSet()
ms.load_new_mesh("./frag_2.ply")
ms.parametrization_voronoi_atlas(overlapflag=True)
ms.transfer_vertex_attributes_to_texture_1_or_2_meshes(sourcemesh=0, targetmesh=1, textname="frag_2.png")
# ms.parametrization_trivial_per_triangle(border=0.5)
# ms.transfer_vertex_color_to_texture(textname="frag_2.png")
ms.set_current_mesh(0)
ms.save_current_mesh("frag_2.obj")
if __name__ == "__main__":
main()
I can confirm the issue, it affects both meshlab (single & double precision) and pymeshlab. I'll investigate on this! Thanks for reporting!
Thanks. Can you also confirm the issue with the edges artifacts on the parametrization_trivial_per_triangle()
-->transfer_vertex_color_to_texture()
filter output?
Hi @alemuntoni, any update on this?
Nope. It is not an easy-fix bug and requires lot of in depth analysis. I don't know when it will be fixed.
@alemuntoni is the issue with the artifacts on the texture when using the option parametrization_trivial_per_triangle() -->transfer_vertex_color_to_texture()
also related with the one from parametrization_voronoi_atlas()
? Is something that can be done for that?
@alemuntoni Is there any update on the Voronoi parametrization? I did a bunch of testing yesterday with some of the primitive objects in MeshLab and couldn't decipher under which conditions the parametrization worked and when it would crash. It would be great to know a set of conditions where it doesn't fail so that we can edit our meshes accordingly.
@ttsesm Wouldn't the issue with the trivial parametrization be in what kind of interpolation the renderer chooses to display the texture on the mesh? For example, if nearest neighbor were used instead of some kind of blended interpolation, I wonder if the displayed mesh would have those wireframe artifacts. I just don't know how to control this. I know that MeshLab has options for different shaders but I haven't explored them. My issue is that I am using the mesh in another program where I don't have such control, so I am interested in the Voronoi parametrization as well.
@EvanHemingway tbh I am not aware of this as well. I guess @alemuntoni could give you a better answer on both of your questions.