Skip to content
Snippets Groups Projects
Commit 317c2ec8 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

bug fix from peter.wainwright@ieee.org

Amazingly, I have discovered a potentially serious bug in the routines
which perform edge collapse in the BDS_Mesh.

Owing to this, it is possible for a point to collapse onto a linear
boundary creating slivers (triangles with collinear points).

The problem is that the sides of the triangle, a and b, are not
recalculated after the point is moved.  Thus, area_final and area_init
are always equal!  So the test for slivers is defeated.
parent c6a77a72
No related branches found
No related tags found
No related merge requests found
......@@ -1004,7 +1004,7 @@ static bool test_move_point_parametric_quad(BDS_Point *p, double u, double v, BD
double ori_final1 = gmsh::orient2d(pa, pb, pc);
double ori_final2 = gmsh::orient2d(pc, pd, pa);
// allow to move a point when a triangle was flat
return ori_init1*ori_final1 > 0 && ori_init2*ori_final2 > 0 ;
return (ori_init1 * ori_final1 > 0) && (ori_init2 * ori_final2 > 0);
}
static bool test_move_point_parametric_triangle(BDS_Point *p, double u, double v, BDS_Face *t)
......@@ -1042,6 +1042,9 @@ static bool test_move_point_parametric_triangle(BDS_Point *p, double u, double v
else
return false;
a[0] = pb[0] - pa[0]; a[1] = pb[1] - pa[1];
b[0] = pc[0] - pa[0]; b[1] = pc[1] - pa[1];
double area_final = fabs(a[0] * b[1] - a[1] * b[0]);
if(area_final < 0.1 * area_init) return false;
double ori_final = gmsh::orient2d(pa, pb, pc);
......
$Id: TODO.txt,v 1.14 2009-01-07 10:59:20 geuzaine Exp $
$Id: TODO.txt,v 1.15 2009-01-18 11:44:36 geuzaine Exp $
********************************************************************
cleanup API for orientation of edges/faces
********************************************************************
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment