Add ligament on TugofWar Model
Posted: Wed Nov 13, 2013 8:33 am
Hello everyone,
I'm experimenting on "TugofWar" model(an example of OpenSim) by adding two ligaments to replace the original two muscles. And then I generated osim file by C++ code. When loading the model on OpenSim GUI, I can't see any ligament on the view but I could find it in the navigator window. It just seemed to be hidden. So I trace the xml of the osim file. I found it lacked <PathPointSet/> in <GeometryPath/> of the model. Could anyone give me some hints or suggestions about if I missed some steps in my C++ code.
I'm experimenting on "TugofWar" model(an example of OpenSim) by adding two ligaments to replace the original two muscles. And then I generated osim file by C++ code. When loading the model on OpenSim GUI, I can't see any ligament on the view but I could find it in the navigator window. It just seemed to be hidden. So I trace the xml of the osim file. I found it lacked <PathPointSet/> in <GeometryPath/> of the model. Could anyone give me some hints or suggestions about if I missed some steps in my C++ code.
Code: Select all
Ligament *ligament1 = new Ligament();
ligament1->setName("ligament1");
if(ligament1->hasGeometryPath())
{
GeometryPath ligamentPath1 = ligament1->getGeometryPath();
ligamentPath1.appendNewPathPoint("ligament1-point1", *metatarsal1,Vec3(0.0,0.05,-0.35));
ligamentPath1.appendNewPathPoint("ligament1-point2", *metatarsal2,Vec3(0.0,0.0,-0.05));
}
osimModel.addForce(ligament1);