Transform STL import to pure or convex shape

Typically: "How do I... ", "How can I... " questions
Post Reply
Piorot
Posts: 4
Joined: 17 Nov 2020, 14:48

Transform STL import to pure or convex shape

Post by Piorot »

Hi,
i'm trying to import some objects to my V-REP scene for a robotic project.
The objects have to be respondable and dynamic!

My way to do this:
- create the object in a CAD software (Autodesk Inventor) and save it as STL mesh
- go to V-REP -> File -> Import -> Mesh...
- the object is loaded in the scene, but not respondable or dynamic. If i want to hit the checkbox "Body is respondable" i got a warning, that the object should be a pure or a convex shape.

So i tried:
- rightclick on the object -> edit -> Morph selection into convex shape
and
- rightclick on the object -> edit -> Morph selection into its convex decomposition (tried many different settings)

BUT it does'nt matter which Morph selection i pick, the result is very bad! Sometimes surfaces are missing, sometimes there are surfaces straight through the object. I cant use any of the solutions. The objects are very simple and small (e.g. a simple rectangular box).

Please help me! What i have to do if i want to import simple objects and make them respondable and dynamic?

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Transform STL import to pure or convex shape

Post by coppelia »

Hello,

it is very difficult to make that procedure automatic. For complex meshes, your best option that you already mentioned is the convex decomposition method. Sometimes you need to first decimate a shape, before doing the convex decomposition.

For meshes that are obviously more simple, you can do a convex hull extraction. Here also, it might help to first decimate the shape somewhat.

Finally, for primitive shapes, you can enter the triangle edit mode. Then select relevant portions of the triangles that form your primitive shape, then click extract cuboid, extract cylinder or extract sphere.

Finally, you can always programmatically generate primitive shapes (e.g. with sim.createPureShape), or you can write an appropriate XML file that describes your shapes and import that.

Cheers

zhy149
Posts: 132
Joined: 14 Apr 2021, 20:18

Re: Transform STL import to pure or convex shape

Post by zhy149 »

https://drive.google.com/file/d/19OEC2m ... share_link
coppelia wrote: 08 Dec 2020, 14:42 Hello,

it is very difficult to make that procedure automatic. For complex meshes, your best option that you already mentioned is the convex decomposition method. Sometimes you need to first decimate a shape, before doing the convex decomposition.

For meshes that are obviously more simple, you can do a convex hull extraction. Here also, it might help to first decimate the shape somewhat.

Finally, for primitive shapes, you can enter the triangle edit mode. Then select relevant portions of the triangles that form your primitive shape, then click extract cuboid, extract cylinder or extract sphere.

Finally, you can always programmatically generate primitive shapes (e.g. with sim.createPureShape), or you can write an appropriate XML file that describes your shapes and import that.

Cheers
Hello,

I've attached a scene with a very simple ellipsoid cylinder. It drops and continuously shakes without stopping. I'd appreciate if you can provide me some advice to make it stable and look normal.

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Transform STL import to pure or convex shape

Post by coppelia »

Hello,

make sure to switch to CoppeliaSim V4.5 or later. In there, enable [Menu bar >> Tools >> Visualize inertias] and you will see that the inertia in not visible, because ill-defined. Select the ellipsoid, then open the shape dynamics properties dialog. You will see a message in red stating: Invalid/unstable inertia matrix: A+B<C
You can easily recompute the inertia by having the shape selected, then [Menu bar >> Edit >> Shape mass and inertia >> compute from uniform density...]

Cheers

Post Reply