[vtkusers] extract only BoundaryCells

Obada Mahdi omahdi at gmx.de
Fri Aug 11 19:15:04 EDT 2006


Hi Johannes!

Johannes Holzmeister wrote:
> hello!
> 
>  I clipped  a surface with a plane and I only want to get the polygons which are within the clipping-plane (=BoundaryCells).
> With the "vtkExtractPolyDataGeometry" I get the the "BoundaryCells" plus the surface above or below the "BoundaryCells"!

Here are some thoughts:

1. Append an additional vtkExtractPolyDataGeometry filter pass to chop 
off unwanted cells, by flipping inside and outside (like first with 
ExtractInsideOff(), then ExtractInsideOn()).


2. If your copyright constraints allow it, create your own boundary 
filter by copying and slightly modifying the vtkExtractPolyDataGeometry 
source code.  There are conditional constructs like

[lines 169+]
|       if ( (numIn == npts) || (this->ExtractBoundaryCells && numIn > 0) )
|         {
|         newId = newVerts->InsertNextCell(npts,pts);
|         outputCD->CopyData(cd, cellId, newId);
|         }


for every cell type, which evaluates to true if either all points of a 
given cell are inside (outside), or some of them AND 
ExtractBoundaryCells is enabled.  You could adapt those conditionals to 
collect only boundary cells.


3. There is a filter class written by Goodwin Lawlor, 
vtkCollisionDetectionFilter, which is also capable of extracting such 
boundary cells.  It works on polydata inputs, so you would have to build 
a (large enough) polydata representation of the clipping plane.  It is 
available here:

http://www.bioengineering-research.com/vtk/vtkCollisionDetectionFilter.htm

(I've seen comments about moving those sources to sourceforge.net, but I 
can't seem to find them there.)


HTH,

Obada



More information about the vtkusers mailing list