1 ## Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 ## This library is free software; you can redistribute it and/or
4 ## modify it under the terms of the GNU Lesser General Public
5 ## License as published by the Free Software Foundation; either
6 ## version 2.1 of the License, or (at your option) any later version.
8 ## This library is distributed in the hope that it will be useful,
9 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 ## Lesser General Public License for more details.
13 ## You should have received a copy of the GNU Lesser General Public
14 ## License along with this library; if not, write to the Free Software
15 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 ## See http:##www.salome-platform.org/ or
18 ## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
22 from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
23 from GeomAPI import GeomAPI_Pnt as pnt
26 Box_1 = shaperpy.makeBox(10.,10.,10.)
27 Box_2 = shaperpy.makeBox(10.,10.,10.)
28 Box_3 = shaperpy.makeBox(10.,10.,10.)
29 Box_4 = shaperpy.makeBox(10.,10.,10.)
30 Box_5 = shaperpy.makeBox(10.,10.,10.)
31 Box_6 = shaperpy.makeBox(10.,10.,10.)
32 Box_7 = shaperpy.makeBox(10.,10.,10.)
33 Box_8 = shaperpy.makeBox(10.,10.,10.)
34 Box_9 = shaperpy.makeBox(10.,10.,10.)
35 Box_10 = shaperpy.makeBox(10.,10.,10.)
36 Box_11 = shaperpy.makeBox(10.,10.,10.)
37 Box_12 = shaperpy.makeBox(10.,10.,10.)
40 pntOrigin = pnt(0., 0., 0.)
41 pnt1 = pnt(-10., -10., -10.)
45 Scale_1 = shaperpy.makeScale(Box_1, pntOrigin, 2.)
46 Scale_2 = shaperpy.makeScale(Box_2, pnt1, 2.)
48 Scale_6 = shaperpy.makeScale(Box_3, pntOrigin, 0)
50 assert(ec.what() == "Scale builder :: the scale factor is null.")
52 Scale_7 = shaperpy.makeScale(Box_4, pntOrigin, -3.)
55 Scale_8 = shaperpy.makeScale(Box_5, None, 2.)
57 assert(ec.what() == "Scale builder :: center point is not valid.")
59 Scale_9 = shaperpy.makeScale(Box_6, pntOrigin, 2., 3., 1.)
60 Scale_10 = shaperpy.makeScale(Box_7, pnt1, 2., 3., 1.)
63 Scale_14 = shaperpy.makeScale(Box_8, pntOrigin, 0., 3., 1.)
65 assert(ec.what() == "Scale builder :: the scale factor in X is null.")
67 Scale_15 = shaperpy.makeScale(Box_9, pntOrigin, 2., 0., 1.)
69 assert(ec.what() == "Scale builder :: the scale factor in Y is null.")
71 Scale_16 = shaperpy.makeScale(Box_10, pntOrigin, 2., 3., 0.)
73 assert(ec.what() == "Scale builder :: the scale factor in Z is null.")
75 Scale_17 = shaperpy.makeScale(Box_11, pntOrigin, -2., -3., 0.5)
78 Scale_18 = shaperpy.makeScale(Box_12, None, 2., 3., 1.)
80 assert(ec.what() == "Scale builder :: center point is not valid.")