SarahWeiii / CoACD

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

Problem encounted in generating collision shape #35

Closed Dingry closed 1 year ago

Dingry commented 1 year ago

Hello, thanks for your exciting work! When attempting to generate a collision shape, I've run into an error on occasion. Could you possibly provide some assistance with this?

[2023-10-17 20:55:47.905] [CoACD] [info] threshold 0.05 [2023-10-17 20:55:47.905] [CoACD] [info] max # convex hull -1 [2023-10-17 20:55:47.905] [CoACD] [info] preprocess mode auto [2023-10-17 20:55:47.905] [CoACD] [info] preprocess resolution 50 [2023-10-17 20:55:47.905] [CoACD] [info] pca false [2023-10-17 20:55:47.905] [CoACD] [info] mcts max depth 3 [2023-10-17 20:55:47.905] [CoACD] [info] mcts nodes 20 [2023-10-17 20:55:47.905] [CoACD] [info] mcts iterations 150 [2023-10-17 20:55:47.905] [CoACD] [info] merge true [2023-10-17 20:55:47.905] [CoACD] [info] seed 0 [2023-10-17 20:55:47.908] [CoACD] [info] - Manifold Check [2023-10-17 20:55:48.089] [CoACD] [info] [1/3] Edge check finish python: /project/src/intersection.h:663: static void threeyd::moeller::TriangleIntersects::isect2(const TemplatedVec&, const TemplatedVec&, const TemplatedVec&, threeyd::moeller::TriangleIntersects::declfloat, threeyd::moeller::TriangleIntersects::declfloat, threeyd::moeller::TriangleIntersects::declfloat, threeyd::moeller::TriangleIntersects::declfloat, threeyd::moeller::TriangleIntersects::declfloat, threeyd::moeller::TriangleIntersects::declfloat, threeyd::moeller::TriangleIntersects::declfloat&, threeyd::moeller::TriangleIntersects::declfloat&, TemplatedVec&, TemplatedVec&) [with TemplatedVec = coacd::IntersectVector3; threeyd::moeller::TriangleIntersects::declfloat = float]: Assertion `d0 != d1' failed.

I believe the issue may stem from my mesh being cut from the complete object. Could you kindly provide some guidance on how to resolve this problem? Thank you!

image model.obj.zip

SarahWeiii commented 1 year ago

I think the error happens in manifold check, you can set preprocess mode as "on" to skip the check (force remesh).

I will find the bugs later.

Dingry commented 1 year ago

Thanks so much for your advice. The issue was resolved by re-meshing via trimesh.smoothing.filter_humphrey. It appears that peculiar structures within my mesh caused this problem.