Hello,
I am trying use the python API to generate an ellipsoid wrapping. What method/function should I use to change/set the dimensions of the ellipsoid using the python API. Looking the WrapEllipsoid class I do not see a way to access any attributes to change the dimensions of the ellipsoid function. Thanks in advance
Ellipsoid wrapping
- Shravan Tata
- Posts: 9
- Joined: Fri Jul 28, 2017 4:26 am
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: Ellipsoid wrapping
This is an example code in OpenSim 3.3 using the C++ API, which can be adapted in Python:
OpenSim 4.0:
https://github.com/opensim-org/opensim- ... l.cpp#L151
Code: Select all
auto patella = new WrapCylinder();
patella->setName("patella");
patella->setRadius(0.08);
patella->setLength(linkRadius * 2);
patella->setQuadrantName("x");
patella->updPropertyByName("translation").updValue<double>(0) = linkDistalPoint[0];
patella->updPropertyByName("translation").updValue<double>(1) = linkDistalPoint[1];
patella->updPropertyByName("translation").updValue<double>(2) = linkDistalPoint[2];
thigh->addWrapObject(patella);
// Configure the vastus muscle to wrap over the patella.
vastus->updGeometryPath().addPathWrap(*patella);
https://github.com/opensim-org/opensim- ... l.cpp#L151
- Shravan Tata
- Posts: 9
- Joined: Fri Jul 28, 2017 4:26 am
Re: Ellipsoid wrapping
Dear Dimitar Stanev,
Thank you for the reply. But unfortunately I am unable the properties using python API. Please find below the small code small I am trying to execute.
Your help is much appreciated.
I need to change the dimensions of ellipsoid wrapping and not for cylinders.
Thank you for the reply. But unfortunately I am unable the properties using python API. Please find below the small code small I am trying to execute.
Your help is much appreciated.
I need to change the dimensions of ellipsoid wrapping and not for cylinders.
Code: Select all
import opensim as osim
patella = osim.WrapEllipsoid()
patella.updPropertyByName('dimensions').updValue(0) = 10.0