Hi, <br> <br>I not sure if its the right place to submit an abnormal behavior... <br> <br>The problem seems to be with vtkAppendPolyData. I'll try to be clear as possible. <br> <br>Here is the case: <br> <br>I manually build 2 vtkPolyData each containing 1 polygon(sqares) (1 cell) with one scalar attribute. <br> <br>Then I use 2 vtkLinearExtrusionFilter to extrude those 2 vtkPolyData at 2 different heights. <br> <br>Then, I add them to the vtkAppendPolyData and pass the result to the mapper wich use the scalar data for color mapping. <br> <br>PROBLEM: <br> <br>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). <br> <br>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) <br> <br>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. <br> <br>That behavior is not normal...I guess it should work without this additionnal filter. <br> <br>thanks, <br>*** <br>EXAMPLE: <br>Cells list (vtkAppendPolyData->GetOutPut()) AFTER ADDING 1st POLYGON <br>CELL: Id, (List of pointsId), scalar value <br>CELL : 0 (4,1,3,) Scal: 0 <br>CELL : 1 (9,6,8,) Scal: 0 <br>CELL : 2 (2,3,1,) Scal: 0 <br>CELL : 3 (7,8,6,) Scal: 0 <br>CELL : 4 (4,1,9,6,) Scal: 0 <br>CELL : 5 (3,4,8,9,) Scal: 0 <br>CELL : 6 (2,3,7,8,) Scal: 0 <br>CELL : 7 (1,2,6,7,) Scal: 0 <br> <br> Cells list (vtkAppendPolyData->GetOutPut()) AFTER ADDING 2nd POLYGON - The ordering is incorrect <br>CELL : 0 (4,1,3,) Scal: 0 <br>CELL : 1 (9,6,8,) Scal:
0 <br>CELL : 2 (2,3,1,) Scal: 0 <br>CELL : 3 (7,8,6,) Scal: 0 <br><span style="background-color: rgb(128, 128, 255); text-decoration: underline;">CELL : 4 (14,11,13,) Scal: 0 </span><br style="background-color: rgb(128, 128, 255); text-decoration: underline;"><span style="background-color: rgb(128, 128, 255); text-decoration: underline;">CELL : 5 (19,16,18,) Scal: 0 </span><br style="background-color: rgb(128, 128, 255); text-decoration: underline;"><span style="background-color: rgb(128, 128, 255); text-decoration: underline;">CELL : 6 (12,13,11,) Scal: 0 </span><br style="background-color: rgb(128, 128, 255); text-decoration: underline;"><span style="background-color: rgb(128, 128, 255); text-decoration: underline;">CELL : 7 (17,18,16,) Scal: 0 </span><br>CELL : 8 (4,1,9,6,) Scal: 1 <br>CELL : 9 (3,4,8,9,) Scal: 1 <br>CELL : 10 (2,3,7,8,) Scal: 1 <br>CELL : 11 (1,2,6,7,) Scal: 1 <br>CELL : 12 (14,11,19,16,) Scal: 1 <br>CELL : 13 (13,14,18,19,) Scal: 1 <br>CELL : 14
(12,13,17,18,) Scal: 1 <br>CELL : 15 (11,12,16,17,) Scal: 1 <br> <p>
<hr size=1>
Looking for the perfect gift?<a href="http://www.flickr.com/gift/"><b> Give the gift of Flickr!</b></a>