[vtkusers] More accurate clipping?

John Norris jnorris at mcs.anl.gov
Wed Nov 8 15:11:17 EST 2006


Hi,

I'm using vtkClipDataSet with multiple functions combined using 
vtkImplicitBoolean.  This works well for the most part, but there are 
some too-common problems with this that I've been working on (so far 
unsuccessfully).

Consider the following case: a dataset is being clipped using two 
vtkPlanes objects, which are combined via a vtkImplicitBoolean object, 
and one cell has one point inside one vtkPlanes, and another point 
inside the other (see attached image #1).  I'd like the result to look 
like image #2, but it looks like image #3 instead.  I'm sure that 
vtkClipPolyData and vtkCutter suffer from similar problems.

My first attempt at a solution was a preconditioning filter.  This takes 
the clip function and breaks it down into a list of simple functions 
(vtkImplicitBoolean would be split into its subfunctions, vtkPlanes 
would be split into six vtkPlane objects, etc).  Then I loop through 
each function, and using the results of the previous iteration, I call 
each cell's Clip() method twice, once with insideOut set to 1.  This 
works, but it is extremely slow, even for a relatively simple clip 
function such as a single vtkPlanes object.  There must be a better way.

Has anyone done any work along these lines?

Thanks,
John
-- 
John Norris
Research Programmer
Center for Simulation of Advanced Rockets
http://www.uiuc.edu/ph/www/jnorris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image1.PNG
Type: image/png
Size: 2324 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061108/89af5aef/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image2.PNG
Type: image/png
Size: 1943 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061108/89af5aef/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image3.PNG
Type: image/png
Size: 1931 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061108/89af5aef/attachment-0002.png>


More information about the vtkusers mailing list