Skip to content

The "standard" model against which ligament scaling is tested contains correct path points but incorrect resting_lengths #1993

@tkuchida

Description

@tkuchida

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:

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_lengths are incorrect. Here are the values of the resting_lengths 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_lengths 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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions