1 # -*- coding: utf-8 -*-
9 notebook = salome_notebook.notebook
12 from blocFissure import gmu
20 from salome.geom import geomBuilder
24 geompy = geomBuilder.New()
26 Disk_1 = geompy.MakeDiskR(100, 1)
27 O = geompy.MakeVertex(0, 0, 0)
28 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
29 OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
30 OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
31 Scale_1 = geompy.MakeScaleAlongAxes(Disk_1, None, 0.4, 0.75, 1)
32 [Vertex_1] = geompy.ExtractShapes(Scale_1, geompy.ShapeType["VERTEX"], True)
33 Rotation_1 = geompy.MakeRotation(Scale_1, OY, 190*math.pi/180.0)
34 Rotation_2 = geompy.MakeRotation(Rotation_1, OZ, 10*math.pi/180.0)
35 Vertex_2 = geompy.MakeVertex(20, -100, -50)
36 Vertex_4 = geompy.MakeVertex(100, 100, 50)
37 Box_1 = geompy.MakeBoxTwoPnt(Vertex_2, Vertex_4)
38 Cut_1 = geompy.MakeCut(Rotation_1, Box_1)
39 ellipse1 = geompy.MakeTranslation(Cut_1, 400, 0, 400)
40 geompy.addToStudy( Disk_1, 'Disk_1' )
41 geompy.addToStudy( O, 'O' )
42 geompy.addToStudy( OX, 'OX' )
43 geompy.addToStudy( OY, 'OY' )
44 geompy.addToStudy( OZ, 'OZ' )
45 geompy.addToStudy( Scale_1, 'Scale_1' )
46 geompy.addToStudyInFather( Scale_1, Vertex_1, 'Vertex_1' )
47 geompy.addToStudy( Rotation_1, 'Rotation_1' )
48 geompy.addToStudy( Rotation_2, 'Rotation_2' )
49 geompy.addToStudy( Vertex_2, 'Vertex_2' )
50 geompy.addToStudy( Box_1, 'Box_1' )
51 geompy.addToStudy( Vertex_4, 'Vertex_4' )
52 geompy.addToStudy( Cut_1, 'Cut_1' )
53 geompy.addToStudy( ellipse1, 'ellipse1_pb' )
54 geompy.ExportBREP(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests/ellipse1_pb.brep"))
57 if salome.sg.hasDesktop():
58 salome.sg.updateObjBrowser()