Salome HOME
updated copyright message
[modules/shaper.git] / src / ModelAPI / Test / Test1512.py
old mode 100755 (executable)
new mode 100644 (file)
index 9afa65d..6fabe5d
@@ -1,22 +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>
-##
+# 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
+#
 
 """
       Test1512.py
@@ -104,10 +103,9 @@ aSession.finishOperation()
 # Do cut a hole from a box
 #=========================================================================
 aSession.startOperation()
-aCut1 = aPart.addFeature("Boolean")
+aCut1 = aPart.addFeature("Cut")
 aCut1.selectionList("main_objects").append(aBox.firstResult(), None)
 aCut1.selectionList("tool_objects").append(aHoleExt.firstResult(), None)
-aCut1.integer("bool_type").setValue(0) # cut
 aSession.finishOperation()
 
 #=========================================================================
@@ -136,10 +134,11 @@ aSession.finishOperation()
 # Do fuse with a tower. Tower must be an argument (not tool) to add the problem to the faces owners detection.
 #=========================================================================
 aSession.startOperation()
-aFuse = aPart.addFeature("Boolean")
+aFuse = aPart.addFeature("Fuse")
+aFuse.string("creation_method").setValue("advanced")
 aFuse.selectionList("main_objects").append(aTower.firstResult(), None)
 aFuse.selectionList("tool_objects").append(aCut1.firstResult(), None)
-aFuse.integer("bool_type").setValue(1) # fuse
+aFuse.boolean("remove_intersection_edges").setValue(False)
 aSession.finishOperation()
 
 #=========================================================================
@@ -155,13 +154,13 @@ def check_owner(selection, topology_type, feature):
   aSession.abortOperation()
 
 # check faces
-check_owner("Extrusion_1_1/Generated_Face_1", "face", aBox)
-check_owner("Boolean_2_1/Modified_Face_3", "face", aBox)
-check_owner("Boolean_1_1/Modified_Face_1", "face", aHoleExt)
-check_owner("Boolean_2_1/Modified_Face_1", "face", aTower)
+check_owner("Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4", "face", aBox)
+check_owner("Fuse_1_1/Modified_Face&Extrusion_1_1/To_Face", "face", aBox)
+check_owner("Cut_1_1/Modified_Face&Sketch_2/SketchCircle_1_2", "face", aHoleExt)
+check_owner("Fuse_1_1/Modified_Face&Sketch_3/SketchCircle_2_2", "face", aTower)
 # check edges without ambiguity
-check_owner("Boolean_2_1/Modified_Face_2&Extrusion_1_1/Generated_Face_2", "edge", aBox)
-check_owner("Boolean_2_1/Modified_Face_1&Extrusion_3_1/To_Face_1_1", "edge", aTower)
+check_owner("[Fuse_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3]", "edge", aBox)
+check_owner("[Fuse_1_1/Modified_Face&Sketch_3/SketchCircle_2_2][Extrusion_3_1/To_Face]", "edge", aTower)
 
 # check the connected topology method: solid is not a compound of connected topology
 assert(aFuse.firstResult().shape().isConnectedTopology() == False)