1 # CEA/LGLS 2004-2005, Francis KLOSS (OCC)
2 # =======================================
11 # A twice holed cube build by points, edges, faces and solids
31 piecePoint1 = MakeVertex(ox , oy, oz)
32 piecePoint2 = MakeVertex(ox+longueur, oy, oz)
33 piecePoint3 = MakeVertex(ox+longueur, oy, oz+largeur)
34 piecePoint4 = MakeVertex(ox , oy, oz+largeur)
38 cylPoint1 = MakeVertex(ox+cylindre , oy, cz-rayon)
39 cylPoint2 = MakeVertex(ox+longueur-cylindre, oy, cz-rayon)
40 cylPoint3 = MakeVertex(ox+longueur-cylindre, oy, cz+rayon)
41 cylPoint4 = MakeVertex(ox+cylindre , oy, cz+rayon)
46 pieceEdge1 = MakeEdge(piecePoint1, piecePoint4)
47 pieceEdge2 = MakeEdge(piecePoint1, cylPoint1)
48 pieceEdge3 = MakeEdge(piecePoint4, cylPoint4)
50 pieceEdge4 = MakeEdge(piecePoint2, piecePoint3)
51 pieceEdge5 = MakeEdge(piecePoint2, cylPoint2)
52 pieceEdge6 = MakeEdge(piecePoint3, cylPoint3)
54 pieceEdge7 = MakeEdge(cylPoint1, cylPoint2)
55 pieceEdge8 = MakeEdge(cylPoint3, cylPoint4)
57 cylEdge1 = MakeArc(cylPoint1, MakeVertex(ox+cylindre-rayon , oy, cz), cylPoint4)
58 cylEdge2 = MakeArc(cylPoint1, MakeVertex(ox+cylindre+rayon , oy, cz), cylPoint4)
59 cylEdge3 = MakeArc(cylPoint2, MakeVertex(ox+longueur-cylindre-rayon, oy, cz), cylPoint3)
60 cylEdge4 = MakeArc(cylPoint2, MakeVertex(ox+longueur-cylindre+rayon, oy, cz), cylPoint3)
65 pieceFace1 = MakeQuad4Vertices(piecePoint1, piecePoint2, cylPoint2 , cylPoint1 )
66 pieceFace2 = MakeQuad (pieceEdge1 , pieceEdge2 , cylEdge1 , pieceEdge3)
67 pieceFace3 = MakeQuad4Vertices(piecePoint3, piecePoint4, cylPoint4 , cylPoint3 )
68 pieceFace4 = MakeQuad (pieceEdge4 , pieceEdge5 , cylEdge4 , pieceEdge6)
69 pieceFace5 = MakeQuad (pieceEdge7 , cylEdge3 , pieceEdge8, cylEdge2 )
74 pieceVector = MakeVectorDXDYDZ(0, 1, 0)
76 pieceSolid1 = MakePrismVecH(pieceFace1, pieceVector, hauteur)
77 pieceSolid2 = MakePrismVecH(pieceFace2, pieceVector, hauteur)
78 pieceSolid3 = MakePrismVecH(pieceFace3, pieceVector, hauteur)
79 pieceSolid4 = MakePrismVecH(pieceFace4, pieceVector, hauteur)
80 pieceSolid5 = MakePrismVecH(pieceFace5, pieceVector, hauteur)
85 c_cpd = MakeCompound([pieceSolid1, pieceSolid2, pieceSolid3, pieceSolid4, pieceSolid5])
87 piece = MakeGlueFaces(c_cpd, 1.e-5)
92 piece_id = addToStudy(piece, "ex08_hole2build")
97 # Create a hexahedral mesh
98 # ------------------------
100 hexa = smesh.Mesh(piece, "ex08_hole2build:hexa")
102 algo = hexa.Segment()
103 algo.NumberOfSegments(7)