Page 1 of 1

Import .vtp file

Posted: Thu Oct 04, 2018 3:29 am
by matteo.m
Hi, I'm trying to learn how to use opensim for a project for my thesis. I'm trying to rewrite the matlab code to make the arm26 model to learn how to write whit this language. I can not create the geometry and load the .vtp files like 'ground_ribs.vtp', which command can i use?

Thanks for your answer!

Re: Import .vtp file

Posted: Thu Oct 04, 2018 7:25 am
by jimmy
It is not clear what you want to do, can you further explain?

Re: Import .vtp file

Posted: Thu Oct 04, 2018 8:00 am
by matteo.m
In the .osim file there are these line of code:

Code: Select all

<VisibleObject>
<!--Set of geometry files and associated attributes, allow .vtp, .stl, .obj-->
<GeometrySet>
<objects>
<DisplayGeometry>
<!--Name of geometry file .vtp, .stl, .obj-->
<geometry_file>ground_ribs.vtp</geometry_file>
<!--Color used to display the geometry when visible-->
<color> 1 1 1</color>
<!--Name of texture file .jpg, .bmp-->
<texture_file />
<!--in body transform specified as 3 rotations (rad) followed by 3 translations rX rY rZ tx ty tz-->
<transform> -0 0 -0 0 0 0</transform>
<!--Three scale factors for display purposes: scaleX scaleY scaleZ-->
<scale_factors> 1 1 1</scale_factors>
<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded-->
<display_preference>4</display_preference>
<!--Display opacity between 0.0 and 1.0-->
<opacity>1</opacity>
</DisplayGeometry>
Which matlab commands should I use to get them?

Re: Import .vtp file

Posted: Thu Oct 04, 2018 8:09 am
by tkuchida
I can not create the geometry and load the .vtp files like 'ground_ribs.vtp', which command can i use?
attachGeometry() in the Frame class. Please see the following:
- Doxygen documentation: https://simtk.org/api_docs/opensim/api_ ... 2daa981395
- Example (opensim-core/Bindings/Java/Matlab/examples/OpenSimCreateTugOfWarModel.m, line 52): https://github.com/opensim-org/opensim- ... odel.m#L52

Re: Import .vtp file

Posted: Thu Oct 04, 2018 9:51 am
by matteo.m
Ok, I get it, thanks!