Skip to content

Is it correct that the computed skeleton is supposed to be on the mesh surface? Anything I did was wrong? #98

@lxmedai

Description

@lxmedai

I am now testing your package for computing mesh skeleton. Here below is my code using meshparty to compute the skeleton and to visualize the results:

from meshparty import trimesh_vtk, trimesh_io
from meshparty.skeletonize import skeletonize_mesh

vertices, faces, normals, link_edges, node_mask = trimesh_io.read_mesh(file_path_to_obj)
mesh = trimesh_io.Mesh(vertices=vertices, faces=faces, normals=normals, link_edges=link_edges, node_mask=node_mask)
skeleton = skeletonize_mesh(mesh)
# I originally set the opacity for the mesh to 0.5. But since the extracted skeleton is on the surface, I set it to 1. 
actor_mesh = trimesh_vtk.mesh_actor(mesh,  color=(0, 0.5, 1), opacity=1)
actor_skeleton = trimesh_vtk.skeleton_actor(skeleton, color=(1, 0, 0), opacity=0.5, lin_width=5)
trimesh_vtk.render_actors([actor_mesh, actor_skeleton])

Skeleton_human_mesh

The returned skeleton is on the mesh surface rather than inside the mesh as I would expect. Was there anything I did wrong? It will be very much appreciated if this problem can be solved.
Another minor issue for me is that I could not use the recommended way to read mesh via:

mm = trimesh_io.MeshMeta()
mesh = mm.mesh(file_path_to_obj) 

, which would lead to error saying "AttributeError: 'NoneType' object has no attribute 'mesh'. " which points to "if not isinstance(self.cv.mesh, SharedUltilLevelPrecomputedMeshSource)" in file "trimesh_io.py". It is however unclear to me about how it should be set. But of course this is a minor problem for me since code for 'read_mesh' works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions