1 # -*- coding: utf-8 -*-
7 theStudy = salome.myStudy
10 notebook = salome_notebook.notebook
13 from blocFissure import gmu
20 from salome.geom import geomBuilder
25 geompy = geomBuilder.New(theStudy)
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 Vertex_1 = geompy.MakeVertex(400, 0, 400)
32 Vertex_2 = geompy.MakeVertex(400, 0, 500)
33 Vector_1 = geompy.MakeVector(Vertex_1, Vertex_2)
34 Disk_1 = geompy.MakeDiskPntVecR(Vertex_1, Vector_1, 50)
35 Rotation_1 = geompy.MakeRotation(Disk_1, Vector_1, 180*math.pi/180.0)
36 Scale_1 = geompy.MakeScaleAlongAxes(Rotation_1, Vertex_1, 1, 1.5, 1)
37 Vertex_3 = geompy.MakeVertex(420, -400, 300)
38 Vertex_4 = geompy.MakeVertex(500, 400, 500)
39 Box_1 = geompy.MakeBoxTwoPnt(Vertex_4, Vertex_3)
40 ellipse1 = geompy.MakeCut(Scale_1, Box_1)
41 [fondFiss] = geompy.SubShapes(ellipse1, [4])
42 geompy.addToStudy( O, 'O' )
43 geompy.addToStudy( OX, 'OX' )
44 geompy.addToStudy( OY, 'OY' )
45 geompy.addToStudy( OZ, 'OZ' )
46 geompy.addToStudy( Vertex_1, 'Vertex_1' )
47 geompy.addToStudy( Vertex_2, 'Vertex_2' )
48 geompy.addToStudy( Vector_1, 'Vector_1' )
49 geompy.addToStudy( Disk_1, 'Disk_1' )
50 geompy.addToStudy( Rotation_1, 'Rotation_1' )
51 geompy.addToStudy( Scale_1, 'Scale_1' )
52 geompy.addToStudy( Vertex_3, 'Vertex_3' )
53 geompy.addToStudy( Vertex_4, 'Vertex_4' )
54 geompy.addToStudy( Box_1, 'Box_1' )
55 geompy.addToStudy( ellipse1, 'ellipse1' )
56 geompy.addToStudyInFather( ellipse1, fondFiss, 'fondFiss' )
57 geompy.ExportBREP(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests/ellipse1.brep"))
60 if salome.sg.hasDesktop():
61 salome.sg.updateObjBrowser(True)