[vtk-developers] Bug about vtkDelaunay2D and Modify
毕林
beelin at sohu.com
Thu Feb 1 21:57:02 EST 2007
HI,
I find a big bug about vtkDelaunay2D,and I have modified it as follows:
int vtkDelaunay2D::RecoverEdge(vtkIdType p1, vtkIdType p2)
{
....................................
....................................
// We found initial triangle; begin to track triangles containing edge. Also,
// the triangle defines the beginning of two "chains" which form a boundary of
// enclosing triangles around the edge. Create the two chains (from p1 to p2).
// (The chains are actually defining two polygons on either side of the edge.)
//
tris->InsertId(0, cellId);
rightChain->InsertId(0, p1); rightChainX->InsertPoint(0, p1X);
leftChain->InsertId(0, p1); leftChainX->InsertPoint(0, p1X);
if ( signX1 > 0 )
{
rightChain->InsertId(1, v1); rightChainX->InsertPoint(1, x1);
leftChain->InsertId(1, v2); leftChainX->InsertPoint(1, x2);
}
else
{
leftChain->InsertId(1, v1); leftChainX->InsertPoint(1, x1);
rightChain->InsertId(1, v2); rightChainX->InsertPoint(1, x2);
//===================================
//where the bug :
//Modify:Now have to exchange the v1 and v2
int temp = 0;
temp = v1; v1 = v2; v2 = temp;
//===================================
}
// Walk along triangles (edge neighbors) towards point p2.
...........................................................
...........................................................
}
毕林(Bi Lin)
beelin at sohu.com
2007-02-02
More information about the vtk-developers
mailing list