- This topic has 2 replies, 2 voices, and was last updated 3 years, 6 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Using SOFA › [SOLVED] Counting number of nodes in contact
Hello,
I’m wondering if there is a way to count the number of nodes that are in contact on a surface. I see that on the SOFA GUI (under “Interactions”) there are lines drawn on contact areas, which I believe correspond to the “alarmDist” field of MinProximityIntersection.
1. Is there a way to see a list of those nodes/elements in contact? I found a related matrix called “constraint” (data field under the collision mesh’s Mechanical Object), but this seems to include more nodes than just those in contact.
2. What do the 3 GUI line colors (red, green/blue, white) mean?
Any guidance would be greatly appreciated, thanks!
Example image:
(link in case embedded image fails: https://github.com/thomaswxu/SOFA/blob/main/exampleImages/exampleContactLines.PNG)
Hi @twxu
Using the GenericConstraintSolver, you can activate the “computeConstaintForces” boolean. This fills the nodal data field “constraintForces”: this vector will have the size of the constraints, i.e. contacts.
Let me know it this helps.
Best wishes,
Hugo
Hi @Hugo,
Thanks very much; I was able to count the exact number of nodes in contact using both the “constraintForces” vector and a BoxROI containing just the contact surface of the object.
I’m just a bit confused on how to interpret the constraintForces vector: specifically, how to use it to calculate contact pressure. Though, that discussion may be better at the other topic: sofa-framework.org/community/forum/topic/measuring-contact-pressure/
In any case I’ll mark this topic as solved; thanks!
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.