Salome HOME
Mantis issue 0021565: [CEA 557] Opposite of the pipe
[modules/geom.git] / src / GEOM_SWIG / GEOM_TestAll.py
index 3e7c14dc2c409c7b0ba9637b87c1d3c3390e90b4..3b9381772df54fc75afcf7f3ed3f0b13814c9c5c 100644 (file)
@@ -19,7 +19,6 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
 
 #  GEOM GEOM_SWIG : binding of C++ omplementaion with Python
 #  File   : GEOM_usinggeom.py
@@ -105,8 +104,22 @@ def TestAll (geompy, math):
   Interpol = geompy.MakeInterpol([px, py, p200, pxyz], True) #(List of GEOM_Object,Boolean)->GEOM_Object
   Sketcher = geompy.MakeSketcher("Sketcher:F -100 -100:TT 250 -100:R 0:C 100 150:R 0:L 300:WW",
                                  [100,0,0, 1,1,1, -1,1,0]) #(String, List of Doubles)->GEOM_Object
-  Sketcher3d = geompy.Make3DSketcher([0,0,0, 50,50,50, 0,50,50, 10,0,0])
-  
+
+  #Create 3D wires with 3D Sketcher
+  sk = geompy.Sketcher3D()
+  sk.addPointsAbsolute(0,0,0, 70,0,0)
+  sk.addPointsRelative(0, 0, 130)
+  sk.addPointRadiusAnglesRelative(100, 50, 0,"OXY")
+  sk.addPointRadiusAnglesRelative(130, 30, 80, "OXZ")
+  sk.addPointRadiusAnglesAbsolute(500, 60, 30,"OXY")
+  sk.addPointRadiusAngleHRelative(100, 50, 0,"OXY")
+  sk.addPointRadiusAngleHRelative(130, 30, 40, "OXZ")
+  sk.addPointRadiusAngleHAbsolute(800, 60, 30,"OXY")
+  sk.close()
+  Sketcher3d_1 = sk.wire()
+
+  Sketcher3d_2 = geompy.Make3DSketcher([0,0,0, 50,50,50, 0,50,50, 10,0,0])
+
   #Create local coordinate system from shape
   cs4 = geompy.MakeMarkerFromShape(Plane)
 
@@ -183,6 +196,7 @@ def TestAll (geompy, math):
   #Test point on surface creation
   p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8) #(GEOM_Object, Double, Double)->GEOM_Object
   p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.) #(GEOM_Object, Double, Double, Double)->GEOM_Object
+  p_on_face3 = geompy.MakeVertexInsideFace(Face) #(GEOM_Object)->GEOM_Object
 
   # Test plane from existing face creation
   Plane2 = geompy.MakePlaneFace(Face, trimsize)      #(GEOM_Object, Double)->GEOM_Object
@@ -194,7 +208,7 @@ def TestAll (geompy, math):
   Line3 = geompy.MakeLineTwoFaces(prism1_faces[0], prism1_faces[1]) #(2 GEOM_Object)->GEOM_Object
 
   #Create advanced objects
-  Copy       = geompy.MakeCopy(Box)                      #(GEOM_Object)->GEOM_Object
+  Copy             = geompy.MakeCopy(Box)                      #(GEOM_Object)->GEOM_Object
   Prism            = geompy.MakePrismVecH(Face, vz, 100.0)     #(2 GEOM_Object, Double)->GEOM_Object
   Prism2Ways       = geompy.MakePrismVecH2Ways(Face, vz, 10.0) #(2 GEOM_Object, Double)->GEOM_Object
   PrismTwoPnt      = geompy.MakePrism(Face2, p0, pxyz)         #(3 GEOM_Object)->GEOM_Object
@@ -204,9 +218,9 @@ def TestAll (geompy, math):
   Revolution       = geompy.MakeRevolution(Face, vz, angle2)   #
   Revolution2Ways  = geompy.MakeRevolution(Face, vz, angle1)   #
   Filling          = geompy.MakeFilling(Compound, mindeg, maxdeg,
-                                  tol2d, tol3d, nbiter)  #(GEOM_Object, 4 Doubles, Short)->GEOM_Object
-  Pipe       = geompy.MakePipe(Wire, Edge)               #(2 GEOM_Object)->GEOM_Object
-  Sewing     = geompy.MakeSewing([Face, S], precision)   #(List Of GEOM_Object, Double)->GEOM_Object
+                                        tol2d, tol3d, nbiter)  #(GEOM_Object, 4 Doubles, Short)->GEOM_Object
+  Pipe             = geompy.MakePipe(Wire, Edge)               #(2 GEOM_Object)->GEOM_Object
+  Sewing           = geompy.MakeSewing([Face, S], precision)   #(List Of GEOM_Object, Double)->GEOM_Object
 
   #Transform objects
   Translation = geompy.MakeTranslationTwoPoints(Box, px, pz)    #(3 GEOM_Object)->GEOM_Object
