<div dir="ltr"><br><br><div class="gmail_quote">On Fri, Jul 23, 2010 at 10:00 AM, Bill Lorensen <span dir="ltr">&lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Please keep the users list on the replies...<br>
<div><div></div><div class="h5"><br>
On Fri, Jul 23, 2010 at 11:00 AM, Bill Lorensen &lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt; wrote:<br>
&gt; You definitely need lines. One polyline for each contour would be<br>
&gt; fine. Without the topology provided by lines, how can a spline be fit<br>
&gt; to the points?<br>
&gt;<br>
&gt; On Fri, Jul 23, 2010 at 10:35 AM, Prathamesh Kulkarni<br>
&gt; &lt;<a href="mailto:prathameshmkulkarni@gmail.com">prathameshmkulkarni@gmail.com</a>&gt; wrote:<br>
&gt;&gt; I tried that out. It shows that the sparse_poly has 29 points (which I have<br>
&gt;&gt; inserted using myvtkPoints) and zero lines. I am confused here. Do I have to<br>
&gt;&gt; manually initialize a line for every two points (or one passing through<br>
&gt;&gt; all?) and then pass this line as sparse_poly-&gt;SetLines() ? If yes, how<br>
&gt;&gt; should it be done?<br>
&gt;&gt;<br>
&gt;&gt; Ultimately, I want to &quot;densify&quot; the points from whatever I have to a user<br>
&gt;&gt; specified density and I hope to have the dense points using:<br>
&gt;&gt; spline_filter-&gt;GetOutput()-&gt;GetPoints();<br>
&gt;&gt;<br>
&gt;&gt; Also, please let me know if I should explore any other way of doing this.<br>
&gt;&gt;<br>
&gt;&gt; I appreciate your help.<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt; Prathamesh<br>
&gt;&gt;<br>
&gt;&gt; On Fri, Jul 23, 2010 at 6:53 AM, Bill Lorensen &lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Try printing some more information before the spline filter:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; sparse_points-&gt;Print(std::cout);<br>
&gt;&gt;&gt; sparse_poly-&gt;Print(std::cout);<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Fri, Jul 23, 2010 at 1:25 AM, Prathamesh Kulkarni<br>
&gt;&gt;&gt; &lt;<a href="mailto:prathameshmkulkarni@gmail.com">prathameshmkulkarni@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt; &gt; Thanks for the direction. I am did the following: (myvtkPoints are<br>
&gt;&gt;&gt; &gt; points<br>
&gt;&gt;&gt; &gt; representative of a contour line which I want to resample with a given<br>
&gt;&gt;&gt; &gt; density):<br>
&gt;&gt;&gt; &gt;         density = 100;<br>
&gt;&gt;&gt; &gt; vtkSmartPointer&lt;vtkPoints&gt; dense_points;<br>
&gt;&gt;&gt; &gt; vtkSmartPointer&lt;vtkPoints&gt; sparse_points = myvtkPoints<br>
&gt;&gt;&gt; &gt; vtkSmartPointer&lt;vtkKochanekSpline&gt; spline_type =<br>
&gt;&gt;&gt; &gt; vtkSmartPointer&lt;vtkKochanekSpline&gt;::New();<br>
&gt;&gt;&gt; &gt; spline_type-&gt;SetDefaultContinuity(0.5);<br>
&gt;&gt;&gt; &gt; vtkSmartPointer&lt;vtkPolyData&gt; sparse_poly =<br>
&gt;&gt;&gt; &gt; vtkSmartPointer&lt;vtkPolyData&gt;::New();<br>
&gt;&gt;&gt; &gt; sparse_poly-&gt;SetPoints(sparse_points);<br>
&gt;&gt;&gt; &gt; sparse_poly-&gt;Update();<br>
&gt;&gt;&gt; &gt; vtkSmartPointer&lt;vtkSplineFilter&gt; spline_filter =<br>
&gt;&gt;&gt; &gt; vtkSmartPointer&lt;vtkSplineFilter&gt;::New();<br>
&gt;&gt;&gt; &gt; spline_filter-&gt;SetSpline(spline_type);<br>
&gt;&gt;&gt; &gt; spline_filter-&gt;SetInput(sparse_poly);<br>
&gt;&gt;&gt; &gt; spline_filter-&gt;SetSubdivideToSpecified();<br>
&gt;&gt;&gt; &gt; spline_filter-&gt;SetNumberOfSubdivisions(density);<br>
&gt;&gt;&gt; &gt; spline_filter-&gt;Update();<br>
&gt;&gt;&gt; &gt; vtkSmartPointer&lt;vtkPolyData&gt; dense_poly = spline_filter-&gt;GetOutput();<br>
&gt;&gt;&gt; &gt; dense_points = dense_poly-&gt;GetPoints(); //FAILS HERE: dense_points is<br>
&gt;&gt;&gt; &gt; NULL<br>
&gt;&gt;&gt; &gt; int number_of_sparse_points = sparse_points-&gt;GetNumberOfPoints();<br>
&gt;&gt;&gt; &gt; int number_of_dense_points = dense_points-&gt;GetNumberOfPoints();<br>
&gt;&gt;&gt; &gt; Could someone please tell me if I am doing something conceptually wrong<br>
&gt;&gt;&gt; &gt; here?<br>
&gt;&gt;&gt; &gt; Thanks,<br>
&gt;&gt;&gt; &gt; Prathamesh<br>
&gt;&gt;&gt; &gt; On Thu, Jul 22, 2010 at 12:27 PM, Bill Lorensen<br>
&gt;&gt;&gt; &gt; &lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt;<br>
&gt;&gt;&gt; &gt; wrote:<br>
&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt; &gt;&gt; Look at this example:<br>
&gt;&gt;&gt; &gt;&gt; <a href="http://www.vtk.org/Wiki/VTK/Examples/PolyData/FitSplineToCutterOutput" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/PolyData/FitSplineToCutterOutput</a><br>
&gt;&gt;&gt; &gt;&gt; it resamples contour lines using splines.<br>
&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt; &gt;&gt; On Thu, Jul 22, 2010 at 12:38 PM, Prathamesh Kulkarni<br>
&gt;&gt;&gt; &gt;&gt; &lt;<a href="mailto:prathameshmkulkarni@gmail.com">prathameshmkulkarni@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;&gt; &gt; Hello all,<br>
&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;&gt; &gt; I have a set of points which represent a contour line. I want to be<br>
&gt;&gt;&gt; &gt;&gt; &gt; able<br>
&gt;&gt;&gt; &gt;&gt; &gt; to<br>
&gt;&gt;&gt; &gt;&gt; &gt; resample them to a given density. I have looked at vvtkSheperdMethod<br>
&gt;&gt;&gt; &gt;&gt; &gt; documentation but could not find a method similar SetDensity() for<br>
&gt;&gt;&gt; &gt;&gt; &gt; its<br>
&gt;&gt;&gt; &gt;&gt; &gt; source.<br>
&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;&gt; &gt; What would be the best way to resample a contour data?<br>
&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;&gt; &gt; Thanks,<br>
&gt;&gt;&gt; &gt;&gt; &gt; Prathamesh<br>
&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;&gt; &gt; _______________________________________________<br>
&gt;&gt;&gt; &gt;&gt; &gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;&gt; &gt; Visit other Kitware open-source projects at<br>
&gt;&gt;&gt; &gt;&gt; &gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;&gt; &gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt;&gt;&gt; &gt;&gt; &gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;&gt; &gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt;&gt; &gt;&gt; &gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div>