Salome HOME
Updating Primitive Box.
[modules/shaper.git] / src / GeomAlgoAPI / Test / TestAPI_Box.py
1 # Copyright (C) 2014-2016 CEA/DEN, EDF R&D
2
3 # File:        TestAPI_Box.py
4 # Created:     16 Sept 2016
5 # Author:      Clarisse Genrault (CEA)
6
7 from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
8 from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
9 from GeomAPI import GeomAPI_Pnt as pnt
10
11 # Create a box with dimensions    
12 try :    
13   box1 = shaperpy.makeBox(5.,15.,5.)
14   
15 except myExcept,ec:
16   print ec.what()
17
18 # Create a box with two points defining the diagonal   
19 try :    
20   pnt1 = pnt(0.,0.,0.)
21   pnt2 = pnt(10.,10.,10.)
22   box2 = shaperpy.makeBox(pnt1,pnt2)
23   
24 except myExcept,ec:
25   print ec.what()
26   
27 # Create a box with null dimensions
28 try :    
29   box3 = shaperpy.makeBox(0.,0.,0.)
30   
31 except myExcept,ec:
32   print ec.what()
33   
34 # Create a box with negative dimensions
35 try :    
36   box4 = shaperpy.makeBox(-5.,15.,5.)
37   
38 except myExcept,ec:
39   print ec.what()
40   
41 # Create a box with two same points   
42 try :    
43   pnt1 = pnt(0.,0.,0.)
44   box5 = shaperpy.makeBox(pnt1,pnt1)
45   
46 except myExcept,ec:
47   print ec.what()