Salome HOME
4916dfce2d4037dfa69d771bfca836a015904d18
[modules/geom.git] / doc / salome / gui / GEOM / input / tui_3dsketcher.doc
1 /*!
2
3 \page tui_3dsketcher_page 3D Sketcher
4
5 \code
6 import geompy
7 import salome
8 gg = salome.ImportComponentGUI("GEOM")
9
10 # Create a 3D sketcher (wire) on the given points coordinates
11 sketcher1 = geompy.Make3DSketcher([ 0,0,0, 50,50,50, 0,50,0, 50,0,50, 10,20,100, 0,0,0 ])
12
13 # add object in the study
14 id_sketcher1 = geompy.addToStudy(sketcher1, "Sketcher1")
15
16 # display the sketcher
17 gg.createAndDisplayGO(id_sketcher1)
18
19 # Create a 3D sketcher (wire) with Sketcher3D interface
20
21 # get the interface instance
22 sk = geompy.Sketcher3D()
23
24 # add three points with absolute coordinates
25 # the first point will be the start point of sketcher
26 # two segments will be added by this command
27 sk.addPointsAbsolute(1,2,3, 7,0,0, 10,-3.5,-11)
28
29 # add one segment, defined by two angles in "OXY" coordinate system and length
30 sk.addPointAnglesLength("OXY", 45, 0, 100)
31
32 # add three points with relative coordinates
33 # three segments will be added by this command
34 sk.addPointsRelative(20,0,0, 20,0,100, -40,0,-50)
35
36 # set to close the sketcher
37 sk.close()
38
39 # obtain the sketcher result
40 sketcher2 = sk.wire()
41
42 # add object in the study
43 id_sketcher2 = geompy.addToStudy(sketcher2, "Sketcher2")
44
45 # display the sketcher
46 gg.createAndDisplayGO(id_sketcher2)
47 \endcode
48
49 */