]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOM_SWIG/GEOM_Sketcher.py
Salome HOME
7ea56b3cbb6666c41d94f605164d530117f87cb6
[modules/geom.git] / src / GEOM_SWIG / GEOM_Sketcher.py
1 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
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.
10 #
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.
15 #
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
19 #
20 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22 #  GEOM GEOM_SWIG : binding of C++ omplementaion with Python
23 #  File   : GEOM_Sketcher.py
24 #  Author : Damien COQUERET, Open CASCADE
25 #  Module : GEOM
26 #  $Header$
27 #
28 import geompy
29
30 #SKETCHER INFOS
31 #Init Sketcher
32 #Create a string beginning by :"Sketcher:"
33 #Each command must be separated by ":"
34 #"F x y" : Create first point at X & Y
35
36 #To Make Segment
37 #"R angle" : Set the direction by angle
38 #"D dx dy" : Set the direction by DX & DY
39
40 #"TT x y" : Create by point at X & Y
41 #"T dx dy" : Create by point with DX & DY
42 #"L length" : Create by direction & Length
43 #"IX x" : Create by direction & Intersect. X
44 #"IY y" : Create by direction & Intersect. Y
45
46 #To Make Arc
47 #"C radius length" : Create by direction, radius and length(in degree)
48
49 #To finish
50 #"WW" : Close Wire
51
52 #Create Sketcher
53 Cmd = "Sketch:F 0 0:TT 0 100:C 100 180:WW"
54 Sketcher = geompy.MakeSketcher(Cmd) #(string)->GEOM_Shape_ptr
55
56 #Add In Study
57 id_Sketcher = geompy.addToStudy(Sketcher, "Sketcher")