-
Notifications
You must be signed in to change notification settings - Fork 52
Add a function to get the kinetic and potential energy of a node from a python script #504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
alxbilger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thanks
Does it work? Have you tested?
The problem is that not all the components implement the computation of the energies.
|
I haven't tested it yet, I can't build the plugin for some reason. I opened a topic in the forum : sofa-framework/sofa#5554 |
|
I have managed to build it in-tree. It works great for a simple scene with an object sliding on an incline. Do you happen to know which components may be a problem and need to be tested ? |
|
I cannot be specific, but usually, there is a runtime warning such as For example: |
|
So from what I read, the methods that are not implemented actually just return 0. So the code will run, produce a warning, and a wrong result. I think this is fine ? Otherwise, I can change the not implemented method to return NaNs instead of 0. |
|
Sounds reasonable to me to return 0 |
Yes, it's fine |
As suggested by @alxbilger here
Also adapted from QEnergyStatWidget in Sofa.Qt.
I did not manage to build this yet on my machine, so I haven't tested it.