[vtkusers] vtkSplineFilter not distributing points evenly...

Bill Lorensen bill.lorensen at gmail.com
Tue Feb 2 08:10:16 EST 2010


You should run the spline on the output of the stripper NOT the output
of the contour filter. Contour filter produces independent line
segments of length 2. The stripper connects the contour lines into
multiple point poly lines.

On Tue, Feb 2, 2010 at 1:57 AM, Rakesh Patil <rakeshthp at in.com> wrote:
> 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
>
>



More information about the vtkusers mailing list