X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_SWIG%2Fex10_grid4geometry.py;h=d129ffea4d50f73c48f190d302f8e90282324b91;hp=8f63e031d52080997ef807c81584a372d39c10e3;hb=5d68554076bbca0e1e95fb0db215a6c2b84b6c54;hpb=0635c9fc80f67d1e5dc0e94ec85f487286a92070 diff --git a/src/SMESH_SWIG/ex10_grid4geometry.py b/src/SMESH_SWIG/ex10_grid4geometry.py index 8f63e031d..d129ffea4 100644 --- a/src/SMESH_SWIG/ex10_grid4geometry.py +++ b/src/SMESH_SWIG/ex10_grid4geometry.py @@ -1,29 +1,37 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# -*- coding: iso-8859-1 -*- +# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE # -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # -# 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. +# 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. +# 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 +# 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 +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + # ======================================= # -from geompy import * +import salome +salome.salome_init() +import GEOM +from salome.geom import geomBuilder +geompy = geomBuilder.New(salome.myStudy) -import smesh +import SMESH, SALOMEDS +from salome.smesh import smeshBuilder +smesh = smeshBuilder.New(salome.myStudy) # Geometry # ======== @@ -46,35 +54,35 @@ g_trim = 1000 # Box # --- -piecePoint = MakeVertex(ox, oy, oz) +piecePoint = geompy.MakeVertex(ox, oy, oz) -pieceBox = MakeBoxTwoPnt(piecePoint, MakeVertex(ox+arete, oy+hauteur, oz+arete)) +pieceBox = geompy.MakeBoxTwoPnt(piecePoint, geompy.MakeVertex(ox+arete, oy+hauteur, oz+arete)) # Cut by cylinders # ---------------- -dirUp = MakeVectorDXDYDZ(0, 1, 0) +dirUp = geompy.MakeVectorDXDYDZ(0, 1, 0) -pieceCut1 = MakeCut(pieceBox , MakeCylinder(piecePoint , dirUp, rayon, hauteur)) -pieceCut2 = MakeCut(pieceCut1, MakeCylinder(MakeVertex(ox+arete, oy, oz ), dirUp, rayon, hauteur)) -pieceCut3 = MakeCut(pieceCut2, MakeCylinder(MakeVertex(ox , oy, oz+arete), dirUp, rayon, hauteur)) -pieceCut4 = MakeCut(pieceCut3, MakeCylinder(MakeVertex(ox+arete, oy, oz+arete), dirUp, rayon, hauteur)) +pieceCut1 = geompy.MakeCut(pieceBox , geompy.MakeCylinder(piecePoint , dirUp, rayon, hauteur)) +pieceCut2 = geompy.MakeCut(pieceCut1, geompy.MakeCylinder(geompy.MakeVertex(ox+arete, oy, oz ), dirUp, rayon, hauteur)) +pieceCut3 = geompy.MakeCut(pieceCut2, geompy.MakeCylinder(geompy.MakeVertex(ox , oy, oz+arete), dirUp, rayon, hauteur)) +pieceCut4 = geompy.MakeCut(pieceCut3, geompy.MakeCylinder(geompy.MakeVertex(ox+arete, oy, oz+arete), dirUp, rayon, hauteur)) # Compound by make a partition of a solid # --------------------------------------- -dir = MakeVectorDXDYDZ(-1, 0, 1) +dir = geompy.MakeVectorDXDYDZ(-1, 0, 1) tools = [] -tools.append(MakePlane(MakeVertex(ox+rayon, oy, oz ), dir, g_trim)) -tools.append(MakePlane(MakeVertex(ox , oy, oz+rayon), dir, g_trim)) +tools.append(geompy.MakePlane(geompy.MakeVertex(ox+rayon, oy, oz ), dir, g_trim)) +tools.append(geompy.MakePlane(geompy.MakeVertex(ox , oy, oz+rayon), dir, g_trim)) -piece = MakePartition([pieceCut4], tools, [], [], ShapeType["SOLID"]) +piece = geompy.MakePartition([pieceCut4], tools, [], [], geompy.ShapeType["SOLID"]) # Add in study # ------------ -piece_id = addToStudy(piece, "ex10_grid4geometry") +piece_id = geompy.addToStudy(piece, "ex10_grid4geometry") # Meshing # =======