Salome HOME
Fichier d'archive à la norme python
[modules/smesh.git] / src / Tools / blocFissure / materielCasTests / ellipse_probleme.py
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2014-2020  EDF R&D
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20
21 import sys
22 import salome
23
24 salome.salome_init()
25
26 import salome_notebook
27 notebook = salome_notebook.notebook
28
29 import os
30 from blocFissure import gmu
31
32 ###
33 ### GEOM component
34 ###
35
36
37 import GEOM
38 from salome.geom import geomBuilder
39 import math
40 import SALOMEDS
41
42 geompy = geomBuilder.New()
43
44 Disk_1 = geompy.MakeDiskR(100, 1)
45 O = geompy.MakeVertex(0, 0, 0)
46 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
47 OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
48 OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
49 Scale_1 = geompy.MakeScaleAlongAxes(Disk_1, None, 0.4, 0.75, 1)
50 [Vertex_1] = geompy.ExtractShapes(Scale_1, geompy.ShapeType["VERTEX"], True)
51 Rotation_1 = geompy.MakeRotation(Scale_1, OY, 190*math.pi/180.0)
52 Rotation_2 = geompy.MakeRotation(Rotation_1, OZ, 10*math.pi/180.0)
53 Vertex_2 = geompy.MakeVertex(20, -100, -50)
54 Vertex_4 = geompy.MakeVertex(100, 100, 50)
55 Box_1 = geompy.MakeBoxTwoPnt(Vertex_2, Vertex_4)
56 Cut_1 = geompy.MakeCut(Rotation_1, Box_1)
57 ellipse1 = geompy.MakeTranslation(Cut_1, 400, 0, 400)
58 geompy.addToStudy( Disk_1, 'Disk_1' )
59 geompy.addToStudy( O, 'O' )
60 geompy.addToStudy( OX, 'OX' )
61 geompy.addToStudy( OY, 'OY' )
62 geompy.addToStudy( OZ, 'OZ' )
63 geompy.addToStudy( Scale_1, 'Scale_1' )
64 geompy.addToStudyInFather( Scale_1, Vertex_1, 'Vertex_1' )
65 geompy.addToStudy( Rotation_1, 'Rotation_1' )
66 geompy.addToStudy( Rotation_2, 'Rotation_2' )
67 geompy.addToStudy( Vertex_2, 'Vertex_2' )
68 geompy.addToStudy( Box_1, 'Box_1' )
69 geompy.addToStudy( Vertex_4, 'Vertex_4' )
70 geompy.addToStudy( Cut_1, 'Cut_1' )
71 geompy.addToStudy( ellipse1, 'ellipse1_pb' )
72 geompy.ExportBREP(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests", "ellipse1_pb.brep"))
73
74
75 if salome.sg.hasDesktop():
76   salome.sg.updateObjBrowser()