X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FModelAPI%2FTest%2FTest1512.py;h=2a80f892663005acb34cb27bd44be64db74a1b98;hb=6e421e939851e0de46554ae45a3ca0e1f67cd91d;hp=21fce85e8ec2b847e2b3629e71e88f5cc02ae7f8;hpb=ee6034427d4adc3b83cad729e641537382576ab4;p=modules%2Fshaper.git diff --git a/src/ModelAPI/Test/Test1512.py b/src/ModelAPI/Test/Test1512.py old mode 100755 new mode 100644 index 21fce85e8..2a80f8926 --- a/src/ModelAPI/Test/Test1512.py +++ b/src/ModelAPI/Test/Test1512.py @@ -1,3 +1,22 @@ +# Copyright (C) 2014-2019 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 +# + """ Test1512.py Unit test for testing the correct selection of feature by the faces after the BOPs applied @@ -65,8 +84,8 @@ aSession.startOperation() aSketchFeature2 = featureToCompositeFeature(aPart.addFeature("Sketch")) aSketchFeature2.selection("External").setValue(aXOYPlane, None); aCirc1 = aSketchFeature2.addFeature("SketchCircle") -geomDataAPI_Point2D(aCirc1.attribute("CircleCenter")).setValue(100, 50) -aCirc1.real("CircleRadius").setValue(40) +geomDataAPI_Point2D(aCirc1.attribute("circle_center")).setValue(100, 50) +aCirc1.real("circle_radius").setValue(40) aSession.finishOperation() #========================================================================= @@ -84,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() #========================================================================= @@ -97,8 +115,8 @@ aSession.startOperation() aSketchFeature3 = featureToCompositeFeature(aPart.addFeature("Sketch")) aSketchFeature3.selection("External").setValue(aXOYPlane, None); aCirc2 = aSketchFeature3.addFeature("SketchCircle") -geomDataAPI_Point2D(aCirc2.attribute("CircleCenter")).setValue(20, 20) -aCirc2.real("CircleRadius").setValue(10) +geomDataAPI_Point2D(aCirc2.attribute("circle_center")).setValue(20, 20) +aCirc2.real("circle_radius").setValue(10) aSession.finishOperation() #========================================================================= @@ -116,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() #========================================================================= @@ -135,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_3", "face", aBox) -check_owner("Boolean_1_1/Modified_1", "face", aHoleExt) -check_owner("Boolean_2_1/Modified_2", "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_3&Extrusion_1_1/Generated_Face_2", "edge", aBox) -check_owner("Boolean_2_1/Modified_2&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)