<!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>I am trying to&nbsp;triangulate a 
polygon?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>My code is this:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>polygonPoints&nbsp; = vtkPoints::New();<BR>polygon 
= vtkPolygon::New();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>polygonPoints 
-&gt;SetNumberOfPoints(8);<BR>polygon-&gt;GetPointIds()-&gt;SetNumberOfIds(8);<BR>&nbsp;<BR></FONT><FONT 
face=Arial size=2>polygonPoints-&gt;InsertPoint(0, 0, 0, 0);</FONT></DIV>
<DIV><FONT face=Arial size=2>polygonPoints-&gt;InsertPoint(1, 1, 0, 
0);</FONT></DIV>
<DIV><FONT face=Arial size=2>polygonPoints-&gt;InsertPoint(2, 1, 1, 
0);</FONT></DIV>
<DIV><FONT face=Arial size=2>polygonPoints-&gt;InsertPoint(3, 0, 1, 
0);</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;</DIV>
<DIV>polygon-&gt;GetPointIds()-&gt;SetId(0, 0);</DIV>
<DIV>polygon-&gt;GetPointIds()-&gt;SetId(1, 1);</DIV>
<DIV>polygon-&gt;GetPointIds()-&gt;SetId(2, 2);</DIV>
<DIV>polygon-&gt;GetPointIds()-&gt;SetId(3, 3);</DIV>
<DIV>&nbsp;</DIV>
<DIV>I found out that vtkPolygon has a function named Triangulate </DIV>
<DIV>&nbsp;</DIV>
<DIV><STRONG>int vtkPolygon::Triangulate&nbsp; (vtkIdList * outTris)&nbsp;&nbsp; 
&nbsp;</STRONG></DIV>
<DIV>Triangulate this polygon. The user must provide the vtkIdList outTris. On 
output, the outTris list contains the ids of the points defining the 
triangulation. The ids are ordered into groups of three: each three-group 
defines one triangle. </DIV>
<DIV>&nbsp;</DIV>
<DIV>I 've tried this:</DIV>
<DIV>&nbsp;</DIV>
<DIV>polygon-&gt;Triangulate(polygon-&gt;PointIds); </DIV>
<DIV>&nbsp;</DIV>
<DIV>but get exception</DIV>
<DIV>&nbsp;</DIV>
<DIV><STRONG>int vtkPolygon::Triangulate (int index,vtkIdList* ptIds, vtkPoints* 
pts)</STRONG></DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV>I also tried this:</DIV>
<DIV>&nbsp;</DIV>
<DIV>polygon-&gt;Triangulate(1, polygon-&gt;PointIds, polygonPoints);</DIV>
<DIV>&nbsp;</DIV>
<DIV>and get exception error too.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I could really use your help</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks in advance,</DIV>
<DIV>Polys</FONT></DIV></BODY></HTML>