X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FCollectionPlugin%2FTest%2FTestField.py;h=93bc30144e682b1933e97ecc491584fb1ea25a1d;hb=fdd802da7683f66ca609cf12b1e11be9642149d6;hp=3fc6ade66f4cf2391f22de93e4df1b5cdd051ca3;hpb=a94fc319f2aa64b43c9a73b5ff7063923648faec;p=modules%2Fshaper.git diff --git a/src/CollectionPlugin/Test/TestField.py b/src/CollectionPlugin/Test/TestField.py index 3fc6ade66..93bc30144 100644 --- a/src/CollectionPlugin/Test/TestField.py +++ b/src/CollectionPlugin/Test/TestField.py @@ -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 -## +# Copyright (C) 2014-2020 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 +# """ TestBoolean.py @@ -73,16 +72,10 @@ aLineCEndPoint.setValue(-100., 0.) aSession.finishOperation() # Build sketch faces aSession.startOperation() -aSketchResult = aTriangleSketchFeature.firstResult() -aSketchEdges = modelAPI_ResultConstruction(aSketchResult).shape() -origin = geomDataAPI_Point(aTriangleSketchFeature.attribute("Origin")).pnt() -dirX = geomDataAPI_Dir(aTriangleSketchFeature.attribute("DirX")).dir() -norm = geomDataAPI_Dir(aTriangleSketchFeature.attribute("Norm")).dir() -aSketchFaces = ShapeList() -GeomAlgoAPI_SketchBuilder.createFaces(origin, dirX, norm, aSketchEdges, aSketchFaces) +aSketchResult = modelAPI_ResultConstruction(aTriangleSketchFeature.firstResult()) # Create extrusion on them anExtrusionFt = aPart.addFeature("Extrusion") -anExtrusionFt.selectionList("base").append(aSketchResult, aSketchFaces[0]) +anExtrusionFt.selectionList("base").append(aSketchResult, aSketchResult.face(0)) anExtrusionFt.string("CreationMethod").setValue("BySizes") anExtrusionFt.real("to_size").setValue(50) anExtrusionFt.real("from_size").setValue(50) @@ -98,9 +91,9 @@ aSession.startOperation() aField = aSession.activeDocument().addFeature("Field") aSelectionListAttr = aField.selectionList("selected") aSelectionListAttr.setSelectionType("vertex") -aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1_1") -aSelectionListAttr.append("Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1_1") -aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/From_Face_1_1") +aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]") +aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]") +aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]") aComponentNames = aField.stringArray("components_names") aComponentNames.setSize(2) # two components aComponentNames.setValue(0, "temperatue") @@ -127,7 +120,7 @@ aSession.startOperation() aField = aSession.activeDocument().addFeature("Field") aSelectionListAttr = aField.selectionList("selected") aSelectionListAttr.setSelectionType("face") -aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3") +aSelectionListAttr.append("Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1") aComponentNames = aField.stringArray("components_names") aComponentNames.setSize(1) # one component aComponentNames.setValue(0, "description") @@ -153,7 +146,7 @@ aSession.startOperation() aField = aSession.activeDocument().addFeature("Field") aSelectionListAttr = aField.selectionList("selected") aSelectionListAttr.setSelectionType("face") -aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3") +aSelectionListAttr.append("Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1") aComponentNames = aField.stringArray("components_names") aComponentNames.setSize(1) # one component aComponentNames.setValue(0, "description") @@ -177,7 +170,7 @@ aSession.startOperation() aField = aSession.activeDocument().addFeature("Field") aSelectionListAttr = aField.selectionList("selected") aSelectionListAttr.setSelectionType("face") -aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3") +aSelectionListAttr.append("Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1") aComponentNames = aField.stringArray("components_names") aComponentNames.setSize(1) # one component aComponentNames.setValue(0, "description")