Skip to content

Misleading example demo_MBS_collision_trimesh #541

@bmo-Scape

Description

@bmo-Scape

Based on the example demo_MBS_collision_trimesh, one might think that Chrono/bullet is able to do collision checking of concave meshes. Also, visually inspecting the simulation suggests that this is perfectly feasible (adding 30 objects instead of 15 and removed the spheres):

Image

The objects are lying nicely stacked on each other and the simulation seems reasonable.

But using a different mesh, namely just the simplest possible cube instead but through a ChTriangleMeshConnected-object like this:

// const auto mesh = ChTriangleMeshConnected::CreateFromWavefrontFile(GetChronoDataFile("models/bulldozer/shoe_view.obj"), false, true);
const auto mesh = ChTriangleMeshConnected::CreateFromSTLFile("PathToBasicCube.stl", false);

, the simulation looks like this, where lots of the objects are lying inside each other:

Image

Instead of assuming that the code is able to do this kind of collision checking, I would suggest that that example is modified to copy the triangles from mesh into a std::shared_ptr<ChTriangleMeshSoup> and then set that on the ChCollisionShapeTriangleMesh. This would result in ChCollisionModelBullet::injectTriangleMesh(...) creating convex decompositions of the meshes and therefore a much more stable simulation. Also, that approach would be usable as a starting approach for others wanting to implement something that requires simulations using concave meshes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions