Page 1 of 2

Problem with scaling and point constraint

Posted: Fri Jul 01, 2016 10:37 am
by djdameln
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

Re: Problem with scaling and point constraint

Posted: Tue Jul 05, 2016 10:09 am
by aymanh
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

Re: Problem with scaling and point constraint

Posted: Tue Jul 05, 2016 10:31 am
by tkuchida
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

Re: Problem with scaling and point constraint

Posted: Tue Jul 05, 2016 1:38 pm
by djdameln
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

Re: Problem with scaling and point constraint

Posted: Tue Apr 05, 2022 6:13 am
by felix.lefebvre
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,

Re: Problem with scaling and point constraint

Posted: Tue Apr 19, 2022 11:10 pm
by felix.lefebvre
Any news about this issue ?

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

Thank you,
Felix

Re: Problem with scaling and point constraint

Posted: Wed Apr 20, 2022 12:51 am
by tkuchida
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.

Re: Problem with scaling and point constraint

Posted: Wed Apr 20, 2022 1:58 am
by felix.lefebvre
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

Re: Problem with scaling and point constraint

Posted: Wed Apr 20, 2022 4:19 am
by tkuchida
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.

Re: Problem with scaling and point constraint

Posted: Wed Apr 20, 2022 5:42 am
by felix.lefebvre
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