[vtkusers] How to compute intersection between surface polydata in vtk?

Alle Meije Wink alle_meije at yahoo.co.uk
Sun Apr 9 04:24:09 EDT 2006


Dear Jean-Do,

I have tried to tackle a similar problem some weeks ago, and eventually
(there was a deadline!) I had to give up.
The problem that I had was to display the outer surface of a brain
volume (MR data), which is an isosurface, and clip away the back upper
left part. Inside the clipped-away part I wanted to show the cut planes.
To do that, the cut planes needed to be clipped (intersected) with the
outer contour of the isosurface.
I got very many useful tips from the mailing list! In the end I got as
far as: I had the contour of the iso surface in the same plane as where
the cutplane was. The idea was to use a vtkImplicitSelectionLoop to
select the part of the cutplane inside the loop.
Alas, that was where the program exited with a segmentation fault. To
this day I have no ide what causes it. If it is of any help, the code
that I used to make the boundary etc is attached. The image that I used
is here: http://www.wbic.cam.ac.uk/~amw71/HeadTemplate.vtk (feel free
tor try it out). If you uncomment the line
  #renWindow AddActor BrainIsoActor
in the script, you will get the iso-surface as well, and if you uncomment
  #renWindow AddActor actorSag
that is when it runs the code I made to clip the cutplane. vtk will crash...

I ended up displaying the cut volume (grey value data) with volume
rendering. The reson that I wanted to do everything in surface rendering
is that I think it looks much nicer. This is the idea that I had in mind
(http://www.viskom.oeaw.ac.at/~leon/images/sabine_cut.gif) but I could
not get it working in vtk. This example image was made with a program
that had everything (cut planes, which renderinng method to use for
which co-ordinate) hard-coded though...

Best wishes,
Alle Meije

At 09:13 AM 4/1/2006, Jean-Dominique Barnichon wrote:
> Dear all,
> 
> I need to find the intersection between two surfaces, each one 
> being defined as a polydata (actually one surface is a vertical 
> polyplane, and the other one is a topographical surface).
> Such intersection operation is already effective in other 
> libraries such as CGAL (http://www.cgal.org) and GTS 
> (http://gts.sourceforge.net).
> However, it is still not clear to me which approach i should 
> follow to perform such an operation with vtk.
> From what i understood, one can either :
> - use vtkOBBTree::IntersectWithOBBTree(...), but in this case the 
> related parameters (especially the int(*function)) are not 
> obvious to me. Would it be possible to have a bit more 
> information on this method and its usage?
> - treat polydata as an implicit surface using the 
> vtkImplicitPolydata class (proposed by Dave Pont), which then 
> allows to use vtkClipPolyData class (though this class is not 
> part of vtk, yet?).
> Recently, there has been quite few threads related to very 
> similar topics, but i did not get whether involved people have 
> eventually succeeded or not in computing the intersection using 
> one of the above mentioned method.
> 
> Any help/advice is welcomed.
> Thanks in advance
> Jean-Do


-------------- next part --------------
A non-text attachment was scrubbed...
Name: SurfaceInsideLoop.tcl
Type: application/x-tcl
Size: 5420 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060409/948827b8/attachment.tcl>


More information about the vtkusers mailing list