Contact detection on mesh objects

77 views
Skip to first unread message

Antoine Laborde

unread,
Oct 1, 2025, 9:31:40 AM (6 days ago) Oct 1
to ProjectChrono
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 

Dan Negrut

unread,
Oct 1, 2025, 12:27:17 PM (6 days ago) Oct 1
to Antoine Laborde, ProjectChrono

Antoine – my suggestion, at this point is this:

  • Simplify your Chrono model to the bare-bone minimum, which still shows the problem that you are mentioning.
  • Post this simplified model here on the forum.
  • We might be able to provide help by looking at the simple model that still shows the pathological behavior you pointed out

NOTE: If you post here, the Chrono model will be in the public domain.

Dan

---------------------------------------------

Bernard A. and Frances M. Weideman Professor

NVIDIA CUDA Fellow

Department of Mechanical Engineering

Department of Computer Science

University of Wisconsin - Madison

4150ME, 1513 University Avenue

Madison, WI 53706-1572

608 772 0914

http://sbel.wisc.edu/

http://projectchrono.org/

---------------------------------------------

--
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 projectchron...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/projectchrono/013ce180-1ec7-4d6a-95c1-e6e91e3c81f2n%40googlegroups.com.

Radu Serban

unread,
Oct 3, 2025, 3:22:22 AM (5 days ago) Oct 3
to ProjectChrono

Antoine,

 

Have you ensured that the collision meshes are flagged as concave in the ChCollisionShapeTriangleMesh 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.

 

--Radu

 

From: 'Antoine Laborde' via ProjectChrono <projec...@googlegroups.com>
Sent: Wednesday, October 1, 2025 2:12 PM
To: ProjectChrono <projec...@googlegroups.com>
Subject: [chrono] Contact detection on mesh objects

 

Dear all,

--

Antoine Laborde

unread,
Oct 3, 2025, 9:11:12 AM (4 days ago) Oct 3
to ProjectChrono
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 

Radu Serban

unread,
Oct 3, 2025, 9:41:17 AM (4 days ago) Oct 3
to ProjectChrono

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.

Antoine Laborde

unread,
Oct 3, 2025, 11:35:26 AM (4 days ago) Oct 3
to ProjectChrono
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

Reply all
Reply to author
Forward
0 new messages