
Convex decomposition
V-REP allows calculating and adding the convex decomposition of specified shapes. Convex shapes perform faster and are more stable that random shapes, in regards to dynamic collision response calculation. They are however not as fast nor as stable as pure shapes!

[Non-convex model (left) and corresponding convex-decomposed model (right)]
You can either add the convex decomposition of selected shapes, or you can morph selected shapes into their convex decomposition equivalent:
adding the convex decomp. : [Menu bar --> Add --> Convex decomposition of selected shapes]
morphing into convex decomp. : [Menu bar --> Edit --> Morph selected shapes into convex shapes]
Following dialog pops open and allows adjusting the way shapes are decomposed:

[Convex decomposition parameter dialog]
Following parameters are applied for each individual shape:
Handle grouped shape components individually: when checked, then each individual mesh of a grouped shape will be handled on its own during decomposition, otherwise the grouped shape is considered as a single mesh.
Apply random colors for easier entity distinction: has only a visual impact.
Add extra points: specifies whether extra points should be added when computing the concavity.
Add extra face points: specifies whether faces points should be added when computing the concavity.
Min. nb of clusters: specifies the minimum number of clusters to be generated
Max. concavity: specifies the maximum allowed concavity.
Max. connection distance: specifies the maximum allowed distance to get convex clusters connected.
Target nb of triangles of decimated mesh: specifies the targeted number of triangles of the decimated mesh.
Max. nb of vertices / convex hull: specifies the maximum number of vertices for each generated convex hull.
Small cluster detection threshold (%): specifies the threshold to detect small clusters. The threshold is expressed as a percentage of the total mesh surface.
Max. iterations: the convex decomposition algorithm operates in an approximate way, which means that created shapes might be more or less convex. V-REP uses its own convexivity measure: a shape is considered convex only if all of its vertices lie within the half-volumes defines by all triangular faces, and this with a tolerance of 1.5% of the shape's average bounding box side length. The max. iterations parameter allows to iterate several times over the created meshes if they don't appear as convex enough to V-REP.
Recommended topics
Convex hull calculation
|