Vastus shoots through wrapping object in Hopper Example
Posted: Tue Sep 15, 2020 2:15 am
Dear all,
I am trying to change the wrapping surface of the hopper example to an ellipsoid and sphere. This would mean that, especially on the sphere, the vastus is 'balancing' on the patella. However, for an ellipsoid of significant width (read ridiculously large) this should not be a problem. For both the ellipsoid with extreme width and the sphere however, the vastus remains on the patella for about 0.2 seconds of the simulation and afterwards seems to shoot through the wrapping surface. Could anyone point me in the right direction regarding this?
Here is the code (changes to the file "buildHopperModel.cpp", patella_shape is passed to the buildHopper function as an additional argument):
Notice that the 'width' of the ellipsoid is 1 so the vastus going 'around' the ellipsoid should not be possible. Also, the patella (and therefore the patellaFrame) are on the same line as the vastus' origin and insertion point. I've recently added the 'setAllPropertiesUseDefault' since I saw it in another forum post. I've also tried with a width of the ellipse of 0.01 at which the vastus goes around the patella before the simulation even started.
Would love to understand why this is not happening properly. Seems like it should be a simple and straightforward change to the code so I must be missing something obvious.
Cheers and thanks in advance
I am trying to change the wrapping surface of the hopper example to an ellipsoid and sphere. This would mean that, especially on the sphere, the vastus is 'balancing' on the patella. However, for an ellipsoid of significant width (read ridiculously large) this should not be a problem. For both the ellipsoid with extreme width and the sphere however, the vastus remains on the patella for about 0.2 seconds of the simulation and afterwards seems to shoot through the wrapping surface. Could anyone point me in the right direction regarding this?
Here is the code (changes to the file "buildHopperModel.cpp", patella_shape is passed to the buildHopper function as an additional argument):
Code: Select all
// Attach a patella to the distal end of the thigh over which the
// vastus muscle can wrap. linkDistalPoint only has a longitudal displacement w.r.t. the shank
auto patellaFrame = new PhysicalOffsetFrame("patellaFrame",*thigh, SimTK::Transform(linkDistalPoint));
// create an empty patella before the 'if' statement declarations
auto patella = new WrapEllipsoid();
if (patella_shape == "ellipsoid") {
delete patella;
auto patella = new WrapEllipsoid();
patella->setAllPropertiesUseDefault(true);
// a significant e2 size of the ellipsoid still leads to the vastus going through the wrapping surface
// although this is physically not possible
patella->set_dimensions(Vec3(0.08, 0.08, 1));
patella->set_quadrant("+x");
} else if (patella_shape == "sphere") {
delete patella;
auto patella = new WrapSphere();
patella->setAllPropertiesUseDefault(true);
patella->set_radius(0.08);
patella->set_quadrant("+x");
}
patella->setName("patella");
std::cout << "Patella is a " << patella->getWrapTypeName() << std::endl;
patellaFrame->addWrapObject(patella);
thigh->addComponent(patellaFrame);
// Configure the vastus muscle to wrap over the patella.
vastus->updGeometryPath().addPathWrap(*patella);
Would love to understand why this is not happening properly. Seems like it should be a simple and straightforward change to the code so I must be missing something obvious.
Cheers and thanks in advance