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
00024
00025
00026 from geompy import *
00027
00028 import smesh
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 name = "ex21_lamp"
00039
00040 cote = 60
00041
00042 section = 20
00043 size = 200
00044
00045 radius_1 = 80
00046 radius_2 = 40
00047 height = 100
00048
00049
00050
00051
00052 box = MakeBox(-cote, -cote, -cote, +cote, +cote, +cote)
00053
00054
00055
00056
00057 pt1 = MakeVertex(0, 0, cote/3)
00058 di1 = MakeVectorDXDYDZ(0, 0, 1)
00059 cyl = MakeCylinder(pt1, di1, section, size)
00060
00061
00062
00063
00064 pt2 = MakeVertex(0, 0, size)
00065 cone = MakeCone(pt2, di1, radius_1, radius_2, height)
00066
00067
00068
00069
00070 box_cyl = MakeFuse(box, cyl)
00071 piece = MakeFuse(box_cyl, cone)
00072
00073
00074
00075
00076 addToStudy(piece, name)
00077
00078
00079
00080
00081 group = CreateGroup(piece, ShapeType["FACE"])
00082
00083 group_name = name + "_grp"
00084 addToStudy(group, group_name)
00085 group.SetName(group_name)
00086
00087
00088
00089
00090 faces = SubShapeAllIDs(piece, ShapeType["FACE"])
00091
00092 UnionIDs(group, faces)
00093
00094
00095
00096
00097 smesh.SetCurrentStudy(salome.myStudy)
00098
00099
00100
00101
00102 tetra = smesh.Mesh(piece, name)
00103
00104
00105
00106
00107 algo1d = tetra.Segment()
00108 algo1d.LocalLength(10)
00109
00110
00111
00112
00113 algo2d = tetra.Triangle()
00114 algo2d.LengthFromEdges()
00115
00116
00117
00118
00119 algo3d = tetra.Tetrahedron(smesh.NETGEN)
00120 algo3d.MaxElementVolume(100)
00121
00122
00123
00124
00125 tetra.Compute()
00126
00127
00128
00129
00130 tetra.Group(group)