[vtkusers] How to set the boundary of vtkDelaunay2D ?

zhq 15891495523 at 126.com
Sat Oct 3 08:09:20 EDT 2015


Dear David:

     I have solved the problem that obtaining the edges of triangle. My code
is:
vtkIdType value=3;
	vtkIdType & a = value;
	vtkIdType * triPoint;
	triCell->InitTraversal();
	while (true)
	{
		int flag = triCell->GetNextCell(a,triPoint);
		if (flag == 0)
		{
			break;
		}
		for (int i=0;i<3;i++)
		{
			vtkIdType point1 = triPoint[i];
			vtkIdType point2 = triPoint[(i+1)%3];
			if ( (point1<N && point2>=N)
				|| (point1>=N && point2<N))
			{
				double p1[3],p2[3];
				tri->GetPoint(point1,p1);
				tri->GetPoint(point2,p2);
				distance = sqrt( (p1[0]-p2[0])*(p1[0]-p2[0]) +
					             (p1[1]-p2[1])*(p1[1]-p2[1]) +
								 (p1[2]-p2[2])*(p1[2]-p2[2]) );
				printf("%.2f\n",distance);
			}
		}
	}

     But, I still have a question. Why GetNextCell worked but GetCell don't
? What's the different between they ?

ZhangQiang



--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-set-the-boundary-of-vtkDelaunay2D-tp5734142p5734219.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list