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 ox = 0
00039 oy = 0
00040 oz = 0
00041
00042 arete = 50
00043 hauteur = 100
00044 rayon = 10
00045
00046 g_trim = 1000
00047
00048
00049
00050
00051 piecePoint = MakeVertex(ox, oy, oz)
00052
00053 pieceBox = MakeBoxTwoPnt(piecePoint, MakeVertex(ox+arete, oy+hauteur, oz+arete))
00054
00055
00056
00057
00058 dirUp = MakeVectorDXDYDZ(0, 1, 0)
00059
00060 pieceCut1 = MakeCut(pieceBox , MakeCylinder(piecePoint , dirUp, rayon, hauteur))
00061 pieceCut2 = MakeCut(pieceCut1, MakeCylinder(MakeVertex(ox+arete, oy, oz ), dirUp, rayon, hauteur))
00062 pieceCut3 = MakeCut(pieceCut2, MakeCylinder(MakeVertex(ox , oy, oz+arete), dirUp, rayon, hauteur))
00063 pieceCut4 = MakeCut(pieceCut3, MakeCylinder(MakeVertex(ox+arete, oy, oz+arete), dirUp, rayon, hauteur))
00064
00065
00066
00067
00068 dir = MakeVectorDXDYDZ(-1, 0, 1)
00069
00070 tools = []
00071 tools.append(MakePlane(MakeVertex(ox+rayon, oy, oz ), dir, g_trim))
00072 tools.append(MakePlane(MakeVertex(ox , oy, oz+rayon), dir, g_trim))
00073
00074 piece = MakePartition([pieceCut4], tools, [], [], ShapeType["SOLID"])
00075
00076
00077
00078
00079 piece_id = addToStudy(piece, "ex10_grid4geometry")
00080
00081
00082
00083
00084 smesh.SetCurrentStudy(salome.myStudy)
00085
00086
00087
00088
00089 hexa = smesh.Mesh(piece, "ex10_grid4geometry:hexa")
00090
00091 algo = hexa.Segment()
00092 algo.NumberOfSegments(10)
00093
00094 hexa.Quadrangle()
00095
00096 hexa.Hexahedron()
00097
00098
00099
00100
00101 hexa.Compute()