-# Copyright (C) 2014-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2014-2023 CEA, EDF
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
-# File: TestAPI_Symmetry.py
-# Created: 15 Nov 2016
-# Author: Clarisse Genrault (CEA)
from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
from GeomAPI import GeomAPI_Pnt as pnt
from GeomAPI import GeomAPI_Dir as direction
from GeomAPI import GeomAPI_Ax1 as axis
from GeomAPI import GeomAPI_Ax2 as plane
+from GeomAPI import GeomAPI_Shape as shape
# Create boxes
Box_1 = shaperpy.makeBox(10., 10., 10.)
Symmetry_2 = shaperpy.makeSymmetry(Box_2, pnt1)
try :
- Symmetry_6 = shaperpy.makeSymmetry(Box_2, None)
-except myExcept,ec :
+ Symmetry_3 = shaperpy.makeSymmetry(Box_3, None)
+except myExcept as ec :
assert(ec.what() == "Symmetry builder :: point is not valid.")
-Symmetry_7 = shaperpy.makeSymmetry(Box_7, axZ)
-Symmetry_8 = shaperpy.makeSymmetry(Box_8, ax1)
-Symmetry_13 = shaperpy.makeSymmetry(Box_13, planeXOY)
+Symmetry_4 = shaperpy.makeSymmetry(Box_4, axZ)
+Symmetry_5 = shaperpy.makeSymmetry(Box_5, ax1)
+Symmetry_6 = shaperpy.makeSymmetry(Box_6, planeXOY)
+
+try :
+ Symmetry_7 = shaperpy.makeSymmetry(None, pnt1)
+except myExcept as ec :
+ assert(ec.what() == "Transformation :: incorrect input data.")
+
+try :
+ Symmetry_8 = shaperpy.makeSymmetry(None, axZ)
+except myExcept as ec :
+ assert(ec.what() == "Transformation :: incorrect input data.")
+
+try :
+ Symmetry_9 = shaperpy.makeSymmetry(None, planeXOY)
+except myExcept as ec :
+ assert(ec.what() == "Transformation :: incorrect input data.")
+
+try :
+ Symmetry_10 = shaperpy.makeSymmetry(shape(), pnt1)
+except myExcept as ec :
+ assert(ec.what() == "Transformation :: source shape does not contain any actual shape.")