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_Ax1 as axis, GeomAPI_Pnt as pnt, GeomAPI_Dir as direction
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.)
36 pntOrigin = pnt(0.,0.,0.)
38 pnt2 = pnt(10.,10.,0.)
41 xDir = direction(10., 0., 0.)
42 ax1 = axis(pntOrigin, xDir)
44 yDir = direction(0., 10., 0.)
45 ax2 = axis(pntOrigin, yDir)
48 # Create MultiTranslations
49 MultiTranslation_1 = shaperpy.makeMultiTranslation(Box_1, ax1, 15., 5)
50 MultiTranslation_2 = shaperpy.makeMultiTranslation(Box_2, ax1, -15., 5)
53 MultiTranslation_3 = shaperpy.makeMultiTranslation(Box_3, ax1, 15., -2)
55 assert(ec.what() == "Multitranslation builder :: the number of copies for the first direction is null or negative.")
57 MultiTranslation_5 = shaperpy.makeMultiTranslation(Box_5, ax1, 10., 5, ax2, 10., 5)
58 MultiTranslation_6 = shaperpy.makeMultiTranslation(Box_6, ax1, 15., 5, ax2, -10., 5)
62 # MultiTranslation_4 = shaperpy.makeMultiTranslation(Box_4, None, 15., 2)
64 # assert(ec.what() == "Multitranslation builder :: the first axis is not valid.")
66 # Pas d'exception levee alors qu'une devrait y en avoir une
68 MultiTranslation_7 = shaperpy.makeMultiTranslation(Box_7, ax1, 15., 5, ax2, 10., -2)
70 assert(ec.what() == "Multitranslation builder :: the number of copies for the second direction is null or negative.")
73 # MultiTranslation_8 = shaperpy.makeMultiTranslation(Box_8, ax1, 15., 5, None, 10., 5)
75 # assert(ec.what() == "Multitranslation builder :: the second axis is not valid.")