Salome HOME
Switch to SSL mode for tests : naive approach
[modules/geom.git] / doc / salome / examples / point_coordinates.py
index 08f3ed133731dca46885a49f71d7d73c1ec91792..65a5ab61acb7118cfbfe5b5c33beed57c4533974 100644 (file)
@@ -1,8 +1,7 @@
 # Point Coordinates
 
-import math
 import salome
-salome.salome_init()
+salome.salome_init_without_session()
 import GEOM
 from salome.geom import geomBuilder
 geompy = geomBuilder.New()
@@ -14,8 +13,9 @@ point = geompy.MakeVertex(15., 23., 80.)
 coords = geompy.PointCoordinates(point)
 
 # check the obtained coordinate values
-tolerance = 1.e-07
-def IsEqual(val1, val2): return (math.fabs(val1 - val2) < tolerance)
+def IsEqual(val1, val2, tolerance = 1.e-07):
+    import math
+    return (math.fabs(val1 - val2) < tolerance)
 
 if IsEqual(coords[0], 15.) and IsEqual(coords[1], 23.) and IsEqual(coords[2], 80.):
     print("All values are OK.")