X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FTools%2FblocFissure%2Fgmu%2FtoreFissure.py;fp=src%2FTools%2FblocFissure%2Fgmu%2FtoreFissure.py;h=899ef5e0c6abdc12bd0a4fa6e03492e916fd87a4;hb=e9e7af000e6d84b90aaa62d06f8c28ab093b0745;hp=0000000000000000000000000000000000000000;hpb=8c0cc49261c88cde61a96c8642ac89e061ff1fd8;p=modules%2Fsmesh.git diff --git a/src/Tools/blocFissure/gmu/toreFissure.py b/src/Tools/blocFissure/gmu/toreFissure.py new file mode 100644 index 000000000..899ef5e0c --- /dev/null +++ b/src/Tools/blocFissure/gmu/toreFissure.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- + +import logging +from geomsmesh import geompy +import math +from triedreBase import triedreBase + +O, OX, OY, OZ = triedreBase() + +# ----------------------------------------------------------------------------- +# --- tore et plan de fissure + +def toreFissure(minRad,allonge,rayTore): + """ + Construction de la geometrie du tore elliptique autour du front de fissure. + L'ellipse est construite dans le plan xoy, axe oy. + @param minRad :petit rayon + @param allonge :rapport grand rayon / petit rayon + @param rayTore :rayon du tore construit autour de la generatrice de l'ellipse + @return (generatrice, FaceGenFiss, Pipe_1, FaceFissure, Plane_1, Pipe1Part) : ellipse, section du tore, + tore plein, face plane de le fissure, plan de la fissure, tore partitioné par le plan de fissure. + """ + logging.info("start ", minRad, allonge, rayTore) + + Vertex_1 = geompy.MakeVertex( minRad, 0, 0) + Vertex_2 = geompy.MakeVertex(-minRad, 0, 0) + Vertex_3 = geompy.MakeRotation(Vertex_1, OZ, 45*math.pi/180.0) + Arc_1 = geompy.MakeArc(Vertex_1, Vertex_2, Vertex_3) + generatrice = geompy.MakeScaleAlongAxes(Arc_1, O, 1, allonge, 1) + + #geompy.addToStudy( Vertex_1, 'Vertex_1' ) + #geompy.addToStudy( Vertex_2, 'Vertex_2' ) + #geompy.addToStudy( Vertex_3, 'Vertex_3' ) + #geompy.addToStudy( Arc_1, 'Arc_1' ) + #geompy.addToStudy( generatrice, 'generatrice' ) + + # --- face circulaire sur la generatrice, pour extrusion + + Circle_1 = geompy.MakeCircle(O, OY, rayTore) + Rotation_1 = geompy.MakeRotation(Circle_1, OY, -90*math.pi/180.0) + Translation_1 = geompy.MakeTranslation(Rotation_1, minRad, 0, 0) + FaceGenFiss = geompy.MakeFaceWires([Translation_1], 1) + + #geompy.addToStudy( Circle_1, 'Circle_1' ) + #geompy.addToStudy( Rotation_1, 'Rotation_1' ) + #geompy.addToStudy( Translation_1, 'Translation_1' ) + #geompy.addToStudy( FaceGenFiss, 'FaceGenFiss' ) + + # --- tore extrude + + Pipe_1 = geompy.MakePipe(FaceGenFiss, generatrice) + + # --- plan fissure, delimite par la generatrice + + Scale_1_vertex_3 = geompy.GetSubShape(generatrice, [3]) + Line_1 = geompy.MakeLineTwoPnt(Vertex_1, Scale_1_vertex_3) + FaceFissure = geompy.MakeFaceWires([generatrice, Line_1], 1) + + #geompy.addToStudyInFather( generatrice, Scale_1_vertex_3, 'Scale_1:vertex_3' ) + #geompy.addToStudy( Line_1, 'Line_1' ) + #geompy.addToStudy( FaceFissure, 'FaceFissure' ) + + # --- tore coupe en 2 demi tore de section 1/2 disque + + Plane_1 = geompy.MakePlane(O, OZ, 2000) + Pipe1Part = geompy.MakePartition([Pipe_1], [Plane_1], [], [], geompy.ShapeType["SOLID"], 0, [], 1) + geompy.addToStudy(Pipe1Part , 'Pipe1Part' ) + + return generatrice, FaceGenFiss, Pipe_1, FaceFissure, Plane_1, Pipe1Part