From e0824b96927cc0694369983bf9b728d79e2e9ba2 Mon Sep 17 00:00:00 2001 From: laurence Date: Thu, 5 Jan 2012 17:45:46 +0000 Subject: [PATCH] BUG: objToVTK: Do not print vertex normal header in vtk if none are in the obj --- .../utilities/mesh/manipulation/objToVTK/objToVTK.C | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/applications/utilities/mesh/manipulation/objToVTK/objToVTK.C b/applications/utilities/mesh/manipulation/objToVTK/objToVTK.C index 76babb0b8c..4ff721f485 100644 --- a/applications/utilities/mesh/manipulation/objToVTK/objToVTK.C +++ b/applications/utilities/mesh/manipulation/objToVTK/objToVTK.C @@ -273,12 +273,16 @@ int main(int argc, char *argv[]) } } - outFile << nl << "NORMALS pointNormals float\n"; - forAll(pointNormals, i) + if (!pointNormals.empty()) { - const vector& n = pointNormals[i]; + outFile << nl << "NORMALS pointNormals float\n"; - outFile << n.x() << ' ' << n.y() << ' ' << n.z() << nl; + forAll(pointNormals, i) + { + const vector& n = pointNormals[i]; + + outFile << n.x() << ' ' << n.y() << ' ' << n.z() << nl; + } } Info<< "End\n" << endl;