Function AddTriangleMesh() in class ChCollisionModel does not seem to work

52 views
Skip to first unread message

Chao Zhang

unread,
Mar 29, 2023, 3:23:44 AM3/29/23
to ProjectChrono
Hi, developers

I am trying to move my obj mesh model to any point in 3d space when I build collision model in chrono physical system. Unfortunately, I find that member function AddTriangleMesh() in class ChCollisonModelBullet. It seems that AddBox works weel. Even though Transform() for ChTriangleMeshConnected object will be helpful to me. 
Any advice will be appreciate.

PS: I'm using the latest version of Chrono trunk code.

Chao

Chao Zhang

unread,
Mar 29, 2023, 3:27:06 AM3/29/23
to ProjectChrono
Attached code: demo_MBS_collision_trimesh.cpp in Project Chrono

Radu Serban

unread,
Mar 29, 2023, 10:37:14 AM3/29/23
to ProjectChrono

Hi Chao,

 

You didn’t attach your sample code. So, I’m not exactly sure what you are trying to do.  Having said that, when using the Bullet collision system, the position and orientation passed to AttachTriangleMesh are indeed ignored (that’s not the case if you use the CHRONO collision system type).

 

For the case of the Bullet collision system type, one solution is to transform all mesh vertices (using, for example, ChTriangleMeshConnected::Tranform()) prior to attaching it to the body, or else move the body itself; if, as I suspect, the body you want to attach the collision mesh to is the “ground” body, note that you can have multiple bodies that you declare as “fixed”.

 

--Radu

--
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 on the web visit https://groups.google.com/d/msgid/projectchrono/36edafa5-a8b5-475d-98a2-44e33c1c37f0n%40googlegroups.com.

Chao Zhang

unread,
Mar 31, 2023, 7:46:30 AM3/31/23
to Radu Serban, ProjectChrono
Hi Radu,

I am very grateful the problem was resolved under your advices.😄
It is worth mentioning that the attached code is "demo_MBS_collision_trimesh.cpp" in the master of ProjectChrono, I just modified the position and orientation of body_B to attach the collison shape.

Chao

'Radu Serban' via ProjectChrono <projec...@googlegroups.com> 于2023年3月29日周三 22:37写道:
You received this message because you are subscribed to a topic in the Google Groups "ProjectChrono" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/projectchrono/UGy9z9e0U7w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/PH0PR06MB8237380BF8647F8C246D52BCA7899%40PH0PR06MB8237.namprd06.prod.outlook.com.
Reply all
Reply to author
Forward
0 new messages