[SofaPython3] Contact area calculation: too few contact triangles detected by ContactListener? #5631
Replies: 3 comments
-
|
Hello ! Because you have multiple collision model on each object, the contacts will be distributed amongs those. some will be filtered and so on. Here what you get are only triangles that are colliding with points of the plane. What I suggest is to remove all collision model on the cube except the triangles and same for the plane. Now the issue is that the intersector you are using Tell me how it goes. |
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I’m new to SOFA and currently learning how to simulate soft body interactions using SofaPython3.
I'm trying to calculate the contact area between a soft cube and a fixed plane using the
ContactListenercomponent. I’m using SOFA v24.12.00.The contact area is being calculated, but I’m noticing that the number of contact triangles being reported is clearly too small compared to what I can see visually in the simulation.
For example, at a moment when the cube is visibly in wide contact with the plane, I get this output:
[Frame 50] Contact points detected: 1 → tid1=0, tid2=1 [Frame 50] Contact triangle IDs: [0, 1] [Frame 50] Contact area: 33.729912 m^2, Number of triangles: 2This seems too few for the wide contact area visible in the scene.
Screenshot:
What I’m doing:
I'm using
ContactListenerto get contact point info, then collecting triangle IDs from the contact pairs, and finally computing area using the associated triangle vertices.My controller code:
My createScene() function:
My question:
How can I improve the accuracy of contact triangle detection?
It seems that only a very small number of contacts are triggering detection, and therefore only a few triangles are being used to compute the area — even when the actual contact area is much larger.
Is there a setting or best practice to get more complete contact detection?
Should I change my collision models, resolution, or use another method?
Any advice or suggestions would be really appreciated. Thank you very much!
Beta Was this translation helpful? Give feedback.
All reactions