Page 1 of 1

Get Number of Geometry Files from a Body

Posted: Tue May 10, 2022 4:27 am
by tnt845
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