diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h index 0e709938e03..5e7dde01634 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h @@ -689,22 +689,19 @@ private: const Point_3& p0 = point(vh0->point()); const Point_3& p1 = point(vh1->point()); - - const FT length = approximate_edge_length(e, tr); - const FT density = density_along_segment(e, c3t3, true); - //density = 1./sizing_field(midpoint(e)) + const auto mass = density_along_segment(e, c3t3, true); if (vh0_moving) { - moves[i0] += density * Vector_3(p0, p1); + moves[i0] += mass * Vector_3(p0, p1); neighbors[i0]++; - masses[i0] += density * length; + masses[i0] += mass; } if (vh1_moving) { - moves[i1] += density * Vector_3(p1, p0); + moves[i1] += mass * Vector_3(p1, p0); neighbors[i1]++; - masses[i1] += density * length; + masses[i1] += mass; } } @@ -806,22 +803,19 @@ std::size_t smooth_vertices_on_surfaces(C3t3& c3t3, const Point_3& p0 = point(vh0->point()); const Point_3& p1 = point(vh1->point()); - - const FT length = approximate_edge_length(e, tr); - const FT density = density_along_segment(e, c3t3, true); - //density = 1./sizing_field(midpoint(e)) + const auto mass = density_along_segment(e, c3t3, true); if (vh0_moving) { - moves[i0] += density * Vector_3(p0, p1); + moves[i0] += mass * Vector_3(p0, p1); neighbors[i0]++; - masses[i0] += density * length; + masses[i0] += mass; } if (vh1_moving) { - moves[i1] += density * Vector_3(p1, p0); + moves[i1] += mass * Vector_3(p1, p0); neighbors[i1]++; - masses[i1] += density * length; + masses[i1] += mass; } } } @@ -1001,29 +995,27 @@ std::size_t smooth_internal_vertices(C3t3& c3t3, const std::size_t& i0 = vertex_id(vh0); const std::size_t& i1 = vertex_id(vh1); - const Point_3& p0 = point(vh0->point()); - const Point_3& p1 = point(vh1->point()); - const bool vh0_moving = (c3t3.in_dimension(vh0) == 3 && is_free(i0)); const bool vh1_moving = (c3t3.in_dimension(vh1) == 3 && is_free(i1)); if (!vh0_moving && !vh1_moving) continue; - const FT length = approximate_edge_length(e, tr); - const FT density = density_along_segment(e, c3t3); + const Point_3& p0 = point(vh0->point()); + const Point_3& p1 = point(vh1->point()); + const auto mass = density_along_segment(e, c3t3); if (vh0_moving) { - moves[i0] += density * Vector_3(p0, p1); + moves[i0] += mass * Vector_3(p0, p1); neighbors[i0]++; - masses[i0] += density * length; + masses[i0] += mass; } if (vh1_moving) { - moves[i1] += density * Vector_3(p1, p0); + moves[i1] += mass * Vector_3(p1, p0); neighbors[i1]++; - masses[i1] += density * length; + masses[i1] += mass; } } }