[vtkusers] clip one vtkPolyData with another?

David.Pont at ensisjv.com David.Pont at ensisjv.com
Mon Jan 30 16:16:38 EST 2006


Alle Meije Wink <alle_meije at yahoo.co.uk> wrote on 31/01/2006 00:54:54:

> Hi Obada,
>
> Thanks for you suggestions. I had already read Steve's email, and based
> on that info I started with a 2d contour:
>
> 1. make the cut planes with vtkCutter in the usual way
>     (this generates the cut planes, but they extend to the bounding box)
> 2. make a 2d contour in the cut planes
>     (this would generate a contour in exactly the same plane
>      so -hopefully?- avoiding the roundoff errors etc)
> 3. clip the 2D cut surface with the 2D contour
>
> Same result...
>
> I tried using implicit functions from the iso-surface, the original
> data, all sorts of contours, etc. but to no avail.
>
> I do not really understand your suggestion at the end. Does that do the
> same thing as I tried with my 2D contour?
>
> Thanks
> Alle Meije

 Hi Alle,
   If I understand correctly you started with a volume (MRI data). In this
case you might be able to clip your cut surfaces with vtkClipPolydata. I
have never done this but according to the documentation: "If a ClipFunction
is not specified, or GenerateClipScalars is off (the default), then the
input's scalar data will be used to clip the polydata."  Try using
vtkClipPolyData->SetValue to specify the same value used with marching
cubes? There is also vtkImplicitDataSet, use the volume as the input data
set, then use this as the implicit function with vtkClipPolyData. The
obvious problem I can forsee in either case is that the volume scalar data
may not be monotonic and clipping may occur at other positions within the
volume..?

For the more general problem of clipping polydata with polydata I have also
seen the GTS library:

http://gts.sourceforge.net/index.html

  regards
    Dave P.




More information about the vtkusers mailing list