Hello,
I want to do some grasping on some shapes like pentagons, hexagons, etc which don't belong to primitive shapes. Is making these shapes from external resources and importing mesh the only way or I can make these shapes inside the cop-Elia simulator? I imported some shapes from outside but their physics behavior is not very stable so I'd prefer internal shapes if possible. Any advice is appreciated! Thank you!
Complex polygon shape design or import
Re: Complex polygon shape design or import
Hello,
in general, primitive shapes and/or convex shapes perform best. So if you import a shape, its icon in the scene hierarchy tells you whether it is convex or not. If it is not convex, then you can generate a convex shape from it with [Menu bar --> Edit --> Morph selection into convex shapes].
In a similar way you can take, e.g. a cuboid, duplicate it, and rotate the copy, and repeat. This way you can obtain a specific type of polygon. You can either group those primitive shapes (best), or use them to generate a convex polygon in the same way as described above.
Cheers
in general, primitive shapes and/or convex shapes perform best. So if you import a shape, its icon in the scene hierarchy tells you whether it is convex or not. If it is not convex, then you can generate a convex shape from it with [Menu bar --> Edit --> Morph selection into convex shapes].
In a similar way you can take, e.g. a cuboid, duplicate it, and rotate the copy, and repeat. This way you can obtain a specific type of polygon. You can either group those primitive shapes (best), or use them to generate a convex polygon in the same way as described above.
Cheers
Re: Complex polygon shape design or import
Hello,coppelia wrote: ↑07 Sep 2022, 07:52 Hello,
in general, primitive shapes and/or convex shapes perform best. So if you import a shape, its icon in the scene hierarchy tells you whether it is convex or not. If it is not convex, then you can generate a convex shape from it with [Menu bar --> Edit --> Morph selection into convex shapes].
In a similar way you can take, e.g. a cuboid, duplicate it, and rotate the copy, and repeat. This way you can obtain a specific type of polygon. You can either group those primitive shapes (best), or use them to generate a convex polygon in the same way as described above.
Cheers
What about the density of overlap part and non-overlap if I group duplicates of a rotated cuboid? Another question is I don't know how to adjust friction coefficient properly, is there a tutorial or an example scene talking about this? Thank you!
Re: Complex polygon shape design or import
Hello, how can I generate polygon convex shapes by rotating a cuboid? They don't seem to be convex shapes tho.coppelia wrote: ↑07 Sep 2022, 07:52 Hello,
in general, primitive shapes and/or convex shapes perform best. So if you import a shape, its icon in the scene hierarchy tells you whether it is convex or not. If it is not convex, then you can generate a convex shape from it with [Menu bar --> Edit --> Morph selection into convex shapes].
In a similar way you can take, e.g. a cuboid, duplicate it, and rotate the copy, and repeat. This way you can obtain a specific type of polygon. You can either group those primitive shapes (best), or use them to generate a convex polygon in the same way as described above.
Cheers
Re: Complex polygon shape design or import
The convex hull of a shape is always convex, by definition.
Re: Complex polygon shape design or import
What Coppelia meant is to copy/paste cuboids so that their convex hull is exactly the shape you need.
Here I used one cuboid, and an additional dummy (parent) to use as rotation center, copy/paste, rotate \(i\)th dummy by \(2\pi\frac{i}{n}\), group, and use the function "Morph selection into convex shapes".
You can put all these operations in a customisation script, that dynamically regenerates the convex shape based on params (e.g. number of sides, radius, etc...).
Alternatively, you can get a similar result by programmatically generating all the vertices, and triangulating those, then using sim.createMeshShape
Here I used one cuboid, and an additional dummy (parent) to use as rotation center, copy/paste, rotate \(i\)th dummy by \(2\pi\frac{i}{n}\), group, and use the function "Morph selection into convex shapes".
You can put all these operations in a customisation script, that dynamically regenerates the convex shape based on params (e.g. number of sides, radius, etc...).
Alternatively, you can get a similar result by programmatically generating all the vertices, and triangulating those, then using sim.createMeshShape
Re: Complex polygon shape design or import
Hello, this sounds exactly what I need, may I ask how to write this script like how to rotate with respect to which frame etc? Thank you!fferri wrote: ↑08 Sep 2022, 12:07 What Coppelia meant is to copy/paste cuboids so that their convex hull is exactly the shape you need.
Here I used one cuboid, and an additional dummy (parent) to use as rotation center, copy/paste, rotate \(i\)th dummy by \(2\pi\frac{i}{n}\), group, and use the function "Morph selection into convex shapes".
You can put all these operations in a customisation script, that dynamically regenerates the convex shape based on params (e.g. number of sides, radius, etc...).
Alternatively, you can get a similar result by programmatically generating all the vertices, and triangulating those, then using sim.createMeshShape