STL importer for softbodies

Please don't post Bullet support questions here, use the above forums instead.
Post Reply
Ehsanizadi
Posts: 72
Joined: Mon Dec 02, 2013 4:13 pm

STL importer for softbodies

Post by Ehsanizadi »

Hi,

For a project I had to import a softbody from stl, I used the "loadFromMeshSTL.h" (in ../examples/Importers/ImportSTLDemo/), however I found that it only works for rigid bodies.
Actually it gets each face and transfers the 3 vertexes individually to the vertices array. As a result, if you make a softbody using a stl object, each triangle will be an individual softbody which is meaningless! however, for rigid bodies, it works fine.

So, I extended the existing STL importer for softbodies. You can find it here below in the case you needed such thing:
https://github.com/Ehsanizadi/Bullet-ex ... Importer.h
the function name is :STLImporterToSoftBody
It can be regarded as a softbody helper as well.
In addition it merges the repetitive vertices and removes them from the memory, resulting a unified and continuous softbody. So, do not hesitate to use it for you arbitary shaped softbodies in Bullet.

Hope it helps the nice and very supportive Bullet community.

Ehsan
Post Reply