Salome HOME
22860: EDF 9944 SMESH: Regression when scaling a mesh
[modules/smesh.git] / src / SMESH_I / SMESH_MeshEditor_i.cxx
index 39a9d25d6b2de158a2fd6682eaf690686e85b0e6..73b1c7d56d632e63b3f69645ef664e3358b53d80 100644 (file)
@@ -3126,7 +3126,7 @@ SMESH_MeshEditor_i::ExtrusionByNormal(SMESH::SMESH_IDSource_ptr object,
                 << ", " << dim
                 << " )";
   }
-  return aGroups;
+  return aGroups ? aGroups : new SMESH::ListOfGroups;
 }
 
 //=======================================================================
@@ -4842,9 +4842,16 @@ SMESH_MeshEditor_i::scale(SMESH::SMESH_IDSource_ptr  theObject,
   gp_Trsf aTrsf;
 
 #if OCC_VERSION_LARGE > 0x06070100
-  aTrsf.SetValues( S[0], 0,    0,    thePoint.x * (1-S[0]),
-                   0,    S[1], 0,    thePoint.y * (1-S[1]),
-                   0,    0,    S[2], thePoint.z * (1-S[2]) );
+  // fight against ortagonalization
+  // aTrsf.SetValues( S[0], 0,    0,    thePoint.x * (1-S[0]),
+  //                  0,    S[1], 0,    thePoint.y * (1-S[1]),
+  //                  0,    0,    S[2], thePoint.z * (1-S[2]) );
+  aTrsf.SetTranslation( gp_Vec( thePoint.x * (1-S[0]),
+                                thePoint.y * (1-S[1]),
+                                thePoint.z * (1-S[2])));
+  gp_Mat & M = ( gp_Mat& ) aTrsf.HVectorialPart();
+  M.SetDiagonal( S[0], S[1], S[2] );
+
 #else
   aTrsf.SetValues( S[0], 0,    0,    thePoint.x * (1-S[0]),
                    0,    S[1], 0,    thePoint.y * (1-S[1]),