[vtkusers] Cutting a hole in polydata

Hakim Boukellif tsu at planet.nl
Thu Jan 11 16:30:33 EST 2007


Hello,

My apologies if this has been asked before (I've searched through the 
mailing list archives and documentation, but without much success - 
perhaps I've used the wrong keywords), but I've been trying to cut a 
hole in polydata by drawing a shape using the mouse. I'm kind of new to 
VTK, so please excuse any naivety in my methods.
Basically, what I'm currently doing is, when I move the mouse while the 
right mouse button is pressed, a vtkPointPicker tries to pick the point 
on the polygonal object from my current mouse position. When it does, it 
adds this point to a vtkPoints object and once I release the right mouse 
button, it sets this object as the loop of a vtkImplicitSelectionLoop, 
which is also the clip function of vtkClipPolyData filter attached to 
the dataset containing the polydata.
The resulting hole, however, is rather strange. It tends be something 
like a big crescent shape chopped out of the 3D model or a whole bunch 
of tiny, irregularly  shaped holes. At any rate, nothing like the shape 
I've drawn.
The pointpicker appears to be working just fine and I've tried messing 
with the normals of the implicit selectionloop, but to no avail. I'm not 
quite sure where the problem is, so I'd very grateful if someone could 
help me with this problem.

Hakim Boukellif



More information about the vtkusers mailing list