Problem with scaling and point constraint
- Dick Ameln
- Posts: 4
- Joined: Thu Feb 20, 2014 9:15 am
Problem with scaling and point constraint
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
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
- Ayman Habib
- Posts: 2239
- Joined: Fri Apr 01, 2005 12:24 pm
Re: Problem with scaling and point constraint
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
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
- Thomas Uchida
- Posts: 1790
- Joined: Wed May 16, 2012 11:40 am
Re: Problem with scaling and point constraint
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
Tom
- Dick Ameln
- Posts: 4
- Joined: Thu Feb 20, 2014 9:15 am
Re: Problem with scaling and point constraint
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
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
- Félix Lefebvre
- Posts: 16
- Joined: Fri Oct 05, 2018 5:41 am
Re: Problem with scaling and point constraint
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,
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,
- Félix Lefebvre
- Posts: 16
- Joined: Fri Oct 05, 2018 5:41 am
Re: Problem with scaling and point constraint
Any news about this issue ?
Point constraints not adapting to scaling and associated changes of location does seem an important issue.
Thank you,
Felix
Point constraints not adapting to scaling and associated changes of location does seem an important issue.
Thank you,
Felix
- Thomas Uchida
- Posts: 1790
- Joined: Wed May 16, 2012 11:40 am
Re: Problem with scaling and point constraint
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.
- Félix Lefebvre
- Posts: 16
- Joined: Fri Oct 05, 2018 5:41 am
Re: Problem with scaling and point constraint
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
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
- Thomas Uchida
- Posts: 1790
- Joined: Wed May 16, 2012 11:40 am
Re: Problem with scaling and point constraint
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.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 ?
- Félix Lefebvre
- Posts: 16
- Joined: Fri Oct 05, 2018 5:41 am
Re: Problem with scaling and point constraint
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
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