[vtk-developers] BUG - vtkappendpolydata

Vinny BigD nepasecrirea at yahoo.ca
Fri Jan 11 16:10:22 EST 2008


Hi, 
 
I not sure if its the right place to submit an abnormal behavior... 
 
The problem seems to be with vtkAppendPolyData.  I'll try to be clear as  possible. 
 
Here is the case: 
 
I manually build 2 vtkPolyData each containing 1 polygon(sqares) (1  cell) with one scalar attribute. 
 
Then I use 2 vtkLinearExtrusionFilter to extrude those 2 vtkPolyData at  2 different heights. 
 
Then, I add them to the vtkAppendPolyData and pass the result to the  mapper wich use the scalar data for color mapping. 
 
PROBLEM: 
 
Everything seems ok, EXCEPT that the 2 colors are randomly distributed  on each faces of the cubes( we expect that each cube is uniformly colored). 
 
After long debugging sessions, it seems that the  vtkLinearExtrusionFilter generate cells of type TriangleStrips AND  Polygons.  The vtkAppendPolyData  then seems to copy polygonal data of  each polygon and THEN copy the strips data. Result : the association  between cell and scalar data is corrupted. (See example below) 
 
What I did to resolve the problem: I added a vtkTriangleFilter before  adding to vtkAppendPolyData.  This way all cells are of type Strips and  the association/ordering of scalar data is correct and the display ok. 
 
That behavior is not normal...I guess it should work without this  additionnal filter. 
 
thanks, 
*** 
EXAMPLE: 
Cells list (vtkAppendPolyData->GetOutPut()) AFTER ADDING 1st POLYGON 
CELL: Id, (List of pointsId), scalar value 
CELL : 0 (4,1,3,) Scal: 0 
CELL : 1 (9,6,8,) Scal: 0 
CELL : 2 (2,3,1,) Scal: 0 
CELL : 3 (7,8,6,) Scal: 0 
CELL : 4 (4,1,9,6,) Scal: 0 
CELL : 5 (3,4,8,9,) Scal: 0 
CELL : 6 (2,3,7,8,) Scal: 0 
CELL : 7 (1,2,6,7,) Scal: 0 
 
 Cells list (vtkAppendPolyData->GetOutPut()) AFTER ADDING 2nd POLYGON  - The ordering is incorrect 
CELL : 0 (4,1,3,) Scal: 0 
CELL : 1 (9,6,8,) Scal: 0 
CELL : 2 (2,3,1,) Scal: 0 
CELL : 3 (7,8,6,) Scal: 0 
CELL : 4 (14,11,13,) Scal: 0 
CELL : 5 (19,16,18,) Scal: 0 
CELL : 6 (12,13,11,) Scal: 0 
CELL : 7 (17,18,16,) Scal: 0 
CELL : 8 (4,1,9,6,) Scal: 1 
CELL : 9 (3,4,8,9,) Scal: 1 
CELL : 10 (2,3,7,8,) Scal: 1 
CELL : 11 (1,2,6,7,) Scal: 1 
CELL : 12 (14,11,19,16,) Scal: 1 
CELL : 13 (13,14,18,19,) Scal: 1 
CELL : 14 (12,13,17,18,) Scal: 1 
CELL : 15 (11,12,16,17,) Scal: 1 
 
       
---------------------------------
Looking for the perfect gift? Give the gift of Flickr!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20080111/5e795ec7/attachment.html>


More information about the vtk-developers mailing list