From 9352e17eed6586a6740513b9f6a592d448d21016 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 24 Feb 2010 16:41:21 +0100 Subject: [PATCH] BUG: fix incorrect node order for VTK_WEDGE in paraview3 reader This appears to be a long-standing bug!?, since it was also in the paraview-2 reader. --- .../PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C index d2ce52e602..8cba50347a 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C @@ -201,10 +201,15 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh } else if (cellModel == prism) { - for (int j = 0; j < 6; j++) - { - nodeIds[j] = cellShape[j]; - } + // VTK has a different node order - their triangles point outwards! + + nodeIds[0] = cellShape[0]; + nodeIds[1] = cellShape[2]; + nodeIds[2] = cellShape[1]; + nodeIds[3] = cellShape[3]; + nodeIds[4] = cellShape[5]; + nodeIds[5] = cellShape[4]; + vtkmesh->InsertNextCell ( VTK_WEDGE,