[vtkusers] Surface view for polygons shows redundant area

Siavash Ameli sameli at hawk.iit.edu
Thu Feb 7 11:39:42 EST 2013


I am trying to display polygons in ParaView and VTK, but I do not get
correct "surface" view. It seems that it draws redundant lines (areas);
all excessive lines originated from point with index 0 and each line end
up to all other points. Then surface view fills the area between
consecutive redundant lines, sometimes with different color. The issue
can be accentuated by using a concave polygon. Consider the following
vtk file (file attached, Polygon.vtk):

# vtk DataFile Version 3.0
output of my filter
ASCII
DATASET POLYDATA
POINTS 12 float
-3 3 0
-3 -3 0
-2 0 0
-1 1 0
-1 -1 0
0 2 0
0 -2 0
1 1 0
1 -1 0
2 0 0
3 3 0
3 -3 0

POLYGONS 2 14
8 0 2 1 6 11 9 10 5
4 3 4 8 7

Three points with indices 0, 5 and 10 are on a concave boundary segment,
with edges 0 to 5 and  5 to 10. However, surface view shows a link from
point 0 to 10 (screenshot attached, Polygon.png). Same issue happens
from point 0 to point 1. If you try polygons with more vertices, you can
see it draws lines from point 0 to "all" other points. Only wireframe
view reveals the two polygons properly in this file.

Additionally, I have attached an editted Polygon.cxx code from wiki
(files attached, Polygon.cxx and CMakeLists.txt) to display a simpler
concave polygon with 6 vertices in VTK. Please switch comments in actor
properties to see the inconsistency between surface and wireframe views.

I would like to ask that is it a bug or am I doing something wrong?

Thank you.

-Siavash

---------------------------------------------------
Siavash Ameli
Ph.D student at Mechanical and Aerospace Eng. Dept.
Illinois Institute Of Technology
10 West 32nd St. E-1, Suite 130H
Chicago IL 60616
Phone: (312) 567-3555



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130207/f25c4e30/attachment.htm>
-------------- next part --------------
# vtk DataFile Version 3.0
output of my filter
ASCII
DATASET POLYDATA
POINTS 12 float
-3 3 0
-3 -3 0
-2 0 0
-1 1 0
-1 -1 0
0 2 0
0 -2 0
1 1 0
1 -1 0
2 0 0
3 3 0
3 -3 0

POLYGONS 2 14
8 0 2 1 6 11 9 10 5
4 3 4 8 7
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Polygon.png
Type: image/png
Size: 6229 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130207/f25c4e30/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Polygon.cxx
Type: text/x-c++src
Size: 2196 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130207/f25c4e30/attachment.cxx>
-------------- next part --------------
cmake_minimum_required(VERSION 2.8)
PROJECT(Polygon)
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
add_executable(Polygon Polygon.cxx)
target_link_libraries(Polygon ${VTK_LIBRARIES})


More information about the vtkusers mailing list