Back to index

salome-geom  6.5.0
GEOM_example6.py
Go to the documentation of this file.
00001 #  -*- coding: iso-8859-1 -*-
00002 # Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00003 #
00004 # This library is free software; you can redistribute it and/or
00005 # modify it under the terms of the GNU Lesser General Public
00006 # License as published by the Free Software Foundation; either
00007 # version 2.1 of the License.
00008 #
00009 # This library is distributed in the hope that it will be useful,
00010 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 # Lesser General Public License for more details.
00013 #
00014 # You should have received a copy of the GNU Lesser General Public
00015 # License along with this library; if not, write to the Free Software
00016 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00017 #
00018 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00019 #
00020 
00021 #  GEOM GEOM_SWIG : binding of C++ omplementaion with Python
00022 #  File   : GEOM_example6.py
00023 #  Author : Dmitry MATVEITChEV
00024 #  Module : GEOM
00025 #  $Header: /home/server/cvs/GEOM/GEOM_SRC/src/GEOM_SWIG/GEOM_example6.py,v 1.3.2.2.10.2.14.1 2012-04-13 05:48:08 vsr Exp $
00026 #
00027 import salome
00028 import geompy
00029 
00030 ind = 1
00031 circlelist = []
00032 while ind < 6:
00033     x1 = 0. + (10. * ind)
00034     y1 = 0.
00035     z1 = 0.
00036     x2 = 10. + (10. * ind)
00037     y2 = 20. * (ind+1)
00038     z2 = 30. * (ind+1)
00039     x3 = 50. + (10. * ind)
00040     y3 = 0. * (ind+1)
00041     z3 = -10. * (ind+1)
00042 
00043     print x1, y1, z1, x2, y2, z2, x3, y3, z3
00044 
00045     point1 = geompy.MakeVertex(x1, y1, z1)
00046     name1 = "point1_%d"%(ind)
00047     id_pt1 = geompy.addToStudy(point1, name1)
00048     point2 = geompy.MakeVertex(x2, y2, z2)
00049     name2 = "point2_%d"%(ind)
00050     id_pt2 = geompy.addToStudy(point2, name2)
00051     point3 = geompy.MakeVertex(x3, y3, z3)
00052     name3 = "point3_%d"%(ind)
00053     id_pt3 = geompy.addToStudy(point3, name3)
00054 
00055     name = "circle%d"%(ind)
00056     circle = geompy.MakeCircleCenter2Pnt(point1, point2, point3)
00057     id_circle = geompy.addToStudy(circle, name)
00058     circlelist.append(circle)
00059     ind = ind + 1