From ec1b0d8720613cf6c89ca732f43d4aedd7e072b8 Mon Sep 17 00:00:00 2001 From: Joachim Zettler Date: Mon, 26 Mar 2012 10:06:16 +0200 Subject: [PATCH 1/5] Changes on Machining Distortion to account for Centos 5.6 compilation --- src/Mod/Fem/App/AppFem.cpp | 0 src/Mod/Fem/App/AppFemPy.cpp | 81 +++++++++++++++++- src/Mod/Fem/App/CMakeLists.txt | 0 src/Mod/Fem/App/FemMesh.cpp | 65 ++++++++++++-- src/Mod/Fem/App/FemMesh.h | 0 src/Mod/Fem/App/FemMeshObject.cpp | 0 src/Mod/Fem/App/FemMeshObject.h | 0 src/Mod/Fem/App/FemMeshProperty.cpp | 0 src/Mod/Fem/App/FemMeshProperty.h | 0 src/Mod/Fem/App/FemMeshPy.xml | 0 src/Mod/Fem/App/FemMeshPyImp.cpp | 0 src/Mod/Fem/App/HypothesisPy.cpp | 0 src/Mod/Fem/App/HypothesisPy.h | 0 src/Mod/Fem/App/Makefile.am | 0 src/Mod/Fem/App/PreCompiled.cpp | 0 src/Mod/Fem/App/PreCompiled.h | 0 src/Mod/Fem/CMakeLists.txt | 0 src/Mod/Fem/FemExample.py | 0 src/Mod/Fem/Gui/AppFemGui.cpp | 0 src/Mod/Fem/Gui/AppFemGuiPy.cpp | 0 src/Mod/Fem/Gui/CMakeLists.txt | 0 src/Mod/Fem/Gui/Command.cpp | 0 src/Mod/Fem/Gui/Makefile.am | 0 src/Mod/Fem/Gui/PreCompiled.cpp | 0 src/Mod/Fem/Gui/PreCompiled.h | 0 src/Mod/Fem/Gui/Resources/Fem.qrc | 0 src/Mod/Fem/Gui/Resources/Makefile.am | 0 src/Mod/Fem/Gui/Resources/UpdateResources.bat | 0 .../Fem/Gui/Resources/icons/Fem_FemMesh.svg | 0 .../Fem/Gui/Resources/translations/Fem_af.qm | Bin .../Fem/Gui/Resources/translations/Fem_af.ts | 0 .../Fem/Gui/Resources/translations/Fem_de.qm | Bin .../Fem/Gui/Resources/translations/Fem_de.ts | 0 .../Fem/Gui/Resources/translations/Fem_es.qm | Bin .../Fem/Gui/Resources/translations/Fem_es.ts | 0 .../Fem/Gui/Resources/translations/Fem_fi.qm | Bin .../Fem/Gui/Resources/translations/Fem_fi.ts | 0 .../Fem/Gui/Resources/translations/Fem_fr.qm | Bin .../Fem/Gui/Resources/translations/Fem_fr.ts | 0 .../Fem/Gui/Resources/translations/Fem_hr.qm | Bin .../Fem/Gui/Resources/translations/Fem_hr.ts | 0 .../Fem/Gui/Resources/translations/Fem_hu.qm | Bin .../Fem/Gui/Resources/translations/Fem_hu.ts | 0 .../Fem/Gui/Resources/translations/Fem_it.qm | Bin .../Fem/Gui/Resources/translations/Fem_it.ts | 0 .../Fem/Gui/Resources/translations/Fem_ja.qm | Bin .../Fem/Gui/Resources/translations/Fem_ja.ts | 0 .../Fem/Gui/Resources/translations/Fem_nl.qm | Bin .../Fem/Gui/Resources/translations/Fem_nl.ts | 0 .../Fem/Gui/Resources/translations/Fem_no.qm | Bin .../Fem/Gui/Resources/translations/Fem_no.ts | 0 .../Fem/Gui/Resources/translations/Fem_pl.qm | Bin .../Fem/Gui/Resources/translations/Fem_pl.ts | 0 .../Fem/Gui/Resources/translations/Fem_pt.qm | Bin .../Fem/Gui/Resources/translations/Fem_pt.ts | 0 .../Fem/Gui/Resources/translations/Fem_ru.qm | Bin .../Fem/Gui/Resources/translations/Fem_ru.ts | 0 .../Fem/Gui/Resources/translations/Fem_se.qm | Bin .../Fem/Gui/Resources/translations/Fem_se.ts | 0 .../Fem/Gui/Resources/translations/Fem_uk.qm | Bin .../Fem/Gui/Resources/translations/Fem_uk.ts | 0 .../Fem/Gui/Resources/translations/Fem_zh.qm | Bin .../Fem/Gui/Resources/translations/Fem_zh.ts | 0 src/Mod/Fem/Gui/ViewProviderFemMesh.cpp | 0 src/Mod/Fem/Gui/ViewProviderFemMesh.h | 0 src/Mod/Fem/Gui/Workbench.cpp | 0 src/Mod/Fem/Gui/Workbench.h | 0 src/Mod/Fem/Init.py | 0 src/Mod/Fem/InitGui.py | 0 src/Mod/Fem/Makefile.am | 0 src/Mod/Fem/convert2TetGen.py | 0 src/Mod/Fem/fem.dox | 0 72 files changed, 138 insertions(+), 8 deletions(-) mode change 100644 => 100755 src/Mod/Fem/App/AppFem.cpp mode change 100644 => 100755 src/Mod/Fem/App/AppFemPy.cpp mode change 100644 => 100755 src/Mod/Fem/App/CMakeLists.txt mode change 100644 => 100755 src/Mod/Fem/App/FemMesh.cpp mode change 100644 => 100755 src/Mod/Fem/App/FemMesh.h mode change 100644 => 100755 src/Mod/Fem/App/FemMeshObject.cpp mode change 100644 => 100755 src/Mod/Fem/App/FemMeshObject.h mode change 100644 => 100755 src/Mod/Fem/App/FemMeshProperty.cpp mode change 100644 => 100755 src/Mod/Fem/App/FemMeshProperty.h mode change 100644 => 100755 src/Mod/Fem/App/FemMeshPy.xml mode change 100644 => 100755 src/Mod/Fem/App/FemMeshPyImp.cpp mode change 100644 => 100755 src/Mod/Fem/App/HypothesisPy.cpp mode change 100644 => 100755 src/Mod/Fem/App/HypothesisPy.h mode change 100644 => 100755 src/Mod/Fem/App/Makefile.am mode change 100644 => 100755 src/Mod/Fem/App/PreCompiled.cpp mode change 100644 => 100755 src/Mod/Fem/App/PreCompiled.h mode change 100644 => 100755 src/Mod/Fem/CMakeLists.txt mode change 100644 => 100755 src/Mod/Fem/FemExample.py mode change 100644 => 100755 src/Mod/Fem/Gui/AppFemGui.cpp mode change 100644 => 100755 src/Mod/Fem/Gui/AppFemGuiPy.cpp mode change 100644 => 100755 src/Mod/Fem/Gui/CMakeLists.txt mode change 100644 => 100755 src/Mod/Fem/Gui/Command.cpp mode change 100644 => 100755 src/Mod/Fem/Gui/Makefile.am mode change 100644 => 100755 src/Mod/Fem/Gui/PreCompiled.cpp mode change 100644 => 100755 src/Mod/Fem/Gui/PreCompiled.h mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/Fem.qrc mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/Makefile.am mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/UpdateResources.bat mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/icons/Fem_FemMesh.svg mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_af.qm mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_af.ts mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_de.qm mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_de.ts mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_es.qm mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_es.ts mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_fi.qm mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_fi.ts mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_fr.qm mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_fr.ts mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_hr.qm mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_hr.ts mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_hu.qm mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_hu.ts mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_it.qm mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_it.ts mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_ja.qm mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_ja.ts mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_nl.qm mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_nl.ts mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_no.qm mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_no.ts mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_pl.qm mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_pl.ts mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_pt.qm mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_pt.ts mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_ru.qm mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_ru.ts mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_se.qm mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_se.ts mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_uk.qm mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_uk.ts mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_zh.qm mode change 100644 => 100755 src/Mod/Fem/Gui/Resources/translations/Fem_zh.ts mode change 100644 => 100755 src/Mod/Fem/Gui/ViewProviderFemMesh.cpp mode change 100644 => 100755 src/Mod/Fem/Gui/ViewProviderFemMesh.h mode change 100644 => 100755 src/Mod/Fem/Gui/Workbench.cpp mode change 100644 => 100755 src/Mod/Fem/Gui/Workbench.h mode change 100644 => 100755 src/Mod/Fem/Init.py mode change 100644 => 100755 src/Mod/Fem/InitGui.py mode change 100644 => 100755 src/Mod/Fem/Makefile.am mode change 100644 => 100755 src/Mod/Fem/convert2TetGen.py mode change 100644 => 100755 src/Mod/Fem/fem.dox diff --git a/src/Mod/Fem/App/AppFem.cpp b/src/Mod/Fem/App/AppFem.cpp old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/App/AppFemPy.cpp b/src/Mod/Fem/App/AppFemPy.cpp old mode 100644 new mode 100755 index 551e07eb69..79f6eb5856 --- a/src/Mod/Fem/App/AppFemPy.cpp +++ b/src/Mod/Fem/App/AppFemPy.cpp @@ -149,7 +149,82 @@ static PyObject * SMESH_PCA(PyObject *self, PyObject *args) Base::Matrix4D Trafo = pca.Transform(); /*Let´s transform the input mesh with the PCA Matrix*/ inputMesh->getFemMeshPtr()->transformGeometry(Trafo); - //inputMesh->getFemMeshPtr()->getSMesh()->ExportUNV("C:/PCA_alignment.unv"); + //inputMesh->getFemMeshPtr()->getSMesh()->ExportUNV("C:/Temp/PCA_alignment.unv"); + //Now lets check if the smallest dimension of the BBox is oriented towards the Z-Axis. If not, lets rotate it around the X or Y axis + //Use the SMESH structure for that + // aMesh.Transform(Trafo); + + //Base::Rotation rotatex,rotatey,rotatez; + //const Base::Vector3d rotate_axis_x(1.0,0.0,0.0),rotate_axis_y(0.0,1.0,0.0),rotate_axis_z(0.0,0.0,1.0); + //double bbox_length_x,bbox_length_y,bbox_length_z; + ////Rotate around the each axes and choose the settings for the min bbox + //Base::Matrix4D final_trafo; + //Base::BoundBox3f aBBox; + ////Get the current BBOX and look for the size + //aBBox = aMesh.GetBoundBox(); + //bbox_length_x = aBBox.LengthX();bbox_length_y = aBBox.LengthY();bbox_length_z = aBBox.LengthZ(); + ////Now do the rotation stuff + //if (bbox_length_z < bbox_length_x && bbox_length_z < bbox_length_y) + // Py_Return; + //else if ( + + + //MeshCore::MeshKernel atempkernel; + + //float it_steps=10.0; + //double step_size; + //double alpha_x=0.0,alpha_y=0.0,alpha_z=0.0; + //double perfect_ax=0.0,perfect_ay=0.0,perfect_az=0.0; + + ////Do a Monte Carlo approach and start from the Principal Axis System + ////and rotate +/- 60° around each axis in a first iteration + //double angle_range_min_x=-PI/3.0,angle_range_max_x=PI/3.0, + // angle_range_min_y=-PI/3.0,angle_range_max_y=PI/3.0, + // angle_range_min_z=-PI/3.0,angle_range_max_z=PI/3.0; + + ////We rotate until we are 0.1° sure to be in the right position + //for (step_size = (2.0*PI/it_steps);step_size>(2.0*PI/3600.0);step_size=(2.0*PI/it_steps)) + //{ + // for(alpha_x=angle_range_min_x;alpha_xnext(); current_node.Set(float(aNode->X()),float(aNode->Y()),float(aNode->Z())); current_node = matrix * current_node; - if(current_node.z > billet_thickness || current_node.z < 0.0) + if(current_node.z > billet_thickness || current_node.z < -0.1) { //lets jump out of the function as soon as we find a //Node that is higher or lower than billet thickness @@ -563,7 +638,7 @@ static PyObject * minBoundingBox(PyObject *self, PyObject *args) float(0.0),float(0.0),float(0.0),float(1.0)); inputMesh->getFemMeshPtr()->transformGeometry(trans_matrix); - //inputMesh->getFemMeshPtr()->getSMesh()->ExportUNV("C:/fine_tuning.unv"); + //inputMesh->getFemMeshPtr()->getSMesh()->ExportUNV("C:/temp/fine_tuning.unv"); } PY_CATCH; diff --git a/src/Mod/Fem/App/CMakeLists.txt b/src/Mod/Fem/App/CMakeLists.txt old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/App/FemMesh.cpp b/src/Mod/Fem/App/FemMesh.cpp old mode 100644 new mode 100755 index 440b5cb015..ef78fd0246 --- a/src/Mod/Fem/App/FemMesh.cpp +++ b/src/Mod/Fem/App/FemMesh.cpp @@ -58,9 +58,13 @@ #include #include +//to simplify parsing input files we use the boost lib +#include + using namespace Fem; using namespace Base; +using namespace boost; TYPESYSTEM_SOURCE(Fem::FemMesh , Base::Persistence); @@ -374,23 +378,32 @@ void FemMesh::readNastran(const std::string &Filename) inputfile.open(Filename.c_str()); inputfile.seekg(std::ifstream::beg); std::string line1,line2,temp; + std::vector token_results; + token_results.clear(); Base::Vector3d current_node; std::vector vertices; vertices.clear(); + std::vector nodal_id; + nodal_id.clear(); std::vector tetra_element; std::vector > all_elements; std::vector element_id; element_id.clear(); + bool nastran_free_format = false; do { std::getline(inputfile,line1); if (line1.size() == 0) continue; - if (line1.find("GRID*")!= std::string::npos) //We found a Grid line + if (!nastran_free_format && line1.find(",")!= std::string::npos) + nastran_free_format = true; + if (!nastran_free_format && line1.find("GRID*")!= std::string::npos ) //We found a Grid line { //Now lets extract the GRID Points = Nodes //As each GRID Line consists of two subsequent lines we have to //take care of that as well std::getline(inputfile,line2); + //Get the Nodal ID + nodal_id.push_back(atoi(line1.substr(8,24).c_str())); //Extract X Value current_node.x = atof(line1.substr(40,56).c_str()); //Extract Y Value @@ -400,7 +413,7 @@ void FemMesh::readNastran(const std::string &Filename) vertices.push_back(current_node); } - else if (line1.find("CTETRA")!= std::string::npos) + else if (!nastran_free_format && line1.find("CTETRA")!= std::string::npos) { tetra_element.clear(); //Lets extract the elements @@ -422,6 +435,46 @@ void FemMesh::readNastran(const std::string &Filename) all_elements.push_back(tetra_element); } + else if (nastran_free_format && line1.find("GRID")!= std::string::npos ) //We found a Grid line + { + char_separator sep(","); + tokenizer > tokens(line1, sep); + token_results.assign(tokens.begin(),tokens.end()); + if (token_results.size() < 3) + continue;//Line does not include Nodal coordinates + nodal_id.push_back(atoi(token_results[1].c_str())); + current_node.x = atof(token_results[3].c_str()); + current_node.y = atof(token_results[4].c_str()); + current_node.z = atof(token_results[5].c_str()); + vertices.push_back(current_node); + } + else if (nastran_free_format && line1.find("CTETRA")!= std::string::npos) + { + tetra_element.clear(); + //Lets extract the elements + //As each Element Line consists of two subsequent lines as well + //we have to take care of that + //At a first step we only extract Quadratic Tetrahedral Elements + std::getline(inputfile,line2); + char_separator sep(","); + tokenizer > tokens(line1.append(line2), sep); + token_results.assign(tokens.begin(),tokens.end()); + if (token_results.size() < 11) + continue;//Line does not include enough nodal IDs + element_id.push_back(atoi(token_results[1].c_str())); + tetra_element.push_back(atoi(token_results[3].c_str())); + tetra_element.push_back(atoi(token_results[4].c_str())); + tetra_element.push_back(atoi(token_results[5].c_str())); + tetra_element.push_back(atoi(token_results[6].c_str())); + tetra_element.push_back(atoi(token_results[7].c_str())); + tetra_element.push_back(atoi(token_results[8].c_str())); + tetra_element.push_back(atoi(token_results[10].c_str())); + tetra_element.push_back(atoi(token_results[11].c_str())); + tetra_element.push_back(atoi(token_results[12].c_str())); + tetra_element.push_back(atoi(token_results[13].c_str())); + + all_elements.push_back(tetra_element); + } } while (inputfile.good()); @@ -431,10 +484,10 @@ void FemMesh::readNastran(const std::string &Filename) std::vector::const_iterator anodeiterator; SMESHDS_Mesh* meshds = this->myMesh->GetMeshDS(); meshds->ClearMesh(); - int j=1; + unsigned int j=0; for(anodeiterator=vertices.begin(); anodeiterator!=vertices.end(); anodeiterator++) { - meshds->AddNodeWithID((*anodeiterator).x,(*anodeiterator).y,(*anodeiterator).z,j); + meshds->AddNodeWithID((*anodeiterator).x,(*anodeiterator).y,(*anodeiterator).z,nodal_id[j]); j++; } @@ -442,7 +495,8 @@ void FemMesh::readNastran(const std::string &Filename) { //Die Reihenfolge wie hier die Elemente hinzugefügt werden ist sehr wichtig. //Ansonsten ist eine konsistente Datenstruktur nicht möglich - meshds->AddVolumeWithID( + meshds->AddVolumeWithID + ( meshds->FindNode(all_elements[i][0]), meshds->FindNode(all_elements[i][2]), meshds->FindNode(all_elements[i][1]), @@ -458,6 +512,7 @@ void FemMesh::readNastran(const std::string &Filename) } } + void FemMesh::read(const char *FileName) { Base::FileInfo File(FileName); diff --git a/src/Mod/Fem/App/FemMesh.h b/src/Mod/Fem/App/FemMesh.h old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/App/FemMeshObject.cpp b/src/Mod/Fem/App/FemMeshObject.cpp old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/App/FemMeshObject.h b/src/Mod/Fem/App/FemMeshObject.h old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/App/FemMeshProperty.cpp b/src/Mod/Fem/App/FemMeshProperty.cpp old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/App/FemMeshProperty.h b/src/Mod/Fem/App/FemMeshProperty.h old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/App/FemMeshPy.xml b/src/Mod/Fem/App/FemMeshPy.xml old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/App/FemMeshPyImp.cpp b/src/Mod/Fem/App/FemMeshPyImp.cpp old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/App/HypothesisPy.cpp b/src/Mod/Fem/App/HypothesisPy.cpp old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/App/HypothesisPy.h b/src/Mod/Fem/App/HypothesisPy.h old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/App/Makefile.am b/src/Mod/Fem/App/Makefile.am old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/App/PreCompiled.cpp b/src/Mod/Fem/App/PreCompiled.cpp old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/App/PreCompiled.h b/src/Mod/Fem/App/PreCompiled.h old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/CMakeLists.txt b/src/Mod/Fem/CMakeLists.txt old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/FemExample.py b/src/Mod/Fem/FemExample.py old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/AppFemGui.cpp b/src/Mod/Fem/Gui/AppFemGui.cpp old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/AppFemGuiPy.cpp b/src/Mod/Fem/Gui/AppFemGuiPy.cpp old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/CMakeLists.txt b/src/Mod/Fem/Gui/CMakeLists.txt old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Command.cpp b/src/Mod/Fem/Gui/Command.cpp old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Makefile.am b/src/Mod/Fem/Gui/Makefile.am old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/PreCompiled.cpp b/src/Mod/Fem/Gui/PreCompiled.cpp old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/PreCompiled.h b/src/Mod/Fem/Gui/PreCompiled.h old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/Fem.qrc b/src/Mod/Fem/Gui/Resources/Fem.qrc old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/Makefile.am b/src/Mod/Fem/Gui/Resources/Makefile.am old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/UpdateResources.bat b/src/Mod/Fem/Gui/Resources/UpdateResources.bat old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/icons/Fem_FemMesh.svg b/src/Mod/Fem/Gui/Resources/icons/Fem_FemMesh.svg old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_af.qm b/src/Mod/Fem/Gui/Resources/translations/Fem_af.qm old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_af.ts b/src/Mod/Fem/Gui/Resources/translations/Fem_af.ts old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_de.qm b/src/Mod/Fem/Gui/Resources/translations/Fem_de.qm old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_de.ts b/src/Mod/Fem/Gui/Resources/translations/Fem_de.ts old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_es.qm b/src/Mod/Fem/Gui/Resources/translations/Fem_es.qm old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_es.ts b/src/Mod/Fem/Gui/Resources/translations/Fem_es.ts old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_fi.qm b/src/Mod/Fem/Gui/Resources/translations/Fem_fi.qm old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_fi.ts b/src/Mod/Fem/Gui/Resources/translations/Fem_fi.ts old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_fr.qm b/src/Mod/Fem/Gui/Resources/translations/Fem_fr.qm old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_fr.ts b/src/Mod/Fem/Gui/Resources/translations/Fem_fr.ts old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_hr.qm b/src/Mod/Fem/Gui/Resources/translations/Fem_hr.qm old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_hr.ts b/src/Mod/Fem/Gui/Resources/translations/Fem_hr.ts old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_hu.qm b/src/Mod/Fem/Gui/Resources/translations/Fem_hu.qm old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_hu.ts b/src/Mod/Fem/Gui/Resources/translations/Fem_hu.ts old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_it.qm b/src/Mod/Fem/Gui/Resources/translations/Fem_it.qm old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_it.ts b/src/Mod/Fem/Gui/Resources/translations/Fem_it.ts old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_ja.qm b/src/Mod/Fem/Gui/Resources/translations/Fem_ja.qm old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_ja.ts b/src/Mod/Fem/Gui/Resources/translations/Fem_ja.ts old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_nl.qm b/src/Mod/Fem/Gui/Resources/translations/Fem_nl.qm old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_nl.ts b/src/Mod/Fem/Gui/Resources/translations/Fem_nl.ts old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_no.qm b/src/Mod/Fem/Gui/Resources/translations/Fem_no.qm old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_no.ts b/src/Mod/Fem/Gui/Resources/translations/Fem_no.ts old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_pl.qm b/src/Mod/Fem/Gui/Resources/translations/Fem_pl.qm old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_pl.ts b/src/Mod/Fem/Gui/Resources/translations/Fem_pl.ts old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_pt.qm b/src/Mod/Fem/Gui/Resources/translations/Fem_pt.qm old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_pt.ts b/src/Mod/Fem/Gui/Resources/translations/Fem_pt.ts old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_ru.qm b/src/Mod/Fem/Gui/Resources/translations/Fem_ru.qm old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_ru.ts b/src/Mod/Fem/Gui/Resources/translations/Fem_ru.ts old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_se.qm b/src/Mod/Fem/Gui/Resources/translations/Fem_se.qm old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_se.ts b/src/Mod/Fem/Gui/Resources/translations/Fem_se.ts old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_uk.qm b/src/Mod/Fem/Gui/Resources/translations/Fem_uk.qm old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_uk.ts b/src/Mod/Fem/Gui/Resources/translations/Fem_uk.ts old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_zh.qm b/src/Mod/Fem/Gui/Resources/translations/Fem_zh.qm old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Resources/translations/Fem_zh.ts b/src/Mod/Fem/Gui/Resources/translations/Fem_zh.ts old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/ViewProviderFemMesh.cpp b/src/Mod/Fem/Gui/ViewProviderFemMesh.cpp old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/ViewProviderFemMesh.h b/src/Mod/Fem/Gui/ViewProviderFemMesh.h old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Workbench.cpp b/src/Mod/Fem/Gui/Workbench.cpp old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Gui/Workbench.h b/src/Mod/Fem/Gui/Workbench.h old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Init.py b/src/Mod/Fem/Init.py old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/InitGui.py b/src/Mod/Fem/InitGui.py old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/Makefile.am b/src/Mod/Fem/Makefile.am old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/convert2TetGen.py b/src/Mod/Fem/convert2TetGen.py old mode 100644 new mode 100755 diff --git a/src/Mod/Fem/fem.dox b/src/Mod/Fem/fem.dox old mode 100644 new mode 100755 From 4af0ca1401716d47faec5d7111ffcd5281899f2c Mon Sep 17 00:00:00 2001 From: Joachim Zettler Date: Tue, 27 Mar 2012 13:54:06 +0200 Subject: [PATCH 2/5] Removed dependency to libf2c as it is not needed my SMESH if we do not want to use MEFISTO2D --- src/3rdParty/salomesmesh/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdParty/salomesmesh/CMakeLists.txt b/src/3rdParty/salomesmesh/CMakeLists.txt index 314632396f..ad500dcd5d 100644 --- a/src/3rdParty/salomesmesh/CMakeLists.txt +++ b/src/3rdParty/salomesmesh/CMakeLists.txt @@ -173,7 +173,7 @@ FILE(GLOB StdMeshers_source_files src/StdMeshers/*.cpp src/MEFISTO2/*.cpp src/ME INCLUDE_DIRECTORIES(src/StdMeshers) ADD_LIBRARY(StdMeshers SHARED ${StdMeshers_source_files}) -TARGET_LINK_LIBRARIES(StdMeshers SMESH TKernel TKMath TKAdvTools f2c gfortran) +TARGET_LINK_LIBRARIES(StdMeshers SMESH TKernel TKMath TKAdvTools) SET(StdMeshers_CFLAGS "") IF(WIN32) SET(StdMeshers_CFLAGS "-DSTDMESHERS_EXPORTS -DMEFISTO2D_EXPORTS") From 72738a2956fc52c41eb2d1909c4d346824208413 Mon Sep 17 00:00:00 2001 From: Joachim Zettler Date: Tue, 27 Mar 2012 16:14:58 +0200 Subject: [PATCH 3/5] Final adaptation to Centos 5.6 --- src/3rdParty/salomesmesh/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdParty/salomesmesh/CMakeLists.txt b/src/3rdParty/salomesmesh/CMakeLists.txt index ad500dcd5d..6169725705 100644 --- a/src/3rdParty/salomesmesh/CMakeLists.txt +++ b/src/3rdParty/salomesmesh/CMakeLists.txt @@ -173,7 +173,7 @@ FILE(GLOB StdMeshers_source_files src/StdMeshers/*.cpp src/MEFISTO2/*.cpp src/ME INCLUDE_DIRECTORIES(src/StdMeshers) ADD_LIBRARY(StdMeshers SHARED ${StdMeshers_source_files}) -TARGET_LINK_LIBRARIES(StdMeshers SMESH TKernel TKMath TKAdvTools) +TARGET_LINK_LIBRARIES(StdMeshers SMESH TKernel TKMath TKAdvTools gfortran) SET(StdMeshers_CFLAGS "") IF(WIN32) SET(StdMeshers_CFLAGS "-DSTDMESHERS_EXPORTS -DMEFISTO2D_EXPORTS") From 93893caa3dea53fc969575486d7f31fe1506d47a Mon Sep 17 00:00:00 2001 From: Joachim Zettler Date: Wed, 28 Mar 2012 14:13:50 +0200 Subject: [PATCH 4/5] Adapt post-processing to redhat gnuplot --- src/Mod/Machining_Distortion/postprocess_gui.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Mod/Machining_Distortion/postprocess_gui.py b/src/Mod/Machining_Distortion/postprocess_gui.py index b6c6392a34..4ad1cfbcef 100755 --- a/src/Mod/Machining_Distortion/postprocess_gui.py +++ b/src/Mod/Machining_Distortion/postprocess_gui.py @@ -42,7 +42,7 @@ class MyForm(QtGui.QDialog,Ui_dialog): ltc_coeff = [] sigini = True for root, dirs, files in os.walk(str(self.dirname)): - if 'final_fe_input.frd' in files: + if 'geometry_fe_input.frd' in files: bbox_orig,\ bbox_distorted,\ relationship,\ @@ -51,7 +51,7 @@ class MyForm(QtGui.QDialog,Ui_dialog): max_disp_y,\ min_disp_y,\ max_disp_z,\ - min_disp_z = calculix_postprocess(os.path.join(root,'final_fe_input.frd')) + min_disp_z = calculix_postprocess(os.path.join(root,'geometry_fe_input.frd')) if sigini: sigini = False lc_coeff,ltc_coeff = get_sigini_values(os.path.join(root,'sigini_input.txt')) @@ -113,12 +113,13 @@ class MyForm(QtGui.QDialog,Ui_dialog): "set view 80,05,1.3,1.0\n"+ "set title \"Abs Displacement in Z vs. Z-Level Offset and Rotation around Z-Axis\" 0,-2\n"+ "show title\n"+ - "set label \"L Coefficients used for the calculation:" + lc_coeff[0] + "," + lc_coeff[1] + "," + lc_coeff[2] + "," + lc_coeff[3] + "," + lc_coeff[4] + "," + lc_coeff[5][:-1] + "\" at screen 0.1, screen 0.95 left font \"Arial,8\"\n"+ - "set label \"LT Coefficients used for the calculation:" + ltc_coeff[0] + "," + ltc_coeff[1] + "," + ltc_coeff[2] + "," + ltc_coeff[3] + "," + ltc_coeff[4] + "," + ltc_coeff[5][:-1] + "\" at screen 0.1, screen 0.93 left font \"Arial,8\"\n"+ + "set pm3d\n"+ + "set label \"L Coefficients used for the calculation:" + lc_coeff[0] + "," + lc_coeff[1] + "," + lc_coeff[2] + "," + lc_coeff[3] + "," + lc_coeff[4] + "," + lc_coeff[5][:-1] + "\" at screen 0.1, screen 0.95 left\n"+ + "set label \"LT Coefficients used for the calculation:" + ltc_coeff[0] + "," + ltc_coeff[1] + "," + ltc_coeff[2] + "," + ltc_coeff[3] + "," + ltc_coeff[4] + "," + ltc_coeff[5][:-1] + "\" at screen 0.1, screen 0.93 left\n"+ "set label \"Z-Offset\\nin [mm]\" at screen 0.5, screen 0.1 center rotate by 0\n"+ "set label \"Rotation around Z-Axis\\nin [" + str(chr(248)) +"]\" at screen 0.91, screen 0.2 center rotate by 50\n"+ "set label \"Max Displacement Z direction\\nin [mm]\" at screen 0.03, screen 0.5 center rotate by 90\n"+ - "set xtics in nomirror offset character 0,-0.5\n"+ + "set xtics nomirror\n"+ "splot \"postprocessing_input.txt\" u 1:4:14 with pm3d title \"\"\n" + "exit" ) @@ -127,7 +128,7 @@ class MyForm(QtGui.QDialog,Ui_dialog): gnu_plot_input_file.close() os.chdir(str(self.dirname)) fnull = open(os.devnull, 'w') - commandline = FreeCAD.getHomePath() + "bin/gnuplot/gnuplot gnu_plot_input.txt" + commandline = "gnuplot gnu_plot_input.txt" result = subprocess.call(commandline, shell = True, stdout = fnull, stderr = fnull) fnull.close() From b27e6e6bf6e518a9511aed8e902bbed1daa3e7eb Mon Sep 17 00:00:00 2001 From: Joachim Zettler Date: Mon, 20 Aug 2012 21:30:17 +0200 Subject: [PATCH 5/5] Some changes in GUI --- src/Mod/Machining_Distortion/postprocess.py | 121 ++++---- src/Mod/Machining_Distortion/postprocess.ui | 279 ++++++++---------- .../Machining_Distortion/postprocess_gui.py | 85 ++++-- 3 files changed, 245 insertions(+), 240 deletions(-) diff --git a/src/Mod/Machining_Distortion/postprocess.py b/src/Mod/Machining_Distortion/postprocess.py index 79fa4a9d70..250c81414b 100755 --- a/src/Mod/Machining_Distortion/postprocess.py +++ b/src/Mod/Machining_Distortion/postprocess.py @@ -2,17 +2,22 @@ # Form implementation generated from reading ui file 'postprocess.ui' # -# Created: Wed Jan 26 13:34:56 2011 -# by: PyQt4 UI code generator 4.7.4 +# Created: Mon Aug 20 15:18:09 2012 +# by: PyQt4 UI code generator 4.8.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui +try: + _fromUtf8 = QtCore.QString.fromUtf8 +except AttributeError: + _fromUtf8 = lambda s: s + class Ui_dialog(object): def setupUi(self, dialog): - dialog.setObjectName("dialog") - dialog.resize(380, 170) + dialog.setObjectName(_fromUtf8("dialog")) + dialog.resize(425, 240) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) @@ -20,76 +25,70 @@ class Ui_dialog(object): dialog.setSizePolicy(sizePolicy) dialog.setMinimumSize(QtCore.QSize(0, 0)) self.gridLayout_2 = QtGui.QGridLayout(dialog) - self.gridLayout_2.setObjectName("gridLayout_2") - self.groupBox_2 = QtGui.QGroupBox(dialog) - self.groupBox_2.setObjectName("groupBox_2") - self.gridLayout = QtGui.QGridLayout(self.groupBox_2) - self.gridLayout.setObjectName("gridLayout") - self.check_fly_to_buy_7 = QtGui.QCheckBox(self.groupBox_2) - self.check_fly_to_buy_7.setMinimumSize(QtCore.QSize(148, 18)) - self.check_fly_to_buy_7.setChecked(False) - self.check_fly_to_buy_7.setObjectName("check_fly_to_buy_7") - self.gridLayout.addWidget(self.check_fly_to_buy_7, 0, 0, 1, 1) - self.check_fly_to_buy_4 = QtGui.QCheckBox(self.groupBox_2) - self.check_fly_to_buy_4.setMinimumSize(QtCore.QSize(148, 18)) - self.check_fly_to_buy_4.setChecked(False) - self.check_fly_to_buy_4.setObjectName("check_fly_to_buy_4") - self.gridLayout.addWidget(self.check_fly_to_buy_4, 0, 1, 1, 1) - spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout.addItem(spacerItem, 1, 0, 1, 1) - spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout.addItem(spacerItem1, 1, 1, 1, 1) - self.check_fly_to_buy_8 = QtGui.QCheckBox(self.groupBox_2) - self.check_fly_to_buy_8.setMinimumSize(QtCore.QSize(148, 18)) - self.check_fly_to_buy_8.setChecked(False) - self.check_fly_to_buy_8.setObjectName("check_fly_to_buy_8") - self.gridLayout.addWidget(self.check_fly_to_buy_8, 2, 0, 1, 1) - self.check_fly_to_buy_2 = QtGui.QCheckBox(self.groupBox_2) - self.check_fly_to_buy_2.setMinimumSize(QtCore.QSize(148, 18)) - self.check_fly_to_buy_2.setChecked(False) - self.check_fly_to_buy_2.setObjectName("check_fly_to_buy_2") - self.gridLayout.addWidget(self.check_fly_to_buy_2, 2, 1, 1, 1) - spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout.addItem(spacerItem2, 3, 0, 1, 1) - spacerItem3 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout.addItem(spacerItem3, 3, 1, 1, 1) - self.check_fly_to_buy_5 = QtGui.QCheckBox(self.groupBox_2) - self.check_fly_to_buy_5.setMinimumSize(QtCore.QSize(148, 18)) - self.check_fly_to_buy_5.setChecked(False) - self.check_fly_to_buy_5.setObjectName("check_fly_to_buy_5") - self.gridLayout.addWidget(self.check_fly_to_buy_5, 4, 0, 1, 1) - self.check_fly_to_buy_3 = QtGui.QCheckBox(self.groupBox_2) - self.check_fly_to_buy_3.setMinimumSize(QtCore.QSize(148, 18)) - self.check_fly_to_buy_3.setChecked(False) - self.check_fly_to_buy_3.setObjectName("check_fly_to_buy_3") - self.gridLayout.addWidget(self.check_fly_to_buy_3, 4, 1, 1, 1) - self.gridLayout_2.addWidget(self.groupBox_2, 0, 0, 1, 2) + self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) self.buttonBox = QtGui.QDialogButtonBox(dialog) self.buttonBox.setOrientation(QtCore.Qt.Vertical) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) - self.buttonBox.setObjectName("buttonBox") - self.gridLayout_2.addWidget(self.buttonBox, 0, 2, 1, 1) + self.buttonBox.setObjectName(_fromUtf8("buttonBox")) + self.gridLayout_2.addWidget(self.buttonBox, 0, 3, 1, 1) self.button_select_results_folder = QtGui.QPushButton(dialog) - self.button_select_results_folder.setObjectName("button_select_results_folder") - self.gridLayout_2.addWidget(self.button_select_results_folder, 1, 0, 1, 1) + self.button_select_results_folder.setObjectName(_fromUtf8("button_select_results_folder")) + self.gridLayout_2.addWidget(self.button_select_results_folder, 3, 0, 1, 1) self.button_start_postprocessing = QtGui.QPushButton(dialog) self.button_start_postprocessing.setEnabled(False) self.button_start_postprocessing.setMinimumSize(QtCore.QSize(0, 23)) - self.button_start_postprocessing.setObjectName("button_start_postprocessing") - self.gridLayout_2.addWidget(self.button_start_postprocessing, 1, 1, 1, 1) + self.button_start_postprocessing.setObjectName(_fromUtf8("button_start_postprocessing")) + self.gridLayout_2.addWidget(self.button_start_postprocessing, 3, 1, 1, 1) + self.groupBox_2 = QtGui.QGroupBox(dialog) + self.groupBox_2.setObjectName(_fromUtf8("groupBox_2")) + self.verticalLayout_2 = QtGui.QVBoxLayout(self.groupBox_2) + self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2")) + self.check_abs_disp_x = QtGui.QRadioButton(self.groupBox_2) + self.check_abs_disp_x.setObjectName(_fromUtf8("check_abs_disp_x")) + self.verticalLayout_2.addWidget(self.check_abs_disp_x) + spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.verticalLayout_2.addItem(spacerItem) + self.check_abs_disp_y = QtGui.QRadioButton(self.groupBox_2) + self.check_abs_disp_y.setObjectName(_fromUtf8("check_abs_disp_y")) + self.verticalLayout_2.addWidget(self.check_abs_disp_y) + spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.verticalLayout_2.addItem(spacerItem1) + self.check_abs_disp_z = QtGui.QRadioButton(self.groupBox_2) + self.check_abs_disp_z.setObjectName(_fromUtf8("check_abs_disp_z")) + self.verticalLayout_2.addWidget(self.check_abs_disp_z) + self.gridLayout_2.addWidget(self.groupBox_2, 0, 0, 1, 1) + self.groupBox_3 = QtGui.QGroupBox(dialog) + self.groupBox_3.setObjectName(_fromUtf8("groupBox_3")) + self.verticalLayout_3 = QtGui.QVBoxLayout(self.groupBox_3) + self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) + self.check_rot_x = QtGui.QRadioButton(self.groupBox_3) + self.check_rot_x.setObjectName(_fromUtf8("check_rot_x")) + self.verticalLayout_3.addWidget(self.check_rot_x) + spacerItem2 = QtGui.QSpacerItem(20, 33, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.verticalLayout_3.addItem(spacerItem2) + self.check_rot_y = QtGui.QRadioButton(self.groupBox_3) + self.check_rot_y.setObjectName(_fromUtf8("check_rot_y")) + self.verticalLayout_3.addWidget(self.check_rot_y) + spacerItem3 = QtGui.QSpacerItem(20, 34, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.verticalLayout_3.addItem(spacerItem3) + self.check_rot_z = QtGui.QRadioButton(self.groupBox_3) + self.check_rot_z.setObjectName(_fromUtf8("check_rot_z")) + self.verticalLayout_3.addWidget(self.check_rot_z) + self.gridLayout_2.addWidget(self.groupBox_3, 0, 1, 1, 1) self.retranslateUi(dialog) QtCore.QMetaObject.connectSlotsByName(dialog) def retranslateUi(self, dialog): dialog.setWindowTitle(QtGui.QApplication.translate("dialog", "Machining Distortion Prediction", None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox_2.setTitle(QtGui.QApplication.translate("dialog", "Output Elements", None, QtGui.QApplication.UnicodeUTF8)) - self.check_fly_to_buy_7.setText(QtGui.QApplication.translate("dialog", "Max Displacement X", None, QtGui.QApplication.UnicodeUTF8)) - self.check_fly_to_buy_4.setText(QtGui.QApplication.translate("dialog", "Min Displacement X", None, QtGui.QApplication.UnicodeUTF8)) - self.check_fly_to_buy_8.setText(QtGui.QApplication.translate("dialog", "Max Displacement Y", None, QtGui.QApplication.UnicodeUTF8)) - self.check_fly_to_buy_2.setText(QtGui.QApplication.translate("dialog", "Min Displacement Y", None, QtGui.QApplication.UnicodeUTF8)) - self.check_fly_to_buy_5.setText(QtGui.QApplication.translate("dialog", "Max Displacement Z", None, QtGui.QApplication.UnicodeUTF8)) - self.check_fly_to_buy_3.setText(QtGui.QApplication.translate("dialog", "Min Displacement Z", None, QtGui.QApplication.UnicodeUTF8)) self.button_select_results_folder.setText(QtGui.QApplication.translate("dialog", "Select Results Folder", None, QtGui.QApplication.UnicodeUTF8)) self.button_start_postprocessing.setText(QtGui.QApplication.translate("dialog", "Start Postprocessing", None, QtGui.QApplication.UnicodeUTF8)) + self.groupBox_2.setTitle(QtGui.QApplication.translate("dialog", "Select Z-Axis", None, QtGui.QApplication.UnicodeUTF8)) + self.check_abs_disp_x.setText(QtGui.QApplication.translate("dialog", "Absolute Displacement X", None, QtGui.QApplication.UnicodeUTF8)) + self.check_abs_disp_y.setText(QtGui.QApplication.translate("dialog", "Absolute Displacement Y", None, QtGui.QApplication.UnicodeUTF8)) + self.check_abs_disp_z.setText(QtGui.QApplication.translate("dialog", "Absolute Displacement Z", None, QtGui.QApplication.UnicodeUTF8)) + self.groupBox_3.setTitle(QtGui.QApplication.translate("dialog", "Select Y-Axis", None, QtGui.QApplication.UnicodeUTF8)) + self.check_rot_x.setText(QtGui.QApplication.translate("dialog", "Rotation around X-Axis", None, QtGui.QApplication.UnicodeUTF8)) + self.check_rot_y.setText(QtGui.QApplication.translate("dialog", "Rotation around Y-Axis", None, QtGui.QApplication.UnicodeUTF8)) + self.check_rot_z.setText(QtGui.QApplication.translate("dialog", "Rotation around Z-Axis", None, QtGui.QApplication.UnicodeUTF8)) diff --git a/src/Mod/Machining_Distortion/postprocess.ui b/src/Mod/Machining_Distortion/postprocess.ui index f4d23a1175..fdd46ed199 100755 --- a/src/Mod/Machining_Distortion/postprocess.ui +++ b/src/Mod/Machining_Distortion/postprocess.ui @@ -6,8 +6,8 @@ 0 0 - 380 - 170 + 425 + 240 @@ -26,164 +26,7 @@ Machining Distortion Prediction - - - - Output Elements - - - - - - - 148 - 18 - - - - Max Displacement X - - - false - - - - - - - - 148 - 18 - - - - Min Displacement X - - - false - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 148 - 18 - - - - Max Displacement Y - - - false - - - - - - - - 148 - 18 - - - - Min Displacement Y - - - false - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 148 - 18 - - - - Max Displacement Z - - - false - - - - - - - - 148 - 18 - - - - Min Displacement Z - - - false - - - - - - - + Qt::Vertical @@ -193,14 +36,14 @@ - + Select Results Folder - + false @@ -216,6 +59,118 @@ + + + + Select Z-Axis + + + + + + Absolute Displacement X + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Absolute Displacement Y + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Absolute Displacement Z + + + + + + + + + + Select Y-Axis + + + + + + Rotation around X-Axis + + + + + + + Qt::Vertical + + + + 20 + 33 + + + + + + + + Rotation around Y-Axis + + + + + + + Qt::Vertical + + + + 20 + 34 + + + + + + + + Rotation around Z-Axis + + + + + + diff --git a/src/Mod/Machining_Distortion/postprocess_gui.py b/src/Mod/Machining_Distortion/postprocess_gui.py index 4ad1cfbcef..cf5d3ef198 100755 --- a/src/Mod/Machining_Distortion/postprocess_gui.py +++ b/src/Mod/Machining_Distortion/postprocess_gui.py @@ -42,7 +42,7 @@ class MyForm(QtGui.QDialog,Ui_dialog): ltc_coeff = [] sigini = True for root, dirs, files in os.walk(str(self.dirname)): - if 'geometry_fe_input.frd' in files: + if 'final_fe_input.frd' in files: bbox_orig,\ bbox_distorted,\ relationship,\ @@ -51,7 +51,7 @@ class MyForm(QtGui.QDialog,Ui_dialog): max_disp_y,\ min_disp_y,\ max_disp_z,\ - min_disp_z = calculix_postprocess(os.path.join(root,'geometry_fe_input.frd')) + min_disp_z = calculix_postprocess(os.path.join(root,'final_fe_input.frd')) if sigini: sigini = False lc_coeff,ltc_coeff = get_sigini_values(os.path.join(root,'sigini_input.txt')) @@ -102,35 +102,86 @@ class MyForm(QtGui.QDialog,Ui_dialog): def start_gnu_plot(self,list,lc_coeff,ltc_coeff): + filename = "graph" + title = "Absolut Displacement in " + x_axis_label ="" + y_axis_label="" + z_axis_label="" + #define all the different variations that could occur and assign proper variable names + if self.check_abs_disp_x.isChecked(): + filename = filename + "_max_disp_x" + title = title + "X vs. " + z_axis_label = "Abs Displacement in X-Direction" + abs_disp_column = 12 + if self.check_abs_disp_y.isChecked(): + filename = filename + "_max_disp_y" + title = title + "Y vs. " + z_axis_label = "Abs Displacement in Y-Direction" + abs_disp_column = 13 + if self.check_abs_disp_z.isChecked(): + filename = filename + "_max_disp_z" + title = title + "Z vs. " + z_axis_label = "Abs Displacement in Z-Direction" + abs_disp_column = 14 + + #The Z-Level Offset is fix and therefore the corresponding variables are predefined: + filename = filename + "_offset_z" + title = title + "Z-Level Offset " + x_axis_label = "Z-Offset" + offset_column = 1 + + if self.check_rot_x.isChecked(): + filename = filename + "_rotation_x" + title = title + "and Rotation around X-Axis" + y_axis_label = "Rotation around X-Axis" + rot_column = 2 + if self.check_rot_y.isChecked(): + filename = filename + "_rotation_y" + title = title + "and Rotation around Y-Axis" + y_axis_label = "Rotation around Y-Axis" + rot_column = 3 + if self.check_rot_z.isChecked(): + filename = filename + "_rotation_z" + title = title + "and Rotation around Z-Axis" + y_axis_label = "Rotation around Z-Axis" + rot_column = 4 + + + gnu_plot_input_file = open(str(self.dirname + "/gnu_plot_input.txt"),"wb") gnu_plot_input_file.write( "set term png\n" + - "set output \"max_disp_z.png\"\n"+ + "set output \"" + filename + ".png\"\n"+ "set surface\n" + "set grid\n"+ "set hidden3d\n"+ "set dgrid3d " + str(len(list)-1) + "," + str(len(list)-1) + ",100\n" + "set view 80,05,1.3,1.0\n"+ - "set title \"Abs Displacement in Z vs. Z-Level Offset and Rotation around Z-Axis\" 0,-2\n"+ + "set title \"" + title + "\" offset 0,-2\n"+ "show title\n"+ - "set pm3d\n"+ - "set label \"L Coefficients used for the calculation:" + lc_coeff[0] + "," + lc_coeff[1] + "," + lc_coeff[2] + "," + lc_coeff[3] + "," + lc_coeff[4] + "," + lc_coeff[5][:-1] + "\" at screen 0.1, screen 0.95 left\n"+ - "set label \"LT Coefficients used for the calculation:" + ltc_coeff[0] + "," + ltc_coeff[1] + "," + ltc_coeff[2] + "," + ltc_coeff[3] + "," + ltc_coeff[4] + "," + ltc_coeff[5][:-1] + "\" at screen 0.1, screen 0.93 left\n"+ - "set label \"Z-Offset\\nin [mm]\" at screen 0.5, screen 0.1 center rotate by 0\n"+ - "set label \"Rotation around Z-Axis\\nin [" + str(chr(248)) +"]\" at screen 0.91, screen 0.2 center rotate by 50\n"+ - "set label \"Max Displacement Z direction\\nin [mm]\" at screen 0.03, screen 0.5 center rotate by 90\n"+ - "set xtics nomirror\n"+ - "splot \"postprocessing_input.txt\" u 1:4:14 with pm3d title \"\"\n" + + "set label \"Fly to Buy Ratio = " + str( + "set label \"L Coefficients used for the calculation:" + lc_coeff[0] + "," + lc_coeff[1] + "," + lc_coeff[2] + "," + lc_coeff[3] + "," + lc_coeff[4] + "," + lc_coeff[5][:-1] + "\" at screen 0.1, screen 0.95 left font \"Arial,8\"\n"+ + "set label \"LT Coefficients used for the calculation:" + ltc_coeff[0] + "," + ltc_coeff[1] + "," + ltc_coeff[2] + "," + ltc_coeff[3] + "," + ltc_coeff[4] + "," + ltc_coeff[5][:-1] + "\" at screen 0.1, screen 0.93 left font \"Arial,8\"\n"+ + "set label \"" + x_axis_label + "\\nin [mm]\" at screen 0.5, screen 0.1 center rotate by 0\n"+ + "set label \"" + y_axis_label +"\\nin [" + str(chr(248)) +"]\" at screen 0.91, screen 0.2 center rotate by 50\n"+ + "set label \"" + z_axis_label + "\\nin [mm]\" at screen 0.03, screen 0.5 center rotate by 90\n"+ + "set xtics in nomirror offset character 0,-0.5\n"+ + "splot \"postprocessing_input.txt\" u " + str(offset_column) + ":" + str(rot_column) + ":" + str(abs_disp_column) + " with pm3d title \"\"\n" + "exit" ) - - - + gnu_plot_input_file.close() os.chdir(str(self.dirname)) fnull = open(os.devnull, 'w') - commandline = "gnuplot gnu_plot_input.txt" + commandline = FreeCAD.getHomePath() + "gnuplot gnu_plot_input.txt" result = subprocess.call(commandline, shell = True, stdout = fnull, stderr = fnull) fnull.close() - + self.button_start_postprocessing.setEnabled(False) + #Reset all radio buttons + self.check_rot_x.setChecked(False) + self.check_rot_y.setChecked(False) + self.check_rot_z.setChecked(False) + self.check_abs_disp_x.setChecked(False) + self.check_abs_disp_y.setChecked(False) + self.check_abs_disp_z.setChecked(False)