Replies: 1 comment
-
You need to define the triangles as references to the vertices. Perhaps the easiest way to do this is to create a point cloud first, and then create a mesh using TriangleMesh.create_from_point_cloud_alpha_shape or one of the other functions to create a mesh from a point cloud? See surface reconstruction in the docs. Besides that, with prior knowledge of the landmarks and their neighbours, you may construct the triangles yourself to populate the mesh with. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to convert landmarks into meshes? I extracted facial landmarks from mediapipe facial landmarker it gave me 3 dimensional facial landmarks i.e it has x, y, z coordinates of each landmark. I want to use them to create a 3D mesh but I am having trouble converting them into a mesh.
This is my code:
x_coords, y_coords, z_coords = get_marks(detection_result)
Create a NumPy array of vertices
vertices = np.column_stack((x_coords, y_coords, z_coords))
Create a mesh object
mesh = o3d.geometry.TriangleMesh()
Set the vertices of the mesh
mesh.vertices = o3d.utility.Vector3dVector(vertices)
Compute the Delaunay triangulation to create faces
mesh.compute_triangle_normals()
mesh.compute_vertex_normals()
output_path = "output_mesh.obj"
Save the mesh as an OBJ file
o3d.io.write_triangle_mesh(output_path, mesh)
When I load the file in blender, it does have any mesh.
Is there a good way to accomplish this?
Beta Was this translation helpful? Give feedback.
All reactions