1 # -*- coding: utf-8 -*-
7 theStudy = salome.myStudy
14 from salome.geom import geomBuilder
15 geompy = geomBuilder.New(salome.myStudy)
18 geompy.init_geom(theStudy)
20 sphere = geompy.MakeSphereR(10)
21 geompy.addToStudy( sphere, 'sphere' )
28 from salome.smesh import smeshBuilder
29 smesh = smeshBuilder.New(salome.myStudy)
32 Mesh_1 = smesh.Mesh(sphere)
34 BLSURF_1 = Mesh_1.Triangle(algo=smeshBuilder.MG_CADSurf)
35 BLSURF_Parameters = BLSURF_1.Parameters()
36 BLSURF_Parameters.SetPhySize( 5 )
37 BLSURF_Parameters.SetGeometricMesh( 1 )
38 BLSURF_Parameters.SetAngleMesh( 8 )
40 # REMARK: These lines are the default behaviour from Salome 7.5.0
41 # => It is not needed to add them
42 #BLSURF_Parameters.SetTopology( 3 )
43 #BLSURF_Parameters.SetPreCADMergeEdges( False )
44 #BLSURF_Parameters.SetPreCADProcess3DTopology( False )
49 raise Exception("Error when computing surface mesh")
51 Mesh_1.Tetrahedron(algo=smeshBuilder.MG_Tetra)
56 raise Exception("Error when computing volume mesh")
58 ## Check that vertices are merged by preCAD preprocessing
61 #x, y, z = geompy.PointCoordinates(p)
62 #id_node = Mesh_1.FindNodeClosestTo(x, y, z)
63 #nodes.append(id_node)
67 #assert(len(nodes) == 1)
69 if salome.sg.hasDesktop():
70 salome.sg.updateObjBrowser(1)