Ellipsoid wrapping

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Shravan Tata
Posts: 9
Joined: Fri Jul 28, 2017 4:26 am

Ellipsoid wrapping

Post by Shravan Tata » Wed Sep 26, 2018 5:41 am

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

Tags:

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: Ellipsoid wrapping

Post by Dimitar Stanev » Fri Sep 28, 2018 12:25 am

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

User avatar
Shravan Tata
Posts: 9
Joined: Fri Jul 28, 2017 4:26 am

Re: Ellipsoid wrapping

Post by Shravan Tata » Wed Oct 03, 2018 2:06 am

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

POST REPLY