Salome HOME
Copyright update 2021
[modules/smesh.git] / src / Tools / blocFissure / materielCasTests / ellipse_disque.py
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2014-2021  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
28 import os
29 from blocFissure import gmu
30
31 ###
32 ### GEOM component
33 ###
34
35 import GEOM
36 from salome.geom import geomBuilder
37 import math
38 import SALOMEDS
39
40
41 geompy = geomBuilder.New()
42
43 O = geompy.MakeVertex(0, 0, 0)
44 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
45 OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
46 OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
47 Vertex_1 = geompy.MakeVertex(100, 0, 0)
48 Disk_1 = geompy.MakeDiskPntVecR(Vertex_1, OY, 12.5)
49 Scale_1 = geompy.MakeScaleAlongAxes(Disk_1, Vertex_1, 1, 1, 4.1)
50 Vertex_2 = geompy.MakeVertex(98, -2, -2)
51 Vertex_3 = geompy.MakeVertex(120, 2, 60)
52 Box_1 = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2)
53 Ellipse_disque = geompy.MakeCommon(Box_1, Scale_1)
54 geompy.ExportBREP(Ellipse_disque, os.path.join(gmu.pathBloc, "materielCasTests/ellipse_disque.brep"))
55 geompy.addToStudy( O, 'O' )
56 geompy.addToStudy( OX, 'OX' )
57 geompy.addToStudy( OY, 'OY' )
58 geompy.addToStudy( OZ, 'OZ' )
59 geompy.addToStudy( Vertex_1, 'Vertex_1' )
60 geompy.addToStudy( Disk_1, 'Disk_1' )
61 geompy.addToStudy( Vertex_2, 'Vertex_2' )
62 geompy.addToStudy( Scale_1, 'Scale_1' )
63 geompy.addToStudy( Vertex_3, 'Vertex_3' )
64 geompy.addToStudy( Box_1, 'Box_1' )
65 geompy.addToStudy( Ellipse_disque, 'Ellipse_disque' )
66
67
68 if salome.sg.hasDesktop():
69   salome.sg.updateObjBrowser()