Home › Forum › SOFA › Using SOFA › [SOLVED] Visualizing DiagonalCompliance (Compliance Plugin)
Tagged: 64_bits, Linux_ubuntu, SOFA_1612, visualizing
- This topic has 3 replies, 3 voices, and was last updated 8 years, 2 months ago by
mmabrouk.
-
AuthorPosts
-
28 September 2017 at 16:38 #10019
mmabrouk
BlockedHello,
I am using the compliant plugin for a protein simulation using SOFA.
I am using DiagonalCompliance to model spring (forces) between atoms.
I would like to visualize the DiagonalCompliance in my model (as it is done with a MeshSpringForceField for example). How to do that?
Here is my model (it’s hard to replicate since it is dynamic and in python):
Mechanical Object (describing the atoms)
|-AssembledRigidRigidMapping (for the joints)
|-Mechanical Object
|-|Mechanical Object
|-|RigidJointMapping
|-|DiagonalCompliance -> I would like to visualize thisThank you!
Best,
Mahmoud29 September 2017 at 18:29 #10021Hugo
KeymasterHi Mahmoud,
Thank you for your interest in SOFA and more especially the Compliant plugin. Unfortunately, I am personally not using this plugin. But I guess you could inherit (or modify) from the DiagonalCompliance code and implement the handleEvent() function to export the compliance matrix using the getComplianceMatrix() already available.
HTH,Hugo
29 September 2017 at 20:03 #10022max
BlockedHi Mahmoud,
Since compliances are generally expressed on point differences (or relative rigid transforms, in your case), it will be a little difficult to visualize directly.
Basically you have two options:
– implement some custom opengl drawing code in DiagonalCompliance::draw, but keep in mind that your compliance works on the relative transformation between your two rigid frames and you don’t have access to the source rigid frames
– use a python script controller to either:
a. debug using print() calls in the entry points onBeginAnimationStep/onEndAnimationStep
b. implement custom rendering in the draw entry point, using PyOpengGL. From there it is fairly easy to access your rigid frame dofs and draw stuff accordingly.Probably the easiest way will be to use python, but it will not scale very well if you have plenty of these. However, for debugging purpose it should be fine.
Hope this helps,
12 October 2017 at 14:38 #10067mmabrouk
BlockedHello,
Thank you for your answers. I found a different solution. Since I actually only needed 1D compliance I ended up using the DistanceMapping and visualizing like done in the tutorials.
Yours,
Mahmoud -
AuthorPosts
- You must be logged in to reply to this topic.
