1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
4 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
29 #-----------------------------GEOM----------------------------------------
31 #----------Vertexes------------
32 p1 = geompy.MakeVertex(20.0,30.0,40.0)
33 p2 = geompy.MakeVertex(90.0,80.0,0.0)
34 p3 = geompy.MakeVertex(30.0,80.0,200.0)
36 #----------Edges---------------
37 e1 = geompy.MakeEdge(p1,p2)
38 e2 = geompy.MakeEdge(p2,p3)
39 e3 = geompy.MakeEdge(p3,p1)
41 #----------Wire----------------
43 ListOfEdges.append(e3)
44 ListOfEdges.append(e2)
45 ListOfEdges.append(e1)
46 wire1 = geompy.MakeWire(ListOfEdges)
49 #----------Face----------------
51 face1 = geompy.MakeFace(wire1,WantPlanarFace)
53 Id_face1 = geompy.addToStudy(face1,"Face1")
57 #-----------------------------SMESH-------------------------------------------
58 smesh.SetCurrentStudy(salome.myStudy)
61 plane_mesh = salome.IDToObject( Id_face1)
63 mesh = smesh.Mesh(plane_mesh, "Mesh_1")
65 print"---------------------Hypothesis and Algorithms"
67 #---------------- NumberOfSegments
71 algoWireDes = mesh.Segment()
72 listHyp = algoWireDes.GetCompatibleHypothesis()
73 print algoWireDes.GetName()
74 algoWireDes.SetName("Ware descritisation")
76 hypNbSeg = algoWireDes.NumberOfSegments(numberOfSegment)
77 print hypNbSeg.GetName()
78 print hypNbSeg.GetNumberOfSegments()
79 smesh.SetName(hypNbSeg, "Nb. Segments")
82 #--------------------------Max. Element Area
85 algoMef = mesh.Triangle()
86 listHyp = algoMef.GetCompatibleHypothesis()
87 print algoMef.GetName()
88 algoMef.SetName("Triangle (Mefisto)")
90 hypArea200 = algoMef.MaxElementArea(maxElementArea)
91 print hypArea200.GetName()
92 print hypArea200.GetMaxElementArea()
93 smesh.SetName(hypArea200, "Max. Element Area")
96 print "---------------------Compute the mesh"
101 salome.sg.updateObjBrowser(1)