@@ -330,7 +344,9 @@ def TestAll (geompy, math):
   id_Bezier   = geompy.addToStudy(Bezier,   "Bezier")
   id_Interpol = geompy.addToStudy(Interpol, "Interpol")
   id_Sketcher = geompy.addToStudy(Sketcher, "Sketcher")
-  id_Sketcher3d = geompy.addToStudy(Sketcher3d, "Sketcher 3D")
+
+  id_Sketcher3d_1 = geompy.addToStudy(Sketcher3d_1, "Sketcher 3D by interface")
+  id_Sketcher3d_2 = geompy.addToStudy(Sketcher3d_2, "Sketcher 3D by list")
 
   id_p_on_arc  = geompy.addToStudy(p_on_arc,  "Vertex on Arc (0.25)")
   id_p_on_arc2 = geompy.addToStudy(p_on_arc2, "Vertex on Arc at(100, -10, 10)" )
@@ -374,6 +390,7 @@ def TestAll (geompy, math):
 
   id_p_on_face = geompy.addToStudy(p_on_face, "Vertex on Face (0.1, 0.8)")
   id_p_on_face2 = geompy.addToStudy(p_on_face2, "Vertex on Face at(0., 0., 0.)")
+  id_p_on_face3 = geompy.addToStudy(p_on_face3, "Vertex inside Face")
 
   id_Prism1   = geompy.addToStudy(Prism1,     "Prism by Two Pnt")
   id_Shell1   = geompy.addToStudy(Shell1,   "Shell from Prism1 faces")
@@ -395,6 +412,28 @@ def TestAll (geompy, math):
   id_Pipe       = geompy.addToStudy(Pipe,       "Pipe")
   id_Sewing     = geompy.addToStudy(Sewing,     "Sewing")
 
+  import salome_version
+  if int(salome_version.getXVersion(), 16) >= int('0x060600', 16):
+    [Face5, Face6] = geompy.SubShapes(Box, [31, 33])
+    [b1_e1, b1_e2, b1_e3, b1_e4] = geompy.SubShapes(Box, [12, 22, 25, 29])
+    [b2_e1, b2_e2, b2_e3, b2_e4] = geompy.SubShapes(Box, [ 8, 18, 26, 30])
+    Path1 = geompy.RestorePath(Box, Face5, Face6)
+    Path2 = geompy.RestorePathEdges(Box, [b1_e1, b1_e2, b1_e3, b1_e4], [b2_e1, b2_e2, b2_e3, b2_e4])
+
+    id_Base1      = geompy.addToStudyInFather(Box, Face5, "Base1")
+    id_Base2      = geompy.addToStudyInFather(Box, Face6, "Base2")
+    id_Base1e1    = geompy.addToStudyInFather(Box, b1_e1, "Base1 Edge1")
+    id_Base1e2    = geompy.addToStudyInFather(Box, b1_e2, "Base1 Edge2")
+    id_Base1e3    = geompy.addToStudyInFather(Box, b1_e3, "Base1 Edge3")
+    id_Base1e4    = geompy.addToStudyInFather(Box, b1_e4, "Base1 Edge4")
+    id_Base2e1    = geompy.addToStudyInFather(Box, b2_e1, "Base2 Edge1")
+    id_Base2e2    = geompy.addToStudyInFather(Box, b2_e2, "Base2 Edge2")
+    id_Base2e3    = geompy.addToStudyInFather(Box, b2_e3, "Base2 Edge3")
+    id_Base2e4    = geompy.addToStudyInFather(Box, b2_e4, "Base2 Edge4")
+    id_Path1      = geompy.addToStudy(Path1,      "Path1")
+    id_Path2      = geompy.addToStudy(Path2,      "Path2")
+    pass
+
   id_Translation = geompy.addToStudy(Translation, "Translation")
   id_TranslVect  = geompy.addToStudy(TranslVect , "Translation along vector")
   id_TranslVectD = geompy.addToStudy(TranslVectD, "Translation along vector with defined distance")