X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=doc%2Fsalome%2Fgui%2FGEOM%2Fmeasurement_tools.htm;h=c3dd6ab37a469aa7319526821bc48c883a506350;hb=c6a0df686bae87821d7acf929b4bb8f4ae3b1d78;hp=d06d968fdfb844f2c6d46f1676cc6cb83ea4f888;hpb=3e9d56c09b4bb1f34cf25c95613ef7e12890a8cd;p=modules%2Fgeom.git diff --git a/doc/salome/gui/GEOM/measurement_tools.htm b/doc/salome/gui/GEOM/measurement_tools.htm index d06d968fd..c3dd6ab37 100755 --- a/doc/salome/gui/GEOM/measurement_tools.htm +++ b/doc/salome/gui/GEOM/measurement_tools.htm @@ -34,73 +34,98 @@ onerror = null; - -
+ +import math
+import geompy
-+
-
# create a point
+# create a point
-point = geompy.MakeVertex(15, - 23, 80)
+point = geompy.MakeVertex(15., + 23., 80.)
-+
-
# get point's coordinates and check its values
+# get the coordinates + of the point and check its values
coords = geompy.PointCoordinates(point)
-if coords[0] != 15 - or coords[1] != 23 or coords[2] != 80 :
++ +
# check the obtained + coordinate values
+ +tolerance = 1.e-07
+ +def IsEqual(val1, + val2): return (math.fabs(val1 - val2) < tolerance)
+ ++ +
if IsEqual(coords[0], + 15.) and IsEqual(coords[1], 23.) and IsEqual(coords[2], 80.):
print - "Coordinates of point must be (15, 23, 80), but returned (", - coords[0], ", ", coords[1], ", ", coords[2], ")"
+ "All values are OK."else :
-print - "All values are OK."
+print + "Coordinates of point must be (15, 23, 80), but returned (",
+ +print + coords[0], ", ", coords[1], ", ", coords[2], ")"
+ +pass +
-
Point Coordinates
- -- -
- -
import - geompy
- -# create a point
- -point = geompy.MakeVertex(15, - 23, 80)
- -# get point's coordinates - and check its values
- -coords = geompy.PointCoordinates(point)
- -if coords[0] != 15 - or coords[1] != 23 or coords[2] != 80 :
- -print - "Coordinates of point must be (15, 23, 80), but returned (", - coords[0], ", ", coords[1], ", ", coords[2], ")"
- -else :
- -print - "All values are OK."
- --
import
@@ -417,14 +409,15 @@ else
# make compound # make a compound compound = geompy.MakeCompound([box1,
box2]) # glue compound's faces # glue the faces of the
+ compound tolerance = 1e-5