Merge pull request #3214 from sloriot/PMP-autorefine_identical_points

Make sure identical vertices have identical coordinates in autorefinement
This commit is contained in:
Laurent Rineau 2018-07-12 11:32:49 +02:00
commit c63a7c77e5
1 changed files with 12 additions and 3 deletions

View File

@ -167,7 +167,7 @@ private:
Exact_kernel ek;
Exact_kernel::Intersect_3 exact_intersection;
std::vector<vertex_descriptor> tm1_vertices, tm2_vertices;
const bool doing_autorefinement;
public:
const TriangleMesh &tm1, &tm2;
VertexPointMap vpm1, vpm2;
@ -176,7 +176,8 @@ public:
const TriangleMesh& tm2_,
const VertexPointMap& vpm1_,
const VertexPointMap& vpm2_)
: tm1(tm1_)
: doing_autorefinement(&tm1_ == &tm2_)
, tm1(tm1_)
, tm2(tm2_)
, vpm1(vpm1_)
, vpm2(vpm2_)
@ -284,7 +285,15 @@ public:
{
put(vpm, vd, exact_to_double(enodes[i]));
if (&tm1==&tm)
tm1_vertices[i] = vd;
{
if ( tm1_vertices[i] == GT::null_vertex() )
{
tm1_vertices[i] = vd;
return;
}
if (doing_autorefinement)
tm2_vertices[i] = vd;
}
else
tm2_vertices[i] = vd;
}