i have encountered a problem using the two methods of convex decomposition (HACD and V-HACD). Anytime i use V-HACD, the result of all next HACD-Decompisitions are corrupted.
I have different kind of meshes that i load into my scene. Depending on the kind of mesh it is better to use either HACD or V-HACD. Here is my example code:
Code: Select all
if(nObjectType == 1)then
--V-HACD
sim.addStatusbarMessage("simUtils: Convex decomposition of Bin...")
local tIntParams = {0, 0, 0, 0, 0, 100000, 20, 4, 4, 64}
local tFloatParams = {0.0, 0.0, 0.0, 0.0, 0.0, 0.002, 0.05, 0.05, 0.001, 0.0001}
nDecomposedHandle= sim.convexDecompose(nObjectHandle, 129, tIntParams, tFloatParams)
elseif(nObjectType == 2)then
--HACD
sim.addStatusbarMessage("simUtils: Convex decomposition of Workpiece...")
local tIntParams = {1, 650, 400, 4, 0, 0, 0, 0, 0, 0}
local tFloatParams = {0.01, 30.0, 0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}
nDecomposedHandle= sim.convexDecompose(nObjectHandle, 25, tIntParams, tFloatParams)
else
error("simUtils: Wrong object type for decomposition")
end
If i load object type 1 decomposed with V-HACD and then again the same object type 2 the result looks like that:
Also the computation time is much longer for the second HACD-Decomposition.
I suggest that if i once use V-HACD, all following decompositions are done with V-HACD too, no matter which parameters i pass to the function.
Am i doing something wrong with the function calls or is this really a bug?