1 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
3 # Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 # File : GEOM_example2.py
25 # Author : Paul RASCLE, EDF
33 geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
34 myBuilder = salome.myStudy.NewBuilder()
36 point0 = geom.MakePointStruct(0.,0.,0.)
37 pointz1 = geom.MakePointStruct(0.,0.,1.)
38 dirz = geom.MakeDirection(pointz1)
40 torus1 = geompy.MakeTorus(point0,dirz,150.,25.)
41 id_torus1 = geompy.addToStudy(torus1,"torus1")
43 torus2 = geom.MakeCopy(torus1)
44 torus2 = geom.MakeTranslation(torus2,0.,0.,100.)
45 id_torus2 = geompy.addToStudy(torus2,"torus2")
47 cylz1 = geompy.MakeCylinder(point0,dirz,25.,100.)
52 acyl = geom.MakeCopy(cylz1)
53 x = 150. * math.cos(ind * math.pi/3.)
54 y = 150. * math.sin(ind * math.pi/3.)
57 acyl = geompy.MakeTranslation(acyl,x,y,z)
58 id_acyl = geompy.addToStudy(acyl,name)