[vtkusers] vtkSplineFilter not distributing points evenly...

Jérôme jerome.velut at gmail.com
Tue Feb 2 04:20:56 EST 2010


Hi Rakesh,

I think that the "SetSubdivideToLength" is guilty. IMHO, your lines are not
multiple of 50. Then, SplineFilter has to adapt at least an ending edge.

Maybe -but not for sure- you can try with SetSubdivideToSpecified: the
filter should compute a subdivision length accordingly to an uniform
sampling, but you have to set the number of points of the output.

HTH
Jerome

2010/2/2 Rakesh Patil <rakeshthp at in.com>

> Hello,
>
> I construct a polyline from the output of contourfilter. After constructing
> polyline, i found that, the points in this polyline are unevenly spaced
> (unequally spaced).
>
> Thus i used vtkSplineFilter to distribute points evenly on this polyline.
> But when i get the output from this filter, is like, at the junction point,
> of
> two lines, points are more closer than the specified length, here is
> the code what i wrote.
>
> // few lines of code, to construct unstructuredGrid
> // which is passed to the contourfilter
>
> vtkContourFilter *contFilter = vtkContourFilter::New();
> contFilter->SetInputConnection(del->GetOutputPort());
> contFilter->GenerateValues(1, -8.5, -8.5);
> contFilter->Update();
>
> vtkSplineFilter *sf = vtkSplineFilter::New();
> sf->SetInputConnection(contFilter->GetOutputPort());
> sf->SetSubdivideToLength();
> sf->SetLength(50);
>
> vtkStripper *stp = vtkStripper::New();
> stp->S etInputConnection( sf->GetOutputPort());
> stp->Update();
>
> Later I extract a polyline from vtkStripper as shown in
> example below:
>
> http://vtk.org/Wiki/VTK/Examples/ExtractPolyLinesFromPolyData#ExtractPolyLinesFromPolyData.cxx
>
> I do get the output as expected but with a
> small variation. i.e. at the place where
> two lines meet, the spacing is not same as
> mentioned in the code.
>
> How do i overcome this problem..??
>
> Thanks in advance
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100202/58cdeb1f/attachment.htm>


More information about the vtkusers mailing list