hjwdzh / Manifold

Convert any Triangle Mesh to Watertight Manifold
Other
594 stars 77 forks source link

Crash when processing a post-processed shapenet file #5

Closed noamgat closed 4 years ago

noamgat commented 4 years ago

Hi, I've postprocessed shapenet models, using the mesh fusion ( https://github.com/davidstutz/mesh-fusion ) library, in order to add "thickness" to the shapenet model to avoid very thin regions.

Here is an example: u1e22cc04-7c4d-4ed5-bda3-8ff8067f22ee.zip

When I later try to simplify them (and keep them watertight), I get a crash with the simplify tool:

simplify -i u1e22cc04-7c4d-4ed5-bda3-8ff8067f22ee.obj -o u1e22cc04-7c4d-4ed5-bda3-8ff8067f22ee_65536.obj -m -f 65536

simplify: /home/noamgat/hdd/Manifold/3rd/igl/per_vertex_point_to_plane_quadrics.cpp:83: igl::per_vertex_point_to_plane_quadrics(const MatrixXd&, const MatrixXi&, const MatrixXi&, const MatrixXi&, const MatrixXi&, std::vector<std::tuple<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, 1, -1, 1, 1, -1>, double> >&)::<lambda(const RowVectorXd&, const MatrixXd&, double)>: Assertion `std::abs(S.row(j).dot(ei)) < 1e-10' failed. Aborted (core dumped)

This is consistent across all models. They are watertight (MeshlabServer is able to compute their volume, which is only possible for watertight meshes).

Any idea why this is happening?

hjwdzh commented 4 years ago

I believe this is the problem of the libigl library. I also had this problem before when the triangle is degenerated, e.g., the length of some certain edges is smaller than 1e-10. I think you could check whether you have such edges, and if so, this should probably be the problem.

noamgat commented 4 years ago

Assuming this is the case, how would you advise to work around this issue?

On Thu, Nov 21, 2019 at 8:21 PM Jingwei Huang notifications@github.com wrote:

I believe this is the problem of the libigl library. I also had this problem before when the triangle is degenerated, e.g., the length of some certain edges is smaller than 1e-10. I think you could check whether you have such edges, and if so, this should probably be the problem.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hjwdzh/Manifold/issues/5?email_source=notifications&email_token=AAKFA2ALQK2O4TG6CV5C7NDQU3GSXA5CNFSM4JP7SL3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE3FXOI#issuecomment-557210553, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKFA2CKKGVURM6EVRJFCZTQU3GSXANCNFSM4JP7SL3A .

hjwdzh commented 4 years ago

Maybe consider implementing the simplify yourself, or change the libigl code a little bit, or remove degenerated triangles in the mesh (which I think is the most difficult option).