1 # Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 # File : SMESH_testExtrusion2D.py
24 # Description : Create meshes to test extrusion of mesh elements along path
31 #----------------------------------GEOM
34 p1 = geompy.MakeVertex(100, 0, 0)
35 p2 = geompy.MakeVertex(100, 0, 100)
36 p3 = geompy.MakeVertex(0, 0, 0)
37 p4 = geompy.MakeVertex(0, 100, 0)
41 vector1 = geompy.MakeVector(p1,p2)
42 vector2 = geompy.MakeVector(p3,p4)
45 ellipse1 = geompy.MakeEllipse(p1,vector1,50,25)
46 ellipse2 = geompy.MakeEllipse(p3,vector2,300,50)
48 # publish circular face and second circle
49 id_ellipse1 = geompy.addToStudy(ellipse1, "Ellips 1")
50 id_ellipse2 = geompy.addToStudy(ellipse2, "Ellips 2")
53 #---------------------------------SMESH
55 # create the path mesh
56 mesh1 = smesh.Mesh(ellipse1, "Path Mesh")
58 algoReg1 = mesh1.Segment()
59 algoReg1.SetName("Regular_1D")
60 hypNbSeg1 = algoReg1.NumberOfSegments(18)
61 smesh.SetName(hypNbSeg1, "NumberOfSegments 1")
63 # create the tool mesh
64 mesh2 = smesh.Mesh(ellipse2, "Tool Mesh")
65 algoReg2 = mesh2.Segment()
66 algoReg2.SetName("Regular_1D")
67 hypNbSeg2 = algoReg2.NumberOfSegments(34)
68 smesh.SetName(hypNbSeg2, "NumberOfSegments 2")
75 # ---- udate object browser
76 salome.sg.updateObjBrowser(1);