[vtkusers] vtkClipPolyData produces black shadow effect.. Why.??

David Gobbi david.gobbi at gmail.com
Mon Feb 15 11:37:09 EST 2010


Hi Rakesh,

Take a closer look at the documentation for vtkClipPolyData.  The
"Value" is meant to be a threshold, i.e. if your data has scalar
values in the range [0,1] and you clip with a value of 0.5, then all
points with scalars less than 0.5 will be clipped.  You can't tell
vtkClipPolyData to clip out all vertices with a particular scalar
value.  It always clips based on "greater than" or "less than" the
value.

I think that the only way to get rid of the NANS to loop through the
data yourself, remove the NAN points, and rebuild the cells without
those points.  There isn't a VTK filter for what you are trying to do.

   David


On Mon, Feb 15, 2010 at 9:18 AM, Rakesh Patil <rakeshthp at in.com> wrote:
> Hello,
>
> I need to display the filled contour of a particular parameter. The data
> contains few NAN values. Following is the code what I have written:
>
> vtkGeometryFilter *gf = vtkGeometryFilter::New();
> gf->SetInput(uGrid);
> gf->Update();
>
> vtkClipPolyData *clip = vtkClipPolyData::New();
> clip->SetInputConnection ( gf->GetOutputPort());
> clip->SetValue( vtkMath::Nan());
> clip->Update();
>
> vtkDataSetSurfaceFilter *surfaceFilter = vtkDataSetSurfaceFilter::New();
> surfaceFilter->SetInputConnection( clip->GetOutputPort());
>
> vtkPolyDataMapper *surfacemapper = vtkPolyDataMapper::New();
> surfacemapper->SetInputConnection( surfaceFilter->GetOutputPort());
> surfacemapper->SetLookupTable(mLookupTable);
>
> vtkActor *surfaceActor = vtkActor::New();
> surfaceActor->SetMapper( surfacemapper);
>
> pRenderer->AddActor(surfaceActor);
>
> Now when I render this, wherever there exists a block of land, t hat part is
> being rendered, with a black shadow sort of. And this shadow seems to come
> from center of the screen.
>
> How can i avoid to display this shadow..??
>
> Thanks
>
>
> 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