]> SALOME platform Git repositories - modules/shaper.git/blobdiff - test.API/SHAPER/Primitives/TestAPI_Cylinder.py
Salome HOME
Transfer of tests (Primitives, Transfotmation and GDML).
[modules/shaper.git] / test.API / SHAPER / Primitives / TestAPI_Cylinder.py
diff --git a/test.API/SHAPER/Primitives/TestAPI_Cylinder.py b/test.API/SHAPER/Primitives/TestAPI_Cylinder.py
new file mode 100644 (file)
index 0000000..50a4b87
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright (C) 2014-201x CEA/DEN, EDF R&D
+
+# File:        TestAPI_Cylinder.py
+# Created:     13 Jan 2017
+# Author:      Clarisse Genrault (CEA)
+
+from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
+from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
+from GeomAlgoAPI import GeomAlgoAPI_EdgeBuilder as edgeBuilder
+from GeomAPI import GeomAPI_Pnt as pnt
+
+aPoint = pnt(10.,5.,0.)
+anEdge = edgeBuilder.line(1.,0.,0.)
+
+# Create a cylinder
+try :    
+  cylinder1 = shaperpy.makeCylinder(5., 20.)
+  
+except myExcept,ec:
+  print ec.what()
+
+# Create a cylinder
+try :    
+  cylinder2 = shaperpy.makeCylinder(5., 20., 100.)
+  
+except myExcept,ec:
+  print ec.what()
+  
+# Create a cylinder
+try :
+  cylinder3 = shaperpy.makeCylinder(aPoint, anEdge, 5., 20.)
+  
+except myExcept,ec:
+  print ec.what()
+  
+# Create a cylinder
+try :
+  cylinder4 = shaperpy.makeCylinder(aPoint, anEdge, 5., 20., 180.)
+  
+except myExcept,ec:
+  print ec.what()
\ No newline at end of file