avaxman/Directional

dual_cycles crash

cristiulian opened this issue · 5 comments

It crashes at line 199:
sumBoundaryLoops.setFromTriplets(sumBoundaryLoopsTriplets.begin(), sumBoundaryLoopsTriplets.end());

Going further into the stack, it crashes in Eigen SparseMatrix.h, line 934:
eigen_assert(it->row()>=0 && it->row()<mat.rows() && it->col()>=0 && it->col()<mat.cols());

With which input?

This is the piece of code:

Eigen::MatrixXcd powerField;
Eigen::MatrixXd rawField, representative;

Eigen::VectorXd effort;
Eigen::VectorXi matching;
Eigen::MatrixXi EV, FE, EF;
Eigen::VectorXi singIndices, singVertices;

igl::edge_topology(V, F, EV, FE, EF);
directional::power_field(V, F, b, bc, 4, powerField);
directional::power_to_representative(V, F, powerField, 4, representative);
representative.rowwise().normalize();
directional::representative_to_raw(V,F,representative, 4, rawField);
directional::principal_matching(V, F, EV, EF, FE, rawField, matching, effort);
directional::effort_to_indices(V, F, EV, EF, effort, matching, 4, singVertices, singIndices);

It hangs on effort_to_indices.

orc_84k.zip

The mesh is a quad mesh. Directional (currently, but there is also not much research on it) accepts only triangle meshes.

This is (likely) a problem of having multiple component, which would make the topological operations (finding generators and boundary loops) fail.

An example mesh:

orc_84k_tri.obj.zip