Hi, all<br><br>I am looking into a 3D shape model. It has 5,000+ points, and 9,000+ cells. Thus in the .vtk file, I have the polygon data in the format such as follows<br><br>POLYGONS 9637 38548<br>3 0 1 2 <br>3 1 3 4 <br>
3 2 1 4 <br>3 3 5 6 <br>3 4 3 6 <br>3 5 7 8 <br>.......<br><br>The first number of each line indicates how many points are included in the cell, and the next 3 numbers indicate the point ids. In my case, the polygon is combined by triangles.<br>
<br>I use <b>vtkGenericDataObjectReader</b> to open the .vtk file, and then use <b>vtkPolyData::GetPolys</b> to get the polygons of the shape model, whose type is <b>vtkCellArray</b> pointer.<br><br>Here is my code clip:<br>
    vtkSmartPointer&lt;vtkGenericDataObjectReader&gt; reader = vtkSmartPointer&lt;vtkGenericDataObjectReader&gt;::New();<br>    reader-&gt;SetFileName(&quot;C:\\meanshape.vtk&quot;);<br>    reader-&gt;OpenVTKFile();<br>    reader-&gt;Update();<br>
<br>    vtkSmartPointer&lt;vtkPolyData&gt; shape = vtkSmartPointer&lt;vtkPolyData&gt;::New();<br>    shape = reader-&gt;GetPolyDataOutput();<br><br>    vtkSmartPointer&lt;vtkCellArray&gt; polys = vtkSmartPointer&lt;vtkCellArray&gt;::New();<br>
    polys = shape-&gt;GetPolys();<br><b><br>My problem is:</b> After I have polygon data in a vtkCellArray instance, how can I get access to the point ids in each triangle cell? For example, I want to read &quot;0 1 2&quot; in the first line, &quot;1 3 4&quot; in the second line, etc.<br>
<br>Can you help me out of this? Many thanks in advance for your kind help.<br><br>All bests<br>Wenlong<br>