Problem with scaling and point constraint

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
Dick Ameln
Posts: 4
Joined: Thu Feb 20, 2014 9:15 am

Problem with scaling and point constraint

Post by Dick Ameln » Fri Jul 01, 2016 10:37 am

Hello,

In my model I have a pointConstraint connecting two bodies. When I use the scale tool to scale the model, the locations of the point constraints in the bodies do not scale with the bodies, resulting in a deformed model.

I tried using an OpenSim script to scale the locations of the point constraint with the same scale factors as the segments, but I could not find a way to change the properties (location_body_1 and location_body_2) of the pointConstraint from the script.

Is there a way to do this, or is there another way to scale the locations of the pointConstraint in the bodies?

Regards,

Dick

User avatar
Ayman Habib
Posts: 2238
Joined: Fri Apr 01, 2005 12:24 pm

Re: Problem with scaling and point constraint

Post by Ayman Habib » Tue Jul 05, 2016 10:09 am

Hi,

As it stands, Scaling handles only specific types of objects (mainly Bodies, Joints and Muscles). If you want to do the scaling of other custom components in your model you'll have to write code to do it (though we're working on a more general mechanism for the next release). If you know how you want o scale your constraints for example then you can get the scale factors from scaling, and write a Matlab script to scale the constraints based on the scale factors of the bodies they're attached to. Can you describe what tools/environment you're using for development so that we and other users on the forum can suggest solutions/workarounds.

Best regards,
-Ayman

User avatar
Thomas Uchida
Posts: 1789
Joined: Wed May 16, 2012 11:40 am

Re: Problem with scaling and point constraint

Post by Thomas Uchida » Tue Jul 05, 2016 10:31 am

A workaround could be to temporarily change the PointConstraint into some other Object that scales automatically (e.g., a Joint or Muscle) and change it back after scaling. You could also use this strategy to validate a more elegant scripting solution like what Ayman suggested.

Tom

User avatar
Dick Ameln
Posts: 4
Joined: Thu Feb 20, 2014 9:15 am

Re: Problem with scaling and point constraint

Post by Dick Ameln » Tue Jul 05, 2016 1:38 pm

Thanks a lot for your replies.

I managed to work around the problem by extracting the scale factors of the involved segments from the applied scale set. After downcasting the constraint object to point constraint I could change the location properties of the point constraint on the basis of the scale factors using a GUI script.

Dick

User avatar
Félix Lefebvre
Posts: 16
Joined: Fri Oct 05, 2018 5:41 am

Re: Problem with scaling and point constraint

Post by Félix Lefebvre » Tue Apr 05, 2022 6:13 am

Hi,

I am using OpenSim 4.3. It seems to me that this issue is still present.

When scaling bodies linked by a PointConstraint, the location of the point (location_body_1/2) does not update. For example the AC constraint in the ScapuloThoracic Model.
It could be problematic for non advised users of this model that would not notice the offset when applying small scale factors.

Is it planned to be included in a future release ?

Thank you.
Regards,

User avatar
Félix Lefebvre
Posts: 16
Joined: Fri Oct 05, 2018 5:41 am

Re: Problem with scaling and point constraint

Post by Félix Lefebvre » Tue Apr 19, 2022 11:10 pm

Any news about this issue ?

Point constraints not adapting to scaling and associated changes of location does seem an important issue.

Thank you,
Felix

User avatar
Thomas Uchida
Posts: 1789
Joined: Wed May 16, 2012 11:40 am

Re: Problem with scaling and point constraint

Post by Thomas Uchida » Wed Apr 20, 2022 12:51 am

IMHO I'm not sure the software can make the decision you're describing without being provided with more information: as far as I can tell, the model builder can set up the model to scale PointConstraints or not. The PointConstraint class has 2 properties (location_body_1 and location_body_2) and 2 sockets (body_1 and body_2). The sockets are frames fixed to the two bodies and the properties are vectors in these frames. If the model builder had wanted the points on the bodies to change when the model is scaled, then I think they would have defined a frame on each body specifically for the constraint (note that all frames on a body are moved when the body is scaled) and specified location_body_1 = location_body_2 = [0,0,0]. If this was not done, then the assumed intention of the model builder was to not have the PointConstraint change when the model is scaled.

User avatar
Félix Lefebvre
Posts: 16
Joined: Fri Oct 05, 2018 5:41 am

Re: Problem with scaling and point constraint

Post by Félix Lefebvre » Wed Apr 20, 2022 1:58 am

Hi Thomas,

Ok thank you Thomas I think I understand.

Then maybe M. Seth or Delp could answer, as the constraint I am talking about is the AC PointConstraint of the Scapulothoracic model they developed in 2016.

Why is the AC PointConstraint associated to the body frames directly, and thus not scaled, instead of using a specific frame for this that would be ?

Thank you,
Felix Lefebvre

User avatar
Thomas Uchida
Posts: 1789
Joined: Wed May 16, 2012 11:40 am

Re: Problem with scaling and point constraint

Post by Thomas Uchida » Wed Apr 20, 2022 4:19 am

Why is the AC PointConstraint associated to the body frames directly, and thus not scaled, instead of using a specific frame for this that would be ?
I don't think the Scapulothoracic Joint was designed to be scaled using OpenSim's Scale Tool. Please refer to the paper and the optimization scripts provided on the SimTK page: https://simtk.org/projects/scapulothoracic.

User avatar
Félix Lefebvre
Posts: 16
Joined: Fri Oct 05, 2018 5:41 am

Re: Problem with scaling and point constraint

Post by Félix Lefebvre » Wed Apr 20, 2022 5:42 am

Hi Thomas,

The article does say that model was scaled using the OpenSim Scale Tool.

Also, by checking in the model files provided with the article, the scaled model looks wrong to me as the acromio-clavicular contact point makes the bones actually not being in contact.

Anyway, I have my own scripts for scaling the model with adjustment of this contact point but also the ellipsoid. But it seemed to me this would need some attention if not advised users would scale the model without taking care of it.

Thank you for your answers.
Best regards,
Felix Lefebvre

POST REPLY