-
Notifications
You must be signed in to change notification settings - Fork 345
Description
I provide a detailed description of the issue below because the resolution involves changing a "standard" test model.
This issue concerns the following files in the Applications/Scale/test directory:
- testScale.cpp
- toyLigamentModel.osim (the original model)
- std_toyLigamentModelScaled.osim (the "standard" model)
- toyLigamentModel_Setup_Scale.xml (the ScaleTool setup file)
In testScale.cpp, line 244, the scaleModelWithLigament()
method uses the ScaleTool (with the toyLigamentModel_Setup_Scale.xml setup file) to scale the "block" and "block1" bodies in toyLigamentModel.osim by (2, 2, 2)
. The "standard" model (std_toyLigamentModelScaled.osim) contains the correct GeometryPath points, but the resting_length
s are incorrect. Here are the values of the resting_length
s in the original and "standard" models:
Table 1
Ligament | resting_length in original model |
resting_length in "standard" model |
---|---|---|
"lateralLigament" | 0.14 | 0.14 |
"MedialLigament" | 0.14 | 0.14 |
"internalLigament" | 0.04 | 0.06 |
"crossLigament" | 0.147 | 0.289196876423888 |
The Ligament's postScale() method indicates that the resting_length
should be multiplied by scaleFactor = {path length after scaling} / {path length before scaling}
, so the table above suggests that "lateralLigament" has not changed length; however, this is not the case.
I opened the original model and "standard" models, and used the following script to read the lengths of the ligaments in the default pose:
model = getCurrentModel();
s = model.initSystem();
modeling.Ligament.safeDownCast( model.getForceSet().get(0) ).getLength(s);
Here are the lengths:
Table 2
Ligament | Length in original model | Length in "standard" model |
---|---|---|
"lateralLigament" | 0.14 | 0.28 |
"MedialLigament" | 0.14 | 0.28 |
"internalLigament" | 0.04000000000000002 | 0.08000000000000004 |
"crossLigament" | 0.1469693845669907 | 0.2939387691339814 |
I drew a sketch of the bodies and frames, and confirmed that "lateralLigament" should have doubled in length as a result of scaling the bodies by (2, 2, 2)
. Ligament's postScale()
method should have updated the resting_length
s by computing scaleFactor = {path length after scaling} / {path length before scaling}
; in the case of "lateralLigament", scaleFactor = 0.28 / 0.14 = 2
(per Table 2) and resting_length
should have doubled (not remained the same length, as shown in Table 1).
Not sure why the ASSERT on line 291 doesn't currently throw, but I'm confident that the "standard" model is incorrect.