So after struggling with this for a while, I&#39;ve come up with the following code, which kinda does the job.<div><br></div><div><div>    public vtkPoints reorderPoints(vtkPolyData unorderedData) {</div><div>        vtkStripper stripper = new vtkStripper();</div>
<div>        stripper.SetInput(unorderedData);</div><div>        stripper.Update();</div><div>        vtkPolyData strippedData = stripper.GetOutput();</div><div>        </div><div>        vtkPoints points = new vtkPoints();</div>
<div>        // Here, we&#39;re trying to mimic the suggestion given here</div><div>        // <a href="http://vtk.1045678.n5.nabble.com/question-about-vtkContourWidget-vtkContourRepresentation-td1255118.html#a3247766">http://vtk.1045678.n5.nabble.com/question-about-vtkContourWidget-vtkContourRepresentation-td1255118.html#a3247766</a></div>
<div>        for (int i=0; i&lt;strippedData.GetNumberOfCells(); i++) {</div><div>            vtkCell cell = strippedData.GetCell(i);</div><div>            for (int j=0; j&lt;cell.GetPoints().GetNumberOfPoints()-1; j++) {</div>
<div>                points.InsertNextPoint(cell.GetPoints().GetPoint(j));</div><div>            }</div><div>        }</div><div>        return points;</div><div>    }</div>The points that are returned are in &quot;better&quot; order than having not run this method, but it&#39;s still not the correct order.  It turns out that I cannot upgrade to the newest version of VTK because we&#39;re using GDCM which isn&#39;t yet integrated into the newest version of VTK, so I&#39;m stuck with 5.6 for now.  However, I did do a test on the head of GIT and I tried to use Karthik&#39;s code suggested above, but I still couldn&#39;t get that working.  I attempted to follow internally what vtkCellArray.GetNextCell() was doing, and that&#39;s how I came up with the above function.  </div>
<div><br></div><div>Can someone tell me why the above function isn&#39;t returning the vtkPoints in the correct order for vtkContourWidget?</div><div><br></div><div>Thanks<br><div class="gmail_quote">On Sat, Nov 6, 2010 at 10:12 PM, Karthik Krishnan <span dir="ltr">&lt;<a href="mailto:karthik.krishnan@kitware.com">karthik.krishnan@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Ah.. yes.. This method was added on May 19, 2010. Perhaps you are<br>
using a version of VTK prior to that.<br>
<br>
Please see :<br>
  <a href="http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=068a064cea7ba0fc7a4c4f9d2f7dfed6eb093674" target="_blank">http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=068a064cea7ba0fc7a4c4f9d2f7dfed6eb093674</a><br>
<br>
Update your VTK.<br>
<div><div></div><div class="h5"><br>
<br>
On Sat, Nov 6, 2010 at 10:54 PM, Jonathan Morra &lt;<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>&gt; wrote:<br>
&gt; I couldn&#39;t find GetNextCell() at all in Java. I&#39;m currently using version<br>
&gt; 5.6. Do you have any other suggestions?<br>
&gt;<br>
&gt; On Nov 6, 2010 9:05 AM, &quot;Karthik Krishnan&quot; &lt;<a href="mailto:karthik.krishnan@kitware.com">karthik.krishnan@kitware.com</a>&gt;<br>
&gt; wrote:<br>
&gt;<br>
&gt; Jonathan:<br>
&gt;<br>
&gt; Use the other signature of the method GetNextCell. [ int<br>
&gt; GetNextCell(vtkIdList *pts) ]That should be wrapped...<br>
&gt;<br>
&gt; The code to re-order the points based on the connectivity information<br>
&gt; would be written in java as :<br>
&gt;<br>
&gt;  vtkIdList idlist = new vtkIdList();<br>
&gt;  unorderedPolyData.GetLines().GetNextCell(idlist);<br>
&gt;  npts = idlist.GetNumberOfIds();<br>
&gt;  for ( int i = 0;  i &lt; ( npts-1 );  i ++)<br>
&gt;    {<br>
&gt;    points.InsertPoint(i, unorderedPolyData.GetPoints().GetPoint(pts[i]));<br>
&gt;    }<br>
&gt;<br>
&gt; --<br>
&gt; karthik<br>
&gt;<br>
&gt; On Wed, Nov 3, 2010 at 7:29 AM, Jonathan Morra &lt;<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>&gt; wrote:<br>
&gt;&gt; I have a 3D vtkPolyDat...<br>
&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;<br>
&gt;&gt; Visit other Kitwa...<br>
</div></div></blockquote></div><br></div>