Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 import os
00024
00025 import geompy
00026 import smesh
00027
00028
00029
00030
00031 results = "/tmp/ZZ"
00032
00033 radius = 50
00034 height = 200
00035
00036
00037
00038
00039 base = geompy.MakeVertex(0, 0, 0)
00040 direction = geompy.MakeVectorDXDYDZ(0, 0, 1)
00041
00042 cylinder = geompy.MakeCylinder(base, direction, radius, height)
00043
00044 geompy.addToStudy(cylinder, "Cylinder")
00045
00046
00047
00048
00049 smesh.SetCurrentStudy(salome.myStudy)
00050
00051 m = smesh.Mesh(cylinder)
00052
00053
00054
00055
00056 algo2d = m.Triangle(smesh.BLSURF)
00057
00058 algo2d.SetPhysicalMesh(1)
00059 algo2d.SetPhySize(5)
00060
00061 algo2d.SetGeometricMesh(0)
00062
00063
00064
00065
00066 algo3d = m.Tetrahedron(smesh.GHS3DPRL)
00067
00068 algo3d.SetMEDName(results)
00069 algo3d.SetNbPart(4)
00070 algo3d.SetBackground(False)
00071 algo3d.SetKeepFiles(False)
00072 algo3d.SetToMeshHoles(True)
00073
00074
00075
00076
00077 status = m.Compute()
00078
00079
00080
00081
00082 if os.access(results+".xml", os.F_OK):
00083 print "Ok: tepal"
00084 else:
00085 print "KO: tepal"