Salome HOME
Implementation of gluing faces by given list (for PAL13191).
[modules/geom.git] / src / GEOM_SWIG / GEOM_TestMeasures.py
index fe10c1dad2ccc636fa6535194fc18792a23dcc26..c18c3064836a642128e01261f8289c65cfe756a3 100644 (file)
@@ -119,3 +119,31 @@ def TestMeasureOperations (geompy, math):
   #print " On Cube (", MinDist[4], ", ", MinDist[5], ", ", MinDist[6], ")"
 
   print "\nMinimal distance between Box and Cube = ", MinDist
+
+  ####### Position (LCS) #######
+
+  Pos = geompy.GetPosition(box)
+  print "\nPosition(LCS) of box 10x30x70:"
+  print "Origin: (", Pos[0], ", ", Pos[1], ", ", Pos[2], ")"
+  print "Z axis: (", Pos[3], ", ", Pos[4], ", ", Pos[5], ")"
+  print "X axis: (", Pos[6], ", ", Pos[7], ", ", Pos[8], ")"
+
+  ####### KindOfShape #######
+
+  Kind = geompy.KindOfShape(box)
+  print "\nKindOfShape(box 10x30x70):", Kind
+  #if Kind[0] != geompy.kind.BOX:
+  #  print "Error: returned type is", Kind[0], "while must be", geompy.kind.BOX
+
+  Kind = geompy.KindOfShape(p137)
+  print "\nKindOfShape(p137):", Kind
+  if Kind[0] != geompy.kind.VERTEX:
+    print "  Error: returned type is", Kind[0], "while must be", geompy.kind.VERTEX
+  else:
+    dx = math.fabs(Kind[1] - 10)
+    dy = math.fabs(Kind[2] - 30)
+    dz = math.fabs(Kind[3] - 70)
+    if (dx + dy + dz) > 1e-5:
+      print "  Error: coordinates are (", Kind[1], ",", Kind[2], ",", Kind[3], ") while must be (10, 20, 30)"
+
+  pass