Salome HOME
- Modifing Geometry and Mesh Python scripts from SALOME 6 and before
[modules/smesh.git] / src / StdMeshers / StdMeshers_ViscousLayers.cxx
index 277c6e76c1c222d140d79421571f8afada749433..6a6d871c43d65d25128c00a3f466aa903662e998 100644 (file)
@@ -801,10 +801,10 @@ namespace
         double u1 = intervals( i );
         double u2 = intervals( i+1 );
         curve.D2( 0.5*( u1+u2 ), p, drv1, drv2 );
-        double cross = drv2 ^ drv1;
+        double cross = drv2 * drv1; //drv2 ^ drv1;
         if ( E.Orientation() == TopAbs_REVERSED )
           cross = -cross;
-        isConvex = ( cross 1e-9 );
+        isConvex = ( cross > -1e-9 );
       }
       // check if concavity is strong enough to care about it
       //const double maxAngle = 5 * Standard_PI180;
@@ -865,9 +865,11 @@ namespace
       const char* fname = "/tmp/viscous.py";
       cout << "execfile('"<<fname<<"')"<<endl;
       py = new ofstream(fname);
-      *py << "from smesh import *" << endl
-          << "meshSO = GetCurrentStudy().FindObjectID('0:1:2:3')" << endl
-          << "mesh = Mesh( meshSO.GetObject() )"<<endl;
+      *py << "import SMESH" << endl
+          << "from salome.smesh import smeshBuilder" << endl
+          << "smesh = smeshBuilder.New(salome.myStudy)" << endl
+          << "meshSO = smesh.GetCurrentStudy().FindObjectID('0:1:2:3')" << endl
+          << "mesh = smesh.Mesh( meshSO.GetObject() )"<<endl;
     }
     void Finish() {
       if (py)