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