[vtkusers] Clip a polygonal hole from an image ?

De Boer Ingo I.deBoer at polytec.de
Mon Apr 14 03:25:02 EDT 2003


Hi,

I want to clip a polygonal hole from an image. So far I

1. create the  vtkImageData (to create an image from a buffer)
2. create a vtkTexture
3. create a vtkPlaneSource for the texture
   (Resolution was 128,128... I also tried higher/lower values)
4. create the vtkPolyData for the clipping region
5. create the vtkImplicitDataSet
6. create the clipper vtkClipPolyData
   clipper->SetInput(planesource->GetOutput());
   clipper->SetClipFunction(dataset);

If I do all of this I get something like image1.jpg. If I show
the actual polgonal object, it looks like image2.jpg which is
the correct one, of course. I tried to increase the resolution
of the plane but it didn't help.
Is there some other solution for making this hole, eg. by the
alpha channel of the texture or something like that ?

greets
  Ingo

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Image1.jpg
Type: image/jpeg
Size: 13956 bytes
Desc: Image1.jpg
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030414/1e220c3f/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Image2.jpg
Type: image/jpeg
Size: 10764 bytes
Desc: Image2.jpg
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030414/1e220c3f/attachment-0001.jpg>


More information about the vtkusers mailing list