]> SALOME platform Git repositories - modules/shaper.git/blob - test.API/SHAPER/Transformations/TestAPI_Scale.py
Salome HOME
a6013480732a4a4b23b38ac99db412a7a413bf3e
[modules/shaper.git] / test.API / SHAPER / Transformations / TestAPI_Scale.py
1 # Copyright (C) 2014-201x CEA/DEN, EDF R&D
2
3 # File:        TestAPI_Scale.py
4 # Created:     25 Jan 2017
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
12 try :
13   box1 = shaperpy.makeBox(10.,10.,10.)
14   box2 = shaperpy.makeBox(10.,10.,10.)
15   centerPoint = pnt(20.,20.,0.)
16  
17 except myExcept, ec:
18   print ec.what()
19
20 # Perfom a scale by a factor.
21 try :
22   scale1 = shaperpy.makeScale(box1,centerPoint, -1.6)
23  
24 except myExcept, ec:
25   print ec.what()
26
27 # Perfom a scale by dimensions.
28 try :
29   scale2 = shaperpy.makeScale(box2,centerPoint, 2, -0.5, 1.3)
30  
31 except myExcept, ec:
32   print ec.what()