Revert "fix moving with sizing formula"

This reverts commit bbeb755d379b56198ee879b648b80bde7fed041e

but keep the vh*_moving booleans
This commit is contained in:
Jane Tournois 2024-05-06 15:38:35 +02:00
parent d4e2bd0436
commit 6727a64e6a
1 changed files with 17 additions and 25 deletions

View File

@ -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;
}
}
}