<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=iso-8859-7>
<META content="MSHTML 6.00.6000.16608" name=GENERATOR></HEAD>
<BODY id=MailContainerBody
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px"
bgColor=#ffffff leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>I am trying to triangulate a
polygon.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>My code is this:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>polygonPoints = vtkPoints::New();<BR>polygon
= vtkPolygon::New();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>polygonPoints
->SetNumberOfPoints(8);<BR>polygon->GetPointIds()->SetNumberOfIds(8);<BR> <BR></FONT><FONT
face=Arial size=2>polygonPoints->InsertPoint(0, 0, 0, 0);</FONT></DIV>
<DIV><FONT face=Arial size=2>polygonPoints->InsertPoint(1, 1, 0,
0);</FONT></DIV>
<DIV><FONT face=Arial size=2>polygonPoints->InsertPoint(2, 1, 1,
0);</FONT></DIV>
<DIV><FONT face=Arial size=2>polygonPoints->InsertPoint(3, 0, 1,
0);</FONT></DIV>
<DIV><FONT face=Arial size=2> </DIV>
<DIV>polygon->GetPointIds()->SetId(0, 0);</DIV>
<DIV>polygon->GetPointIds()->SetId(1, 1);</DIV>
<DIV>polygon->GetPointIds()->SetId(2, 2);</DIV>
<DIV>polygon->GetPointIds()->SetId(3, 3);</DIV>
<DIV> </DIV>
<DIV>I found out that vtkPolygon has a function named Triangulate </DIV>
<DIV> </DIV>
<DIV><STRONG>int vtkPolygon::Triangulate (int index,vtkIdList* ptIds, vtkPoints*
pts)</STRONG></DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV>I tried this:</DIV>
<DIV> </DIV>
<DIV>polygon->Triangulate(1, polygon->PointIds, polygonPoints);</DIV>
<DIV> </DIV>
<DIV>and get exception error.</DIV>
<DIV> </DIV>
<DIV>What do i do wrong?</DIV>
<DIV> </DIV>
<DIV>Thanks in advance,</DIV>
<DIV>Polys</FONT></DIV></FONT></DIV></BODY></HTML>