X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_SWIG%2Fex03_cube2partition.py;h=ea1c24cf4732e26d466867ab6ec36cdb022ce929;hp=e3447c37da10fc2bf4c7ba13ed165da696210bc3;hb=54182913fbb9df65a3f4cc96f55db3618835ecd8;hpb=0635c9fc80f67d1e5dc0e94ec85f487286a92070 diff --git a/src/SMESH_SWIG/ex03_cube2partition.py b/src/SMESH_SWIG/ex03_cube2partition.py index e3447c37d..ea1c24cf4 100644 --- a/src/SMESH_SWIG/ex03_cube2partition.py +++ b/src/SMESH_SWIG/ex03_cube2partition.py @@ -1,29 +1,37 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# -*- coding: iso-8859-1 -*- +# Copyright (C) 2007-2013 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. # -# 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 # ======== @@ -47,39 +55,39 @@ g_trim = 1000 v_arete2 = g_arete*2 v_arete3 = g_arete*3 -v_1 = MakeVertex(g_ox , g_oy , g_oz ) -v_2 = MakeVertex(g_ox+v_arete3, g_oy+g_arete , g_oz+v_arete3) +v_1 = geompy.MakeVertex(g_ox , g_oy , g_oz ) +v_2 = geompy.MakeVertex(g_ox+v_arete3, g_oy+g_arete , g_oz+v_arete3) -v_3 = MakeVertex(g_ox+g_arete , g_oy+g_arete , g_oz+g_arete ) -v_4 = MakeVertex(g_ox+v_arete2, g_oy+v_arete2, g_oz+v_arete2) +v_3 = geompy.MakeVertex(g_ox+g_arete , g_oy+g_arete , g_oz+g_arete ) +v_4 = geompy.MakeVertex(g_ox+v_arete2, g_oy+v_arete2, g_oz+v_arete2) # Solids # ------ -s_base = MakeBoxTwoPnt(v_1, v_2) -s_haut = MakeBoxTwoPnt(v_3, v_4) +s_base = geompy.MakeBoxTwoPnt(v_1, v_2) +s_haut = geompy.MakeBoxTwoPnt(v_3, v_4) # Partition # --------- -p_dir1 = MakeVectorDXDYDZ(1, 0, 0) -p_dir2 = MakeVectorDXDYDZ(0, 0, 1) -p_dir3 = MakeVectorDXDYDZ(0, 1, 0) +p_dir1 = geompy.MakeVectorDXDYDZ(1, 0, 0) +p_dir2 = geompy.MakeVectorDXDYDZ(0, 0, 1) +p_dir3 = geompy.MakeVectorDXDYDZ(0, 1, 0) p_tools = [] -p_tools.append(MakePlane(v_3, p_dir1, g_trim)) -p_tools.append(MakePlane(v_4, p_dir1, g_trim)) -p_tools.append(MakePlane(v_3, p_dir2, g_trim)) -p_tools.append(MakePlane(v_4, p_dir2, g_trim)) -p_tools.append(MakePlane(v_3, p_dir3, g_trim)) +p_tools.append(geompy.MakePlane(v_3, p_dir1, g_trim)) +p_tools.append(geompy.MakePlane(v_4, p_dir1, g_trim)) +p_tools.append(geompy.MakePlane(v_3, p_dir2, g_trim)) +p_tools.append(geompy.MakePlane(v_4, p_dir2, g_trim)) +p_tools.append(geompy.MakePlane(v_3, p_dir3, g_trim)) -piece = MakePartition([s_base, s_haut], p_tools, [], [], ShapeType["SOLID"]) +piece = geompy.MakePartition([s_base, s_haut], p_tools, [], [], geompy.ShapeType["SOLID"]) # Study # ----- -piece_id = addToStudy(piece, "ex03_cube2partition") +piece_id = geompy.addToStudy(piece, "ex03_cube2partition") # Meshing # =======