Home > Mobile >  Using just vertices to generate faces in PyMeshLab
Using just vertices to generate faces in PyMeshLab

Time:08-10

I have an array of vertices representing some 3D point cloud, and I would like to import this into PyMeshLab to generate faces for the object (sort of like generating a convex hull, but if the 3D object were vertices of a human's hand, it would wrap around each finger correctly). Does PyMeshLab (or other libraries) offer this functionality? The below code of usually doing it using a .obj that has both vertices and faces works, but not so when given something with just vertices.

ms = pymeshlab.MeshSet()

ms.load_new_mesh('vertices.npy')
ms.generate_surface_reconstruction_ball_pivoting()
ms.save_current_mesh('vertices.obj')

# get a reference to the current mesh
m = ms.current_mesh()

# get numpy arrays of vertices and faces of the current mesh
v_matrix = m.vertex_matrix()
f_matrix = m.face_matrix() # <- I would like to generate this, but I'm not allowed so with just a faces input

CodePudding user response:

The enter image description here

If you just wanted the convex hull check this scipy method.

  • Related