Get Number of Geometry Files from a Body

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Tylan Templin
Posts: 40
Joined: Mon Jan 15, 2018 10:55 am

Get Number of Geometry Files from a Body

Post by Tylan Templin » Tue May 10, 2022 4:27 am

Hi everyone,

I would like to read the geometry files from each body in a .osim file. Currently I am using the following lines of code.

Code: Select all

geom = body.get_attached_geometry(counter) 
mesh = osim.Mesh.safeDownCast(geom)
mesh_file = mesh.get_mesh_file()
This code stores the correct file in mesh_file but I have not been able to find a way to programmatically identify the number of geometry files associated with each body. I noticed in a previous version of the OpenSim API documentation there was a function to numGeometryFiles() but that doesn't seem to exist in later version of OpenSim. Is there any way to get this information without having to hard code the number of geometry files?

Thanks,

Ty

Tags:

POST REPLY