diff --git a/src/Mod/Fem/App/FemVTKTools.cpp b/src/Mod/Fem/App/FemVTKTools.cpp index 2e30251c8..e1d3faa8a 100644 --- a/src/Mod/Fem/App/FemVTKTools.cpp +++ b/src/Mod/Fem/App/FemVTKTools.cpp @@ -851,6 +851,37 @@ void FemVTKTools::exportMechanicalResult(const App::DocumentObject* obj, vtkSmar grid->GetPointData()->AddArray(data); }} + + if(!res->StressVectors.getValues().empty()) { + const std::vector& vec = res->StressVectors.getValues(); + if (vec.size()>1) { + vtkSmartPointer data = vtkSmartPointer::New(); + data->SetNumberOfComponents(3); + data->SetName("Stress Vectors"); + + for(std::vector::const_iterator it=vec.begin(); it!=vec.end(); ++it) { + double tuple[] = {it->x, it->y , it->z}; + data->InsertNextTuple(tuple); + } + + grid->GetPointData()->AddArray(data); + }} + + if(!res->StrainVectors.getValues().empty()) { + const std::vector& vec = res->StrainVectors.getValues(); + if (vec.size()>1) { + vtkSmartPointer data = vtkSmartPointer::New(); + data->SetNumberOfComponents(3); + data->SetName("Strain Vectors"); + + for(std::vector::const_iterator it=vec.begin(); it!=vec.end(); ++it) { + double tuple[] = {it->x, it->y, it->z}; + data->InsertNextTuple(tuple); + } + + grid->GetPointData()->AddArray(data); + }} + } } // namespace