I can't get Sim3D PreciseContacts to work
Show older comments
I have some concave STL mesh that I put in the 3d sim world, I noticed the collisions (require physics enabled) or overlap are detected according to a simplified convex hull around the part.
I figured the parameter PreciseContacts should do the trick, but when activated then collision events or overlap events are no longer detected.
Answers (1)
Nishan Nekoo
on 17 Jun 2024
0 votes
Hi Jesse, do you have a script or model that you can share so that I can replicate this behavior?
4 Comments
Nishan Nekoo
on 19 Jun 2024
Hi Jesse,
It is a documented limitation that when PreciseContacts are enabled for an object, Physics and Gravity are disabled for that actor.
In your case, the part on the top does not have precise contacts enabled - and you enabled physics on it. If you enable gravity for this part and have a starting point closer to the part below, it seems to behave as expected, colliding with the part on the bottom and then resting on it as shown below:

I have some questions about the following:
"Also, the part who doesn't have precise contacts enabled must have physics enabled, which cause a bunch of problems (not possible to have hierarchy of actors, no control of the movement, it just bounces randomly when collision is detected)."
- What kind of hierarchy are you unable to achieve?
- What kind of movement control are you hoping for? In the script you provided, you are manually specifying the translation of the top part. Are you expecting the top part to ignore the specified translation once a collision with the bottom part takes place?
- I notice some jitter too when the objects are first resting on top of each other but this eventually resolves itself - is this what you are referring to?
I'm eager to learn more about what you are trying to do here and provide any support I can, so please let me know how I can help!
Nishan
Jesse
on 19 Jun 2024
Nishan Nekoo
on 24 Jun 2024
Hi Jesse, this appears to be a limitation with using PreciseContacts due to the fact that PreciseContacts uses complex collision, and collision detection happens with very single vertices and faces of the object mesh.
Objects with PreciseContacts set to true cannot generate events while
- Moving kinematically and interacting with static or moving objects.
- Static and interacting with static or moving objects which also has PreciseContacts true.
This limitation will be better documented in the future but I wanted to provide you an update here.
Nishan
Categories
Find more on Simulation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!