1 # -*- coding: utf-8 -*-
4 from geomsmesh import geompy
6 from triedreBase import triedreBase
8 O, OX, OY, OZ = triedreBase()
10 # -----------------------------------------------------------------------------
11 # --- tore et plan de fissure
13 def toreFissure(minRad,allonge,rayTore):
15 Construction de la geometrie du tore elliptique autour du front de fissure.
16 L'ellipse est construite dans le plan xoy, axe oy.
17 @param minRad :petit rayon
18 @param allonge :rapport grand rayon / petit rayon
19 @param rayTore :rayon du tore construit autour de la generatrice de l'ellipse
20 @return (generatrice, FaceGenFiss, Pipe_1, FaceFissure, Plane_1, Pipe1Part) : ellipse, section du tore,
21 tore plein, face plane de le fissure, plan de la fissure, tore partitioné par le plan de fissure.
23 logging.info("start ", minRad, allonge, rayTore)
25 Vertex_1 = geompy.MakeVertex( minRad, 0, 0)
26 Vertex_2 = geompy.MakeVertex(-minRad, 0, 0)
27 Vertex_3 = geompy.MakeRotation(Vertex_1, OZ, 45*math.pi/180.0)
28 Arc_1 = geompy.MakeArc(Vertex_1, Vertex_2, Vertex_3)
29 generatrice = geompy.MakeScaleAlongAxes(Arc_1, O, 1, allonge, 1)
31 #geompy.addToStudy( Vertex_1, 'Vertex_1' )
32 #geompy.addToStudy( Vertex_2, 'Vertex_2' )
33 #geompy.addToStudy( Vertex_3, 'Vertex_3' )
34 #geompy.addToStudy( Arc_1, 'Arc_1' )
35 #geompy.addToStudy( generatrice, 'generatrice' )
37 # --- face circulaire sur la generatrice, pour extrusion
39 Circle_1 = geompy.MakeCircle(O, OY, rayTore)
40 Rotation_1 = geompy.MakeRotation(Circle_1, OY, -90*math.pi/180.0)
41 Translation_1 = geompy.MakeTranslation(Rotation_1, minRad, 0, 0)
42 FaceGenFiss = geompy.MakeFaceWires([Translation_1], 1)
44 #geompy.addToStudy( Circle_1, 'Circle_1' )
45 #geompy.addToStudy( Rotation_1, 'Rotation_1' )
46 #geompy.addToStudy( Translation_1, 'Translation_1' )
47 #geompy.addToStudy( FaceGenFiss, 'FaceGenFiss' )
51 Pipe_1 = geompy.MakePipe(FaceGenFiss, generatrice)
53 # --- plan fissure, delimite par la generatrice
55 Scale_1_vertex_3 = geompy.GetSubShape(generatrice, [3])
56 Line_1 = geompy.MakeLineTwoPnt(Vertex_1, Scale_1_vertex_3)
57 FaceFissure = geompy.MakeFaceWires([generatrice, Line_1], 1)
59 #geompy.addToStudyInFather( generatrice, Scale_1_vertex_3, 'Scale_1:vertex_3' )
60 #geompy.addToStudy( Line_1, 'Line_1' )
61 #geompy.addToStudy( FaceFissure, 'FaceFissure' )
63 # --- tore coupe en 2 demi tore de section 1/2 disque
65 Plane_1 = geompy.MakePlane(O, OZ, 2000)
66 Pipe1Part = geompy.MakePartition([Pipe_1], [Plane_1], [], [], geompy.ShapeType["SOLID"], 0, [], 1)
67 geompy.addToStudy(Pipe1Part , 'Pipe1Part' )
69 return generatrice, FaceGenFiss, Pipe_1, FaceFissure, Plane_1, Pipe1Part