diff --git a/src/Simplification.cpp b/src/Simplification.cpp index f9ba8b5..c4530b4 100644 --- a/src/Simplification.cpp +++ b/src/Simplification.cpp @@ -524,7 +524,6 @@ void floatTetWild::swapping(std::vector& input_vertices, std::vector({{e[1], e[0]}}), weight)); } int cnt = 0; @@ -559,26 +558,11 @@ void floatTetWild::swapping(std::vector& input_vertices, std::vector -0.999) {//maybe it's for avoiding numerical issue - if (old_nvs[0].dot(old_nvs[1]) < 1 - 1e-6)//not coplanar + if (cos_a0 > -0.999 and cos_a1 > -0.999) {//if any old face too degenerate, ignore coplanarity + if (old_nvs[0].dot(old_nvs[1]) < 1 - SCALAR_ZERO)//not coplanar continue; } - //check inversion - auto &old_nv = cos_a1 < cos_a0 ? old_nvs[0] : old_nvs[1]; - bool is_filp = false; - for (int f_id:n12_f_ids) { - auto &a = input_vertices[input_faces[f_id][0]]; - auto &b = input_vertices[input_faces[f_id][1]]; - auto &c = input_vertices[input_faces[f_id][2]]; - if (old_nv.dot(((b - c).cross(a - c)).normalized()) < 0) { - is_filp = true; - break; - } - } - if (is_filp) - continue; - //check quality Scalar cos_a0_new = get_angle_cos(input_vertices[v1_id], input_vertices[n_v_ids[0]], input_vertices[n_v_ids[1]]); @@ -587,31 +571,36 @@ void floatTetWild::swapping(std::vector& input_vertices, std::vector