Page 1 of 1

Ellipsoid wrapping

Posted: Wed Sep 26, 2018 5:41 am
by tatarama
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

Re: Ellipsoid wrapping

Posted: Fri Sep 28, 2018 12:25 am
by mitkof6
This is an example code in OpenSim 3.3 using the C++ API, which can be adapted in Python:

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);
OpenSim 4.0:

https://github.com/opensim-org/opensim- ... l.cpp#L151

Re: Ellipsoid wrapping

Posted: Wed Oct 03, 2018 2:06 am
by tatarama
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.

Code: Select all

import opensim as osim
patella = osim.WrapEllipsoid()
patella.updPropertyByName('dimensions').updValue(0) = 10.0