[vtkusers] clip one vtkPolyData with another?

David.Pont at ensisjv.com David.Pont at ensisjv.com
Wed Feb 22 16:03:23 EST 2006


Alle Meije Wink <alle_meije at yahoo.co.uk> wrote on 21/02/2006 22:11:22:

> Hi David,
>
> Thanks a lot for these pointers!
>
> >>I now have 2 scripts:
> >>One script uses vtkCutter on the 3D data set. This makes it possible to
> >>show the cutplanes with grey values. However, the edges of the
cut-plane
> >>are defined via grey value thresholding, resulting in a rough shape
that
> >>does not follow the iso-value. (1st attachment, result
> >>http://www.wbic.cam.ac.uk/~amw71/SurfaceCut.png)
> >
> > Did you try vtkImplicitSelectionLoop to clip the rough edges?
>
> I can't see how I should do this. From the test code for
> vtkImplicitSelectionLoop I saw that you can use it to extract a piece of
> a surface (such as the isosurface), but what I would need is a piece of
> the cut-plane

I was thinking you would cut your isosurface to get a polyline (after a
pass through vtkStripper?). This polyline would be the 'loop' which is then
used to clip the cut planes with vtkImplicitSelectionLoop.

>
> >>Another script has nicer cut-planes, where vtkCutter uses the planes
and
> >>the normals of the iso-surface (the clipcow way). The edges now look
> >>much better, but I haven't managed to display the grey values on the
> >>planes. I thought that this should be possible with vtkProbeFilter? I
> >>tried this for one plane, but the only thing that shows up (very
> >>vaguely) is a sort of inner contour (2nd attachment, result:
> >>http://www.wbic.cam.ac.uk/~amw71/SurfaceCut2.png).
> >
> > Perhaps there are not enough points on the cut surface to get decent
> > resolution when probing? (render the cut plane in wireframe to see the
> > sampling density you are using). If this is the problem you could try
one
> > of the subdivision filters eg vtkLinearSubdivisionFilter (2 or 3
> > iterations) to generate more points on the plane before probing.
>
> Ah. now this is true. When I do
>
> eval [actorSag GetProperty] SetRepresentationToWireframe
>
> and do not add the other actors (actorCor and actorAx) in the second
> script, the lines span a number of triangles (many small ones near the
> edges, larger ones in the centre). The very faint colour differences
> that I saw may be the average probed colours in the triangles? I guess
> it's one colour / triangle?
>
> Would it be possible to probe the volume at the right resolution (ie,
> the points in the volume) by increasing the number of points on the
> plane? That would be the ideal case.
>

Yes if you pass the plane through vtkLinearSubdivisionFilter, try 2 or 3
iterations. Each iteration simply divides each original triangle into 4?
smaller triangles, generating 3? new points on the original edges. Then use
the subdivided plane to probe with, should do the trick, just be aware that
too many iterations will start to really slow things down, ie find a
balance between resolution and speed.

 HTH
    Dave P

> Thanks
> Alle Meije
>
>
> ___________________________________________________________
> Win a BlackBerry device from O2 with Yahoo!. Enter now. http://www.
> yahoo.co.uk/blackberry




More information about the vtkusers mailing list