Commit c2f2e9e3 authored by Jean-Marie Favreau's avatar Jean-Marie Favreau
Browse files

Add a workarround method when the volumic approach fails

parent b3542a89
......@@ -165,7 +165,15 @@ void MeshPatches::addPatchesInShortestCyclesPseudoVolumic(const UCharCImg & mask
}
std::cout << iManager << " (" << ((clock() - tstart)) / ((double) CLOCKS_PER_SEC) << " seconds, 2nd step) nbBoundaries: " << nbBoundaries << ", fGroupSize: " << fGroupSize << std::endl;
std::deque<VertexID> path = getShortestNonSeparatingCyclePseudoVolumic(0., mask, region, inside);
std::deque<VertexID> path;
try {
path = getShortestNonSeparatingCyclePseudoVolumic(0., mask, region, inside);
}
catch (...) {
std::cout << "Warning: cannot find cycle using pseudo-volumic approach. Back to the surface-based approach." << std::endl;
path = getShortestNonSeparatingCycle(0.0, MeshPathes::OECbyStripAndPredCut);
}
double pLength = cMesh.getLength(path, lEdgeCMeshMerge);
if ((maxLength < 0) || (pLength <= maxLength)) {
addCPath(path);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment