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 g_x = 0
00039 g_y = 0
00040 g_z = 0
00041
00042 g_longueur = 50.0
00043 g_largeur = 40.0
00044 g_hauteur = 25.0
00045
00046 g_rayon = 10
00047
00048 g_trim = 1000
00049
00050
00051
00052
00053 b_boite = MakeBox(g_x-g_longueur, g_y-g_hauteur, g_z-g_largeur, g_x+g_longueur, g_y+g_hauteur, g_z+g_largeur)
00054
00055
00056
00057
00058 c_axe = MakeVectorDXDYDZ(0, 1, 0)
00059
00060 c_cyl = MakeCylinder(MakeVertex(g_x, g_y-g_hauteur, g_z), c_axe, g_rayon, g_hauteur*2)
00061
00062 c_piece = MakeCut(b_boite, c_cyl)
00063
00064
00065
00066
00067 p_centre = MakeVertex(g_x, g_y, g_z)
00068
00069 p_tools = []
00070 p_tools.append(MakePlane(p_centre, MakeVectorDXDYDZ( g_largeur, 0, g_longueur), g_trim))
00071 p_tools.append(MakePlane(p_centre, MakeVectorDXDYDZ(-g_largeur, 0, g_longueur), g_trim))
00072
00073 p_part = MakePartition([c_piece], p_tools, [], [], ShapeType["SOLID"])
00074
00075 p_blocs = RemoveExtraEdges(p_part, doUnionFaces=True)
00076 piece = MakeGlueFaces(p_blocs, 1.e-5)
00077
00078
00079
00080
00081 piece_id = addToStudy(piece, "ex07_hole1partition")
00082
00083
00084
00085
00086 smesh.SetCurrentStudy(salome.myStudy)
00087
00088
00089
00090
00091 hexa = smesh.Mesh(piece, "ex07_hole1partition:hexa")
00092
00093 algo = hexa.Segment()
00094 algo.NumberOfSegments(20)
00095
00096 hexa.Quadrangle()
00097
00098 hexa.Hexahedron()
00099
00100
00101
00102
00103 hexa.Compute()