Hi Antoine, You are correct, the envelope is there just to allow taking into account potential collisions before they actually occur (this is only needed for the NSC, non-smooth contact formulation; SMC does not require an envelope and setting it to something other than zero in that case is just a waste).
--Radu From: 'Antoine Laborde' via ProjectChrono <[email protected]> Sent: Friday, October 3, 2025 5:35 PM To: ProjectChrono <[email protected]> Subject: Re: [chrono] Contact detection on mesh objects Thanks for the details. So if I understand correctly, the envelope parameter is the distance between 2 collision shapes that will trigger a collision detection check. But I could have set the envelope as big as I wanted, if no collision happens, then no contact is detected. It makes sense. Thanks for your help! Best, Antoine Le vendredi 3 octobre 2025 à 15:41:17 UTC+2, Radu Serban a écrit : Antoine, happy to hear that solved the issue. That value represents a “thickness” for the mesh (which mathematically has zero thickness) which can significantly - as you observed - improve the robustness of the collision detection between two meshes (for collision of a mesh with some other primitive, leaving that value at zero will work because the necessary “thickness” is provided by the other shape). Collision between two triangles is broken down into collisions between features of the triangles. This thickness value effectively changes vertices to (small) spheres, edges to (thin) capsules, etc. Consider the case of an edge-edge collision. With this value to zero it’s almost sure the collision will be missed. Although the default value is set to zero, it is crucial to set a small positive value, especially when interested in mesh-mesh collisions. Maybe I’ll just change the signature of that function so that it does not have default arguments. Typing a few more characters is better than getting incorrect results. --Radu From: 'Antoine Laborde' via ProjectChrono <[email protected]> Sent: Friday, October 3, 2025 3:11 PM To: ProjectChrono <[email protected]> Subject: Re: [chrono] Contact detection on mesh objects Thank you both Dan and Radu for your help ! I did setup is_convex to False but didn't tune the radius argument (5th argument). With radius set to 0.0001 I do get a contact between the two gears thank you very much ! Can you give me some explanations on what this argument is doing ? The doc is saying "outward sphere-swept layer (when supported)" but I am not sure I get it right. Best, Antoine Le vendredi 3 octobre 2025 à 09:22:22 UTC+2, Radu Serban a écrit : Antoine, Have you ensured that the collision meshes are flagged as concave in the ChCollisionShapeTriangleMesh<https://urldefense.com/v3/__https:/api.projectchrono.org/classchrono_1_1_ch_collision_shape_triangle_mesh.html__;!!Mak6IKo!NRKegQMhUIe0xTrIIHcQ2fHI8sLsly3ubPGN3qi85itvKS5tRm5Oc8f7tzmVERnFa4irtkDbQRtyEuxqU_1cRKSGx4c$> constructor (4th argument set to false) and provided a non-zero mesh thickness (5th argument, which defaults to zero)? Please take a look at how collision meshes are set up in demo_MBS_collision_trimesh<https://urldefense.com/v3/__https:/github.com/projectchrono/chrono/blob/main/src/demos/mbs/demo_MBS_collision_trimesh.cpp__;!!Mak6IKo!NRKegQMhUIe0xTrIIHcQ2fHI8sLsly3ubPGN3qi85itvKS5tRm5Oc8f7tzmVERnFa4irtkDbQRtyEuxqU_1caTohidg$>. --Radu From: 'Antoine Laborde' via ProjectChrono <[email protected]> Sent: Wednesday, October 1, 2025 2:12 PM To: ProjectChrono <[email protected]> Subject: [chrono] Contact detection on mesh objects Dear all, I work on watch parts simulation through rigid body dynamics. I had problems with contact detection between some parts so I decided to build the simplest scenario where I get the problem. This scenario is the simulation of gears (as mesh objects). The problem is that the teethes of the gears don't collide, they go through each others. The script does the following: - load the STL files of the gears - create ChBody for each gear - add triangle mesh visualization shape - add collision shape using ChCollisionShapeTriangleMesh - apply a torque to one of the gears using AccumulateTorque() until a speed of 0.05 rad/s is reached I am using ChSystemNSC with BULLET collision detection. I checked project chrono documentation page on collision detection and tuned the contact envelope and margin but didn't get any result. To make sure it was not due to the accuracy, I reduced the speed of the gear and set the time step to 0.001 s. When I launch one gear on the other, like throwing a ball on another, the collision occurs. I don't have a lot of experience on rigid body analysis so any feedback would be greatly appreciated ! Best, Antoine -- You received this message because you are subscribed to the Google Groups "ProjectChrono" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/projectchrono/013ce180-1ec7-4d6a-95c1-e6e91e3c81f2n%40googlegroups.com<https://urldefense.com/v3/__https:/groups.google.com/d/msgid/projectchrono/013ce180-1ec7-4d6a-95c1-e6e91e3c81f2n*40googlegroups.com?utm_medium=email&utm_source=footer__;JQ!!Mak6IKo!KIcttF-aY_trjz5PerxrXWX2bImARUwfANsEX8FfnOwUFoQ-ke9wZgFmNIKcO100oIy6jvCjFsJEaX974-UFEpQcvuI$>. -- You received this message because you are subscribed to the Google Groups "ProjectChrono" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/projectchrono/24355cf3-9096-403d-adf2-0598f7bb9229n%40googlegroups.com<https://urldefense.com/v3/__https:/groups.google.com/d/msgid/projectchrono/24355cf3-9096-403d-adf2-0598f7bb9229n*40googlegroups.com?utm_medium=email&utm_source=footer__;JQ!!Mak6IKo!NRKegQMhUIe0xTrIIHcQ2fHI8sLsly3ubPGN3qi85itvKS5tRm5Oc8f7tzmVERnFa4irtkDbQRtyEuxqU_1cpxbjPQ0$>. -- You received this message because you are subscribed to the Google Groups "ProjectChrono" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]<mailto:[email protected]>. To view this discussion visit https://groups.google.com/d/msgid/projectchrono/962fc8cb-2d48-4ffe-9a96-8386a8f6175fn%40googlegroups.com<https://urldefense.com/v3/__https:/groups.google.com/d/msgid/projectchrono/962fc8cb-2d48-4ffe-9a96-8386a8f6175fn*40googlegroups.com?utm_medium=email&utm_source=footer__;JQ!!Mak6IKo!In5IsscAbTm6pqKY8eJhna8pFG8A3qBlM9vjFmAfS5If_vvtGpTAKXe650OzkvcKxhBpDNnA2dNW9i0iXcf2AdfcD18$>. -- You received this message because you are subscribed to the Google Groups "ProjectChrono" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/projectchrono/CH3PPF46CDC2185755242DD6C0E37EE45A9A7E1A%40CH3PPF46CDC2185.namprd06.prod.outlook.com.
