- This topic has 3 replies, 3 voices, and was last updated 7 years, 1 month ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Using SOFA › [SOLVED] Visualizing DiagonalCompliance (Compliance Plugin)
Tagged: 64_bits, Linux_ubuntu, SOFA_1612, visualizing
Hello,
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 this
Thank you!
Best,
Mahmoud
Hi 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
Hi 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,
Hello,
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
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.