mirror of https://github.com/CGAL/cgal
[smooth] do not forget cells_to_update in pre-collapse max cos
and reorganize post-collapse conditions
This commit is contained in:
parent
55bb9c7bd5
commit
77805fde8d
|
|
@ -218,12 +218,8 @@ public:
|
|||
#ifdef PROTECT_ANGLES_FROM_COLLAPSE
|
||||
const Dihedral_angle_cosine acceptable_max_cos(0.995); // 0.995 cos <=> 5.7 degrees
|
||||
Dihedral_angle_cosine curr_max_cos
|
||||
= max_cos_dihedral_angle(triangulation, cells_to_remove[0]);
|
||||
for (std::size_t i = 1; i < cells_to_remove.size(); ++i)
|
||||
{
|
||||
curr_max_cos = (std::max)(curr_max_cos,
|
||||
max_cos_dihedral_angle(triangulation, cells_to_remove[i]));
|
||||
}
|
||||
= (std::max)(max_cos_dihedral_angle_in_range(triangulation, cells_to_remove, false),
|
||||
max_cos_dihedral_angle_in_range(triangulation, cells_to_update, false));
|
||||
#endif
|
||||
|
||||
vh0->set_point(Point_3(v0_new_pos.x(), v0_new_pos.y(), v0_new_pos.z()));
|
||||
|
|
@ -280,16 +276,18 @@ public:
|
|||
return ORIENTATION_PROBLEM;
|
||||
if (!triangulation.tds().is_valid(cit, true))
|
||||
return C_PROBLEM;
|
||||
#ifdef PROTECT_ANGLES_FROM_COLLAPSE
|
||||
|
||||
auto max_cos_after_collapse = max_cos_dihedral_angle(triangulation, cit);
|
||||
|
||||
if ( curr_max_cos < max_cos_after_collapse // angles decreased
|
||||
&& acceptable_max_cos < max_cos_after_collapse) // && angles go below acceptable bound
|
||||
return ANGLE_PROBLEM;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef PROTECT_ANGLES_FROM_COLLAPSE
|
||||
for (Cell_handle cit : triangulation.finite_cell_handles())
|
||||
{
|
||||
auto max_cos_after_collapse = max_cos_dihedral_angle(triangulation, cit, false);
|
||||
if ( curr_max_cos < max_cos_after_collapse // angles decreased
|
||||
&& acceptable_max_cos < max_cos_after_collapse) // && angles go below acceptable bound
|
||||
return ANGLE_PROBLEM;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (Vertex_handle vit : triangulation.finite_vertex_handles())
|
||||
{
|
||||
if (!triangulation.tds().is_valid(vit, true))
|
||||
|
|
|
|||
|
|
@ -379,6 +379,21 @@ Dihedral_angle_cosine max_cos_dihedral_angle(const Tr& tr,
|
|||
return cos_dh;
|
||||
}
|
||||
|
||||
template<typename Tr, typename CellRange>
|
||||
Dihedral_angle_cosine max_cos_dihedral_angle_in_range(const Tr& tr,
|
||||
const CellRange& cells,
|
||||
const bool use_cache = true)
|
||||
{
|
||||
Dihedral_angle_cosine max_cos_dh = cosine_of_90_degrees();
|
||||
for (const auto c : cells)
|
||||
{
|
||||
const Dihedral_angle_cosine cos_dh = max_cos_dihedral_angle(tr, c, use_cache);
|
||||
if (max_cos_dh < cos_dh)
|
||||
max_cos_dh = cos_dh;
|
||||
}
|
||||
return max_cos_dh;
|
||||
}
|
||||
|
||||
template<typename C3t3>
|
||||
bool is_peelable(const C3t3& c3t3,
|
||||
const typename C3t3::Cell_handle ch,
|
||||
|
|
|
|||
Loading…
Reference in New Issue