From 22722a877c1c8170b527b40265fad259f32333cc Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 24 Aug 2016 22:08:10 +0100 Subject: [PATCH] foamToVTK, PVFoamReader: Resolve problems converting VTK_WEDGE - There will be triangles rendered inside the mesh (when surface-rendering), because one of the cell's triangles is defined as a quadrangle in VTK_WEDGE. - Therefore, this VTK_WEDGE representation is only used when decomposing the mesh, otherwise the correct representation is done by VTK_POLYHEDRON. - Furthermore, using VTK_PYRAMID gave worse result, because it renders 2 triangles inside the mesh for the collapsed quadrangle, likely due to mismatch with the adjacent cell's face. - Using VTK_HEXAHEDRON was not tested in this iteration, given that it should give even worse results, when compared to using VTK_PYRAMID. Patch contributed by Bruno Santos Resolves bug-report http://bugs.openfoam.org/view.php?id=2099 --- .../postProcessing/dataConversion/foamToVTK/foamToVTK/vtkTopo.C | 2 +- .../PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C | 2 +- .../PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshVolume.C | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/vtkTopo.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/vtkTopo.C index a5cf955cb..dc6ece136 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/vtkTopo.C +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/vtkTopo.C @@ -152,7 +152,7 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh) cellTypes_[celli] = VTK_WEDGE; } - else if (cellModel == tetWedge) + else if (cellModel == tetWedge && decomposePoly) { // Treat as squeezed prism (VTK_WEDGE) vtkVerts.setSize(6); diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C index 7e6e84329..825ff9dc5 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C @@ -219,7 +219,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh nodeIds ); } - else if (cellModel == tetWedge) + else if (cellModel == tetWedge && !reader_->GetUseVTKPolyhedron()) { // Treat as squeezed prism (VTK_WEDGE) diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshVolume.C b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshVolume.C index 073e24bd8..a99fba019 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshVolume.C +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshVolume.C @@ -219,7 +219,7 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh nodeIds ); } - else if (cellModel == tetWedge) + else if (cellModel == tetWedge && !reader_->GetUseVTKPolyhedron()) { // Treat as squeezed prism (VTK_WEDGE)