[vtkusers] vtkSplineFilter not distributing points evenly...

Jérôme jerome.velut at gmail.com
Tue Feb 2 08:11:51 EST 2010


vtkSplineFilter proposes two different ways of resampling:
- either you use SetSubdivideToLength -what you are doing right now- and the
SplineFilter will output Lines that are almost evenly distributed with a
sampling step of Length that you set by SetLength
- or you use SetSubdivideToSpecified, and you set the number of points that
you want in the output. Well, I just saw that "points" is not the right
term. Use SetNumberOfSubdivisions.

HTH

Jerome

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

>
>
> Well,
>
> I didn't get the meaning of this
>
> "but you have to set the number of points of the output."
>
> To which object do we need to set the number of points of output?
> Thanks
>
>
> ---------- Original message ----------
> From:=?ISO-8859-1?B?Suly9G1l?=< jerome.velut at gmail.com >
> Date: 02 Feb 10 14:50:56
> Subject: Re: [vtkusers] vtkSplineFilter not distributing points evenly...
> To: Rakesh Patil
>
> 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/2f62886c/attachment.htm>


More information about the vtkusers mailing list