I use the following code to read CGNS files:
vtkNew<vtkCGNSReader> reader;
reader->SetFileName(toUTF8(filename).c_str());
reader->UpdateInformation();
reader->EnableAllBases();
reader->EnableAllFamilies();
reader->EnableAllCellArrays();
reader->EnableAllPointArrays();
reader->EnableAllFaceArrays();
reader->Update();
vtkDataObject* obj = vtkMultiBlockDataSet::SafeDownCast(reader->GetOutput()->GetBlock(0))->GetBlock(0);
vtkUnstructuredGrid* grid = vtkUnstructuredGrid::New();
grid->DeepCopy(obj);
Then use vtkDataSetMapper to render the vtkUnstructuredGrid object.
I got the following result:
As shown in the figure below, it is clear that the result obtained in ParaView is the correct one.
I want to know what causes this discrepancy? How can I fix this error?