[vtkusers] what does vtkSelectVisiblePoints actually do?

Petru Pau ppau at risc.uni-linz.ac.at
Mon May 17 10:18:22 EDT 2004


In a previous message to this list, I asked about computing the visible 
points/edges/faces
of a solid body, in vtk. Finding the right filters and cleverly 
connecting them proved
to be way beyond my vtk skills; it seemed to me that I was mercilessly 
condemned to
implement my own filters.

Which I did; well, I tried to, anyway.

Shortly, I used a vtkSelectVisiblePoints to extract exactly those points 
that are visible,
and then, from a copy of the initial vtkPolyData, I removed the points 
that are _not_
visible, and their adjacent cells. Surprisingly, it did something; 
however, not what
I wanted.Surprising was the behavior of vtkSelectVisiblePoints: a 
snapshot of the
output window is attached.

I expected to see a convex figure (well, ok - its projection on the view 
plane should
have been convex). As you can see, there are four triangles that destroy 
the convexity.

For the time being, I can only blame my poor understanding of 
vtkSelectVisiblePoints
for this strange effect. I only hope that someone out there, more 
advanced than me,
can reveal this interesting feature.

In the image, the first renderer has a 3D sphere, the second - the edges 
of the sphere,
collected using vtkExtractEdges, and the third has the edges of the 
visible part of
the sphere, according to vtkSelectVisiblePoints.

The algorithm for removing hidden cells is very simple:
- for each point of the body
- - if the point is not visible
- - - remove the cells incident to this point, and all links to these cells
- - - remove the point itself.

I am not attaching the program itself: Being written in C#, it is bound to
be uninteresting for almost everybody.

Petru

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040517/8cef181d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: visOut.jpg
Type: image/jpeg
Size: 44540 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040517/8cef181d/attachment.jpg>


More information about the vtkusers mailing list