diff --git a/src/Mod/Fem/App/FemVTKTools.cpp b/src/Mod/Fem/App/FemVTKTools.cpp index 60eb18dbb3..9c4ee433ec 100644 --- a/src/Mod/Fem/App/FemVTKTools.cpp +++ b/src/Mod/Fem/App/FemVTKTools.cpp @@ -440,17 +440,15 @@ void FemVTKTools::exportVTKMesh(const FemMesh* mesh, vtkSmartPointer(mesh->getSMesh()); SMESHDS_Mesh* meshDS = smesh->GetMeshDS(); - const SMDS_MeshInfo& info = meshDS->GetMeshInfo(); //start with the nodes vtkSmartPointer points = vtkSmartPointer::New(); SMDS_NodeIteratorPtr aNodeIter = meshDS->nodesIterator(); - points->SetNumberOfPoints(info.NbNodes()); for(; aNodeIter->more(); ) { const SMDS_MeshNode* node = aNodeIter->next(); // why float, not double? double coords[3] = {double(node->X()*scale), double(node->Y()*scale), double(node->Z()*scale)}; - points->SetPoint(node->GetID()-1, coords); + points->InsertPoint(node->GetID()-1, coords); // memory is allocated by VTK points size = max node id, points will be insterted in SMESH point gaps too } grid->SetPoints(points); // faces