[vtkusers] Polygons with holes

David.Pont at ForestResearch.co.nz David.Pont at ForestResearch.co.nz
Sun Feb 15 15:39:07 EST 2004


Hi Andrew,
  vtkClipPolyData is a correct approach, you would use vtkCylinder to get
circular holes. But clipping can result in low resolution holes unless the
resolution of the sheet is high (in terms of cell count), if the sheet is a
single polygon you will actually get no holes! Use
vtkLinearSubdivisionFilter to subdivide polygons before clipping. This
helps but has issues.

Another trick to improve hole resolution is to clip once, use
vtkAppendPolyData to stick the holes back (GetOutput and GetClippedOutput)
and clip again! Each iteration improves the resolution of the holes...
strange but it works.

Another approach is to use textures. If you have the book see the section
9.5 Texture Clipping (p416 in 2nd Edition). This is the best approach if
you just want to 'see' holes. If you really want to 'make' holes in the
underlying geometry (for extrusion?) you need vtkClipPolyData.

Another approach could be to use vtkPlane(s) (sheet with thickness),
vtkCylinder (hole) combined using vtkImplicitBoolean, then
vtkSampleFunction and vtkContour. This could give holes in a sheet with
thickness directly, but to get reasonable resolution high values are needed
for vtkSampleFunction->SetSampleDimensions and this gets very slow. I did
implement an adaptive polygonization algorithm (C++ class) which can be
used instead of vtkSampleFunction but I am not sure how much faster it
would be.

So yes it is possible, and typical of vtk, there are several ways to do it.
But vtk may not be the best solution if you just want to do lots of CSG?

  regards
   Dave P



                                                                                                               
                      "Andrew Wilford"                                                                         
                      <andrew at artwork.c        To:       <vtkusers at vtk.org>                                    
                      om>                      cc:                                                             
                      Sent by:                 Subject:  [vtkusers] Polygons with holes                        
                      vtkusers-admin at vt                                                                        
                      k.org                                                                                    
                                                                                                               
                                                                                                               
                      14/02/2004 13:22                                                                         
                      Please respond to                                                                        
                      "Andrew Wilford"                                                                         
                                                                                                               
                                                                                                               




Hi,

I am 2 days new to VTK and am trying to determine if what I need to do is
even possible. I need to model a 3D metal sheet with holes drilled in it,
essentially a 2D polygon with holes, extruded along the z-axis. How do I
represent a polygon with holes? Must I tesselate the polygon into polygons
which do not have holes? I have tried to use the vtkClipPolyData function,
but I am not getting very far.

Thanks in advance for any advice you can offer.

Regards,

Andrew Wilford
IC Packaging Software Tools
Artwork Conversion Software - www.artwork.com



_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: <
http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers








More information about the vtkusers mailing list