Salome HOME
[bos #29336] problem in inertia calculus
[modules/geom.git] / doc / salome / gui / GEOM / input / creating_sketcher.doc
1 /*!
2
3 \page create_sketcher_page 2D Sketcher
4
5 The 2D Sketcher allows drawing arbitrary 2D shapes. 
6
7 To create a <b>2D Sketch</b> select in the main menu  <b>New Entity -> Basic -> 2D Sketch</b>. 
8
9 \image html sketcher_dlg.png
10
11 At first it is necessary to define the reference coordinate system, where the sketch will be created:
12 - The XOY plane of the <b>Global coordinate system</b> is suggested by default (if no plane or planar face is selected when <b>2D Sketcher</b> is activated). 
13 - If any Local Coordinate Systems have been created in the study earlier, they can be selected as a reference coordinate system in the corresponding list box.
14 - The \b Arrow button allows selecting a \b plane or a <b>planar face</b> in the viewer or in the object browser as the reference coordinate system for the sketch. The start point will be set in the \b geometric \b center of the face.  
15 - <b>Restore</b> button orientates the viewer correspondingly to the chosen working plane and fits the scene to show all objects. 
16
17 It is possible to create sketches of two types:
18 - \b Profiles made of <b>line segments</b> and \b arcs, or 
19 - \b Rectangles. 
20
21 <h2>Creation of a Profile by straight segments</h2>
22
23 - Choose \b segment radio button to start a \b profile.
24
25 - Define the start point. By default the start point of the curve is located at the origin of the reference coordinate system. A point in 2D Sketcher can be defined in one of three ways: 
26
27   - By \b Absolute coordinates. Select \b Absolute radio button in \b Points group, input \b X and \b Y values and click \b Apply button:
28   \image html 2dsketch1.png
29   
30   - By \b Relative coordinates. Select \b Relative radio button in \b Points group, input \b DX and \b DY values and click \b Apply button. 
31   \image html 2dsketch2.png
32
33   - By \b Selection of an existing point. Select \b Selection radio button in \b Points group, select a point in the viewer or in the object browser and click \b Apply button.
34   \image html 2dsketch3.png
35
36 - Define the next point. Together these two points form the first segment of the sketch.
37
38 Alternatively to the definition by \b Points it is possible to define segments by \b Direction and \b Distance.  
39  
40 - The \b Direction can be:
41
42   - Defined by an \b Angle to the previous segment.
43   \image html 2dsketch4.png
44   
45   - \b Perpendicular to the previous segment (i.e. the Angle is 90 degrees).
46   \image html 2dsketch5.png
47   
48   - \b Tangent (collinear) to the previous segment (i.e. the Angle is 0 degrees).
49   \image html 2dsketch6.png
50   
51   - Defined by <b>VX-VY</b> vector coordinates.   
52   \image html 2dsketch7.png
53         
54 - The \b Distance can be defined: 
55
56   - By the absolute segment \b Length
57   - By \b DX - the length of segment projection on X-axis. 
58   - By \b DY - the length of segment projection on Y-axis. 
59         
60 - Proceed with creation of the sketch segments and click \b Apply after each step. The drawn segments will be displayed in the viewer. 
61 - Use \b Undo and \b Redo buttons to cancel an erroneously applied segment or to restore it. 
62 - To finalize, click <b>"Close"</b> button to apply the created wire "as is". 
63 - Alternatively, click <b>"Sketch Closure"</b> to close the Sketch by a straight line
64 from the last created segment to the start point and apply it.
65
66 <h2>Creation of a Profile by ark segments </h2>
67
68 If an \b ark radio button is chosen, \b Point or \b Direction define the location of the next point of the sketch, but this point and the previous one are connected by an ark segment. 
69
70 \image html 2dsketch10.png "Ark segments"
71         
72 - By default, <b>None (Tangential)</b> radio button is selected as <b>Additional Parameter</b>,  and the arc is \b tangential to the end of the sketch, which means that it is created on two points as a half-circle with radius equal to a half of the distance between these points.
73
74 \image html 2dsketch12.png
75
76 - \b Radius radio-button allows creating a more limited arc segment by defining a custom ark radius, which must be greater than half of the distance between the last point and the end point of the arc. 
77         
78 \image html 2dsketch8.png
79
80 - Finally, \b Center radio-button allows explicitly defining the center of the circle. If an arc segment cannot be built on the defined points, a warning is shown.
81         
82 \image html 2dsketch9.png 
83         
84 <h2>Creation of a Rectangle profile</h2>
85
86 \n To draw a \b rectangle, select a \b rectangle radio button.
87
88 \image html sketcher_dlg2.png
89
90 Draw a rectangle with the mouse directly in the view or input the coordinates of its two opposite vertices in the dialog.
91
92 <h2>TUI Commands</h2>
93
94 <em>geompy.MakeSketcherOnPlane(Command, WorkingPlane)</em>
95
96 This algorithm creates a sketcher (wire or face), following the textual description, passed through the <i>Command</i> argument. The edges of the resulting wire or face will be arcs of circles and/or linear segments.
97
98 - \em Command is a string, defining the sketcher by the coordinates of points in the current LCS.
99 - <em>WorkingPlane</em> can be a Local CS, a plane, or a planar face.
100
101 Another way to create the 2D Sketcher in TUI is using Sketcher2D interface.
102
103 <em>sk = geompy.Sketcher2D()</em> - returns an instance of Sketcher2D interface <i>sk</i>.
104
105 \image html sketch_example.png
106
107 See the \ref gsketcher.Sketcher2D "Sketcher2D" interface documentation for more information.
108
109 Our <b>TUI Scripts</b> provide you with useful examples of the use of
110 \ref tui_sketcher_page "2D Sketcher".
111 */