00001 # -*- coding: iso-8859-1 -*- 00002 # Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00003 # 00004 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, 00005 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 00006 # 00007 # This library is free software; you can redistribute it and/or 00008 # modify it under the terms of the GNU Lesser General Public 00009 # License as published by the Free Software Foundation; either 00010 # version 2.1 of the License. 00011 # 00012 # This library is distributed in the hope that it will be useful, 00013 # but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 # Lesser General Public License for more details. 00016 # 00017 # You should have received a copy of the GNU Lesser General Public 00018 # License along with this library; if not, write to the Free Software 00019 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 # 00021 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00022 # 00023 00024 # File : SMESH_GroupFromGeom.py 00025 # Module : SMESH 00026 # 00027 from SMESH_test1 import * 00028 00029 # Compute the mesh created in SMESH_test1 00030 00031 mesh.Compute() 00032 00033 # Create geometry groups on plane: 00034 aGeomGroup1 = geompy.CreateGroup(face , geompy.ShapeType["FACE"]) 00035 geompy.AddObject(aGeomGroup1, 1) 00036 00037 aGeomGroup2 = geompy.CreateGroup(face , geompy.ShapeType["EDGE"]) 00038 00039 geompy.AddObject(aGeomGroup2, 3) 00040 geompy.AddObject(aGeomGroup2, 6) 00041 geompy.AddObject(aGeomGroup2, 8) 00042 geompy.AddObject(aGeomGroup2, 10) 00043 00044 geompy.addToStudy(aGeomGroup1, "Group on Faces") 00045 geompy.addToStudy(aGeomGroup2, "Group on Edges") 00046 00047 aSmeshGroup1 = mesh.GroupOnGeom(aGeomGroup1, "SMESHGroup1", smesh.FACE) 00048 aSmeshGroup2 = mesh.GroupOnGeom(aGeomGroup2, "SMESHGroup2", smesh.EDGE) 00049 00050 salome.sg.updateObjBrowser(1);