<DIV>Hi Randall,</DIV>
<DIV>&nbsp;</DIV>
<DIV>This piece of code might be helpful.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;for(int i=0;i&lt;count;i++)<BR>{</DIV>
<DIV>&nbsp;&nbsp; int a, b, c;<BR>&nbsp;&nbsp;&nbsp;importCellArray-&gt;InsertNextCell(3);<BR>&nbsp;&nbsp;&nbsp;importCellArray-&gt;InsertCellPoint(a);<BR>&nbsp;&nbsp;&nbsp;importCellArray-&gt;InsertCellPoint(b);<BR>&nbsp;&nbsp;&nbsp;importCellArray-&gt;InsertCellPoint(c);</DIV>
<DIV>}//Generate Triangle List</DIV>
<DIV>&nbsp;</DIV>
<DIV>for(i=0;i&lt;count;i++)<BR>{<BR>&nbsp;&nbsp;&nbsp;float x,y,z;<BR>&nbsp;&nbsp;&nbsp;importPoints-&gt;InsertPoint(importPoints-&gt;GetNumberOfPoints(),x,y,z);<BR>}//Generate Points<BR></DIV>
<DIV>finalPoly-&gt;SetPoints(importPoints);<BR>finalPoly-&gt;SetPolys(importCellArray);</DIV>
<DIV>&nbsp;</DIV>
<DIV>Qiang</DIV>
<DIV><BR><B><I>Randall Hand &lt;randall.hand@gmail.com&gt;</I></B> 写道:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">I have a code block similar to this:<BR><BR>&nbsp;&nbsp;&nbsp; // First load the points<BR>&nbsp;&nbsp;&nbsp; vtkPoints *newPts = vtkPoints::New();<BR>&nbsp;&nbsp;&nbsp; newPts-&gt;Allocate(countVert);<BR>&nbsp;&nbsp;&nbsp; for(i=1; i&lt;=countVert; i++) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newPts-&gt;InsertPoint(i-1, x, y, z);<BR>&nbsp;&nbsp;&nbsp; }<BR><BR>&nbsp;&nbsp;&nbsp; // Now load up the connectivity<BR>&nbsp;&nbsp;&nbsp; vtkIdList *pts = vtkIdList::New();<BR>&nbsp;&nbsp;&nbsp; pts-&gt;Allocate(VTK_CELL_SIZE);<BR>&nbsp;&nbsp;&nbsp; vtkCellArray *newPolys = vtkCellArray::New();<BR>&nbsp;&nbsp;&nbsp; newPolys-&gt;Allocate(countPoly);<BR><BR>&nbsp;&nbsp;&nbsp; for(i=1; i&lt;=countPoly; i++) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pts-&gt;Reset();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 pts-&gt;InsertNextId(v1-1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pts-&gt;InsertNextId(v2-1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pts-&gt;InsertNextId(v3-1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newPolys-&gt;InsertNextCell(pts);<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; fclose(fptr);<BR><BR>&nbsp;&nbsp;&nbsp; vtkPolyData *output = vtkPolyData::New();<BR>&nbsp;&nbsp;&nbsp; output-&gt;SetPoints(newPts);<BR>&nbsp;&nbsp;&nbsp; newPts-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; output-&gt;SetPolys(newPolys);<BR>&nbsp;&nbsp;&nbsp; newPolys-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; pts-&gt;Delete();<BR><BR>Now when I try to query the resulting vtkPolyData, I get segfaults in the ComputeBounds routines.&nbsp; I tried connecting it to a vtkPLYWriter, and it saves a file to disk that crashes both 3DSMax &amp; Paraview.&nbsp; Any ideas what I'm missing here?<BR><BR>-- <BR>Randall Hand<BR><A href="http://www.yeraze.com/">http://www.yeraze.com</A>
 _______________________________________________<BR>This is the private VTK discussion list. <BR>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<BR>Follow this link to subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers<BR></BLOCKQUOTE><BR><BR><p><br><hr size=1>
<b>Do You Yahoo!?</b><br>
<a href="http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/" target=blank>注册世界一流品质的雅虎免费电邮</a>