[vtkusers] clipping question

Maple Raymond C LtCol AFIT/ENY Raymond.Maple at afit.edu
Mon Nov 8 09:52:07 EST 2004


Hello,

   I am seeing some strange things with data set clipping that I hope
someone can explain for me.  I am clipping a vtkUnstructuredGrid against
6 planes forming a bounding box, and writing the result out to a .vtu
file.  I am clipping against each plane individually to ensure that the
plane intersections are correctly clipped.  When I look at the results,
the cells appear to be correctly clipped to the desired planes, but some
or all of the points "removed" by final clipping plane are still written
to file.  This is very evident when I read in the .vtu file and display
a surfacemap and bounding box.  The surface map shows the correct
clipped domain, but the bounding box extends to the full extent of the
original grid in the positive z direction.  Points removed by all but
the last plane are truly removed - only the points clipped by the last
plane are retained in the file.  Is this by design?  I am using the
release version of VTK 4.2.  My pipeline looks like

 

(grid reader)->(clip x min)->(clip x max)->(clip y min)->(clip y max)->
(clip z min)->(clip z max)->grid writer

 

BTW, by experimenting with inserting a vtkExtractGeometry (with
ExtractBoundaryCells turned on) before the clips to speed things up, I
think I have discovered a possible reason why clipping against the
Boolean combination of planes gives poor results.  The algorithms used
by ExtractGeometry do not correctly detect cells on the intersection
boundary that have no vertices inside the extracted region.  When the
clipping planes are applied to the extracted geometry, there are
"notches" where the missed boundary cells should have been.  These
notched results are similar to what I get if I clip against the Boolean
combination of bounding planes.  I have been able to eliminate the
notches by extracting a slightly larger (10%-20%) bounded region and
clipping against that.  Unfortunately, the required increase in size
will is dependent on the size of the grid cells.

 

I haven't looked at the code for vtkExtractGeometry, but it seems to
identify boundary cells as those with some vertices inside the extracted
region, and some outside.  To be complete, when an identified boundary
cell has a face whose vertices are all outside the extraction region,
that face needs to be checked to see if it intersects the implicit
function - if it does, then the cell adjacent to that face (if it
exists) should be extracted.   Right now, it isn't.

 

Thanks,

 

Raymond C. Maple, Lt Col USAF

Deputy Department Head

Department of Aeronautics and Astronautics

Air Force Institute of Technology

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20041108/7efe6775/attachment.htm>


More information about the vtkusers mailing list