X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FTest%2FTestSerialBoolean.py;h=cf7f779c82364d162501b19637f6104f45cdffce;hb=4656ef7be2170488c06dbc0586f71348be93b5fb;hp=ddbde47932709ce72866ee278c80d81c4653e610;hpb=a1baede8e41ab33d4d133cfa42f1fbafb50c8438;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/Test/TestSerialBoolean.py b/src/FeaturesPlugin/Test/TestSerialBoolean.py index ddbde4793..cf7f779c8 100644 --- a/src/FeaturesPlugin/Test/TestSerialBoolean.py +++ b/src/FeaturesPlugin/Test/TestSerialBoolean.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-2022 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 +# """ TestExtrusion.py @@ -96,30 +95,17 @@ aSession.startOperation() anExtrusions = [] for i in range(0, N * N): - aSketchResult = aSketchFeatures[i].firstResult() - aSketchEdges = modelAPI_ResultConstruction(aSketchResult).shape() - origin = geomDataAPI_Point(aSketchFeatures[i].attribute("Origin")).pnt() - dirX = geomDataAPI_Dir(aSketchFeatures[i].attribute("DirX")).dir() - norm = geomDataAPI_Dir(aSketchFeatures[i].attribute("Norm")).dir() - aSketchFaces = ShapeList() - GeomAlgoAPI_SketchBuilder.createFaces( - origin, dirX, norm, aSketchEdges, aSketchFaces) - + aSketchResult = modelAPI_ResultConstruction(aSketchFeatures[i].firstResult()) anExtrusionFt = aPart.addFeature("Extrusion") assert (anExtrusionFt.getKind() == "Extrusion") anExtrusionFt.selectionList("base").append( - aSketchResult, aSketchFaces[0]) + aSketchResult, aSketchResult.face(0)) anExtrusionFt.string("CreationMethod").setValue("BySizes") anExtrusionFt.real("from_size").setValue(0) anExtrusionFt.real("to_size").setValue(10) anExtrusionFt.real("to_offset").setValue(0) #TODO: remove anExtrusionFt.real("from_offset").setValue(0) #TODO: remove - # v1.0.2 from master - # anExtrusionFt.selection("extrusion_face").setValue( - # aSketchResult, aSketchFaces[0]) - # anExtrusionFt.real("extrusion_size").setValue(10) - # anExtrusionFt.boolean("extrusion_reverse").setValue(False) anExtrusions.append(anExtrusionFt) aSession.finishOperation() @@ -162,28 +148,16 @@ aSession.startOperation() #========================================================================= # Build a big box extrusion #========================================================================= -aSketchResult = aQuadrangleSketchFeature.firstResult() -aSketchEdges = modelAPI_ResultConstruction(aSketchResult).shape() -origin = geomDataAPI_Point(aQuadrangleSketchFeature.attribute("Origin")).pnt() -dirX = geomDataAPI_Dir(aQuadrangleSketchFeature.attribute("DirX")).dir() -norm = geomDataAPI_Dir(aQuadrangleSketchFeature.attribute("Norm")).dir() -aSketchFaces = ShapeList() -GeomAlgoAPI_SketchBuilder.createFaces( - origin, dirX, norm, aSketchEdges, aSketchFaces) +aSketchResult = modelAPI_ResultConstruction(aQuadrangleSketchFeature.firstResult()) # Create extrusion on them aBox = aPart.addFeature("Extrusion") aBox.selectionList("base").append( - aSketchResult, aSketchFaces[0]) + aSketchResult, aSketchResult.face(0)) aBox.string("CreationMethod").setValue("BySizes") aBox.real("from_size").setValue(0) aBox.real("to_size").setValue(10) aBox.real("to_offset").setValue(0) #TODO: remove aBox.real("from_offset").setValue(0) #TODO: remove -# v 1.0.2 from master -# aBox.selection("extrusion_face").setValue( -# aSketchResult, aSketchFaces[0]) -# aBox.real("extrusion_size").setValue(10) -# aBox.boolean("extrusion_reverse").setValue(False) aSession.finishOperation()