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

Reduce number of vertices in each convex hull #37

Open neemoh opened 8 months ago

neemoh commented 8 months ago

I was wondering if there is a way to reduce the number of vertices of each convex hull.

Compared to VHACD I get a lot more vertices per convex hull with COACD. Although I am quite impressed with the quality of the decomposition of COACD, the high number of vertices will affect collision checking too just like having too many convex hulls.

Here is an example. Compare for instance the VHACD2 MEDIUM case that has 8 convex hulls with 369 vertices and the COACD LOW case that has a similar 7 convex hulls but with 10 times more vertices:

image

SarahWeiii commented 7 months ago

Thanks for bringing up the issue! I'll look into improving it when I have a moment to spare.

SarahWeiii commented 7 months ago

btw you can turn off the pre-processing if your input is manifold if it is not, one quick way to fix the problem is to manually remesh + simplify the input

neemoh commented 7 months ago

Thanks for the hint Sarah. Taking some time off now, and will check when back in the office in a couple of weeks. Will the pre processing affect the number of output vertices?

Unfortunately, manual re meshing of the input won't be a great option, because we need something that works with little intervention from users. The VHACD has a parameter to specify the maximum number of vertices per convex hull (we use the default 64). Would such a parameter be feasible to have in COACD?

SarahWeiii commented 6 months ago

oh sorry for the late reply. The results are convex hulls of the original mesh so the pre-processing can reduce the output vertices. I planned to add some automatic pre-processing but haven't finished. It can help reduce the vertices but cannot specify the maximum number of vertices per convex hull.

neemoh commented 5 months ago

That is great to hear! I think one can live without specifying the exact number of vertices. However, being able to reduce the number of vertices is really crucial to speed up collision-checking, which is a common use of composite convex hulls.