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