I am trying to add a .vtp to my model and it keeps giving me the error below
No appropriate method, property, or field attachMeshGeometry for class org.opensim.modeling.Body.
Error in GenerateLegworksModel (line 23)
rightShank.attachMeshGeometry('sphere.vtp');
I have tried both addDisplayGeometry(...) and attachMeshGeometry(...)
Our mentors mentiod it the api may have change for opensim 4.0
I am using matlabR2014 and opensim 4.0
Trouble with adding .vtp file in matlab to model
- Robert Aguilar
- Posts: 2
- Joined: Tue Mar 21, 2017 6:38 pm
- Christopher Dembia
- Posts: 506
- Joined: Fri Oct 12, 2012 4:09 pm
Re: Trouble with adding .vtp file in matlab to model
In 4.0, you want to try `rightShank.attachGeometry(Mesh('sphere.vtp'))`.
- Robert Aguilar
- Posts: 2
- Joined: Tue Mar 21, 2017 6:38 pm
Re: Trouble with adding .vtp file in matlab to model
awesome that worked but I received an error in my next line which is:
rightShank.getDisplayer().setScaleFactors([PylonLength/10, PylonLength, PylonLength/10]);
same error
No appropriate method, property, or field getDisplayer for class org.opensim.modeling.Body.
rightShank.getDisplayer().setScaleFactors([PylonLength/10, PylonLength, PylonLength/10]);
same error
No appropriate method, property, or field getDisplayer for class org.opensim.modeling.Body.
- Christopher Dembia
- Posts: 506
- Joined: Fri Oct 12, 2012 4:09 pm
Re: Trouble with adding .vtp file in matlab to model
Refer to Doxygen to see what function calls you should use in 4.0. https://simtk.org/api_docs/opensim/api_ ... metry.html
- Ayman Habib
- Posts: 2240
- Joined: Fri Apr 01, 2005 12:24 pm
Re: Trouble with adding .vtp file in matlab to model
Hello,
I'm not sure if you're actually using Sphere or the name of the file happens to be sphere.vtp by accident. If the former, then you can use proper Geometry subclasses (Sphere, Cylinder, Torus, Ellipsoid, Brick) directly rather than using Mesh.
You can check the Doxygen documentation for available primitives and options.
Hope this helps,
-Ayman
I'm not sure if you're actually using Sphere or the name of the file happens to be sphere.vtp by accident. If the former, then you can use proper Geometry subclasses (Sphere, Cylinder, Torus, Ellipsoid, Brick) directly rather than using Mesh.
You can check the Doxygen documentation for available primitives and options.
Hope this helps,
-Ayman