Salome HOME
Updated copyright comment
[modules/shaper.git] / src / FeaturesPlugin / Test / TestBooleanFuse_SolidsHistory.py
index b966d42df21ec8cbb7ffe5b6d7ca218e2a00a503..603ed53dc0ad78c7c67ebca4d29e2e857b7c2dac 100644 (file)
@@ -1,24 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
-
-# -*- coding: utf-8 -*-
+# Copyright (C) 2014-2024  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
+#
 
 from salome.shaper import model
 from ModelAPI import *
@@ -51,11 +48,11 @@ SketchCircle_2 = Sketch_2.addCircle(-5.846059113300496, 9.453201970443347, 11.01
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Sketch_1")], model.selection(), 10, 0)
 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection(), 11, 1)
-Group_1_objects = [model.selection("SOLID", "Extrusion_1_2_1"), model.selection("SOLID", "Extrusion_1_2_2"), model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_1_1")]
+Group_1_objects = [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_1_2")]
 Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
-Group_2_objects = [model.selection("FACE", "Extrusion_1_2_1/To_Face"), model.selection("FACE", "Extrusion_1_2_2/To_Face"), model.selection("FACE", "Extrusion_2_1/To_Face"), model.selection("FACE", "Extrusion_1_1/To_Face")]
+Group_2_objects = [model.selection("FACE", "Extrusion_1_1_1/To_Face"), model.selection("FACE", "Extrusion_1_1_2/To_Face"), model.selection("FACE", "Extrusion_2_1/To_Face"), model.selection("FACE", "Extrusion_1_2/To_Face")]
 Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
-Fuse_1_objects_1 = [model.selection("SOLID", "Extrusion_1_2_2"), model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_1_1")]
+Fuse_1_objects_1 = [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_1_2")]
 Fuse_1 = model.addFuse(Part_1_doc, Fuse_1_objects_1)
 model.do()
 # move group
@@ -63,12 +60,12 @@ Part_1_doc.moveFeature(Group_1.feature(), Fuse_1.feature())
 Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
 model.end()
 
-# Check group 1: 3 solids
+# All solids are merged to one - result
 aFactory = ModelAPI_Session.get().validators()
 selectionList = Group_1.feature().selectionList("group_list")
-assert(selectionList.size() == 3)
+assert(selectionList.size() == 1)
 assert(aFactory.validate(Group_1.feature()))
-for i in range(3):
+for i in range(1):
   assert(Group_1.groupList().value(i).value().shapeType() == GeomAPI_Shape.SOLID)
 
 # Check group 2: 3 faces