[vtkusers] vtkAppendPolyData()..

David Gobbi david.gobbi at gmail.com
Tue Mar 2 00:55:08 EST 2010


My only guess is that your data set might have duplicate points, or
perhaps there are other factors which might result in degenerate (i.e.
micro-thin) triangles prior to the contouring.  Any duplicate points
or degenerate triangles prior to the contouring will make it produce
lines where the adjacent segments don't actually share a point,
because that point is actually two points that are almost exactly on
top of one another.  As a result, vtkStripper won't be able to do its
job.

You can remove duplicated points with vtkCleanPolyData.  Anywhere in
the pipeline before vtkStripper should work, but just before
vtkContourFilter might be best.

  David


On Mon, Mar 1, 2010 at 9:50 PM, Rakesh Patil <rakeshthp at in.com> wrote:
> Well,
>
> Here I'm attaching a screenshot. The output of a sample file what i get is
> like this. It is correct. If i render all in same color the it is correct.
> Here is a sample code for it.
>
> vtkDelaunay2D *del = vtkDelaunay2D::New();
> del->SetInput(uGrid); // Unstructuredgrid containing scattered xy points
> del->SetTolerance(0.005);
> del->Update();
>
> vtkContourFilter *cont = vtkcontourFilter::New();
> cont->SetInputConnection(del->GetOutputPort());
> cont->GenerateValues(1, -4.5, -4.5);
> cont->Update();
>
> vtkStripper *ps = vtkStripper::New();
> ps->SetInputConnection( cont->GetOutputPort());
> ps->Update();
>
> Now the output of this stripper contains 16 cells and 198 points. That is
> also fine. But once i get a contour line as shown in attachment, I need
> to perform some operation on the entire line by selecting/picking it. But in
> this case, if i use cell picker, then only one part of the fill line is
> being picked..
>
> SO what can be done to pick the entire line.??
>
> Thanks
>
> Regards
> Rakesh Patil
>
>
> ---------- Original message ----------
> From:David Gobbi< david.gobbi at gmail.com >
> Date: 01 Mar 10 18:37:28
> Subject: Re: [vtkusers] vtkAppendPolyData()..
> To: Rakesh Patil
>
> The filter you are looking for is vtkStripper, it will join the line
> segments together.
>
> David
>
>
> On Mon, Mar 1, 2010 at 12:03 AM, Rakesh Patil wrote:
>> Hi VTK Users..
>>
>> I want to extract a single contour line from a set of xy points. So to
>> begin
>> with i used vtkContourFilter class to extract a single contour line of a
>> particular value. But the output contained n number of lines not a single
>> line. So I thought of merging them.. So i used,
>>
>> vtkAppendPolyData
>>
>> class to make it a single line. I get it as a single lin e but there is a
>> smal confusion here.. Suppose there are 6 lines. when displaying, the
>> first
>> point of the 2nd line is connected to the first point of 1st line.
>> similarly
>> first point of the third line is connected to the first point of the
>> second
>> line. Thus creating unwanted lines in between..
>>
>> Any solution to get rid of this..???
>>
>> Thanks
>>
>> Regards
>> Rakesh Patil
>>
>>
>>
>> Dear vtkusers ! Get Yourself a cool, short @in.com Email ID now!
>> _______________________________________________
>> 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