X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_SWIG%2FSMESH_Partition1_tetra.py;h=16c301efbdc95f4e81aa2b21a757b26821b185c4;hp=e0f284a96f45075eaad5bd9aff50a7c5c1471077;hb=69f064e1222d71a85b8ac1e11d82e0480b6d6cea;hpb=79b1ac2b6df9117f16f11d444b1f165d477a1813 diff --git a/src/SMESH_SWIG/SMESH_Partition1_tetra.py b/src/SMESH_SWIG/SMESH_Partition1_tetra.py index e0f284a96..16c301efb 100644 --- a/src/SMESH_SWIG/SMESH_Partition1_tetra.py +++ b/src/SMESH_SWIG/SMESH_Partition1_tetra.py @@ -1,32 +1,40 @@ -# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# -*- coding: iso-8859-1 -*- +# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE # -# 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. +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # -# 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. +# 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. # -# 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 +# 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. # -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# 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 # + # Tetrahedrization of the geometry generated by the Python script GEOM_Partition1.py # Hypothesis and algorithms for the mesh generation are global -# -#%Make geometry (like CEA script (A1)) using Partition algorithm% from OCC # -- Rayon de la bariere - +# import salome -import geompy -import smesh +salome.salome_init() +import GEOM +from salome.geom import geomBuilder +geompy = geomBuilder.New(salome.myStudy) + +import SMESH, SALOMEDS +from salome.smesh import smeshBuilder +smesh = smeshBuilder.New(salome.myStudy) + from math import sqrt @@ -87,7 +95,7 @@ print "number of Edges in alveole : ", len(subEdgeList) subshapes = geompy.SubShapeAll(alveole, geompy.ShapeType["SHAPE"]) -## there are 9 subshapes +## there are 9 sub-shapes comp1 = geompy.MakeCompound( [ subshapes[0], subshapes[1] ] ) comp2 = geompy.MakeCompound( [ subshapes[2], subshapes[3] ] ) @@ -118,7 +126,6 @@ print "number of Edges in alveole : ", len(subEdgeList) status = geompy.CheckShape(alveole) print " check status ", status -# ---- launch SMESH # ---- init a Mesh with the alveole shape_mesh = salome.IDToObject( idalveole ) @@ -153,7 +160,7 @@ print "-------------------------- MaxElementVolume" maxElementVolume = 0.5 -netgen3D = mesh.Tetrahedron(smesh.NETGEN) +netgen3D = mesh.Tetrahedron(smeshBuilder.NETGEN) hypVolume = netgen3D.MaxElementVolume(maxElementVolume) print hypVolume.GetName() print hypVolume.GetId()