Sconpy apply external force
Posted: Wed Jul 12, 2023 12:08 pm
Hi Thomas,
I am trying to add an external force to my model in sconepy, however, I can't find a way to make it work:
When I try to call body.set_external_force(sconepy.Vec3(1, 0, 0)) on my body object, I get the error that no constructor is defined for sconepy.Vec3.
I tried to work around this by getting the current force as a Vec3 by calling f=body.external_force(). I then set f.x = 1, which gave me a new force vector. In a third step I wanted to apply the force to the body using the set_external_force(f) command, which seemed to work at first. However, when I called body.external_force() directly afterwards, it gave me the original force and not the one that I just set.
Can you tell me if I am doing something wrong, or what would be the correct way to apply an external force in sconepy?
Thanks in advance and best regards,
Sophie
I am trying to add an external force to my model in sconepy, however, I can't find a way to make it work:
When I try to call body.set_external_force(sconepy.Vec3(1, 0, 0)) on my body object, I get the error that no constructor is defined for sconepy.Vec3.
I tried to work around this by getting the current force as a Vec3 by calling f=body.external_force(). I then set f.x = 1, which gave me a new force vector. In a third step I wanted to apply the force to the body using the set_external_force(f) command, which seemed to work at first. However, when I called body.external_force() directly afterwards, it gave me the original force and not the one that I just set.
Can you tell me if I am doing something wrong, or what would be the correct way to apply an external force in sconepy?
Thanks in advance and best regards,
Sophie