SarahWeiii / CoACD

[SIGGRAPH2022] Approximate Convex Decomposition for 3D Meshes with Collision-Aware Concavity and Tree Search
https://colin97.github.io/CoACD/
MIT License
405 stars 52 forks source link

CPP Error after processing several examples #23

Closed SarthakJShetty-path closed 8 months ago

SarthakJShetty-path commented 10 months ago

Thank you for open-sourcing this tool. It has been very helpful to run CD on some meshes that I have.

I was trying to decompose some meshes that I have, from an open-source dataset. After processing about ~200-300 meshes in a python for loop, I received this error:

python: /workspace/coacd/src/process.cpp:112: double coacd::MergeConvexHulls(coacd::Model&, std::vector<coacd::Model>&, std::vector<coacd::Model>&, coacd::Params&, double, double): Assertion `p1 < costSize' failed

I've seen this error about 2-3 times at this point. For context, I'm trying to decompose the mesh with these parameters:

coacd.run_coacd(
            mesh=mesh,
            threshold=0.05,
            max_convex_hull=10,
            merge=True,
        )

Please let me know if some of these parameters are incompatible or if this is a known bug for certain meshes.

Thank you!

SarthakJShetty-path commented 10 months ago

One additional point:

The constraints that I've placed on threshold and max_convex_hull are not hard constraints, and there is room to change these to more suitable values if that might help mitigate this problem.

Thank you!

SarahWeiii commented 10 months ago

Hi can you give me an example for reproducing the error?

SarthakJShetty-path commented 10 months ago

Sure! I'm using the code directly from here.

I'm running it on some obj files taken from the popular ABC dataset here.

Here is one example obj file from ABC where I run into this error.

Thank you for your time!

SarahWeiii commented 10 months ago

Hi I tried to run the code on your obj, and I couldn't reproduce the error. When i use t = 0.05 it just output 1 component, and i use t = 0.01 to produce a quite good result as follows: image

SarthakJShetty-path commented 8 months ago

@SarahWeiii apologies for not getting back. I guess the issue was I was running the file with the default parameters, which might have been causing some issue?

I will take another look at this to confirm.

Thank you for your time.