Salome HOME
Merge from V6_main_20120808 08Aug12
[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 you to draw 2D shapes on a working plane. You
6 can create sketches of two types:
7
8 <ul>
9 <li> \b Profile made of connected curves of 2 types: <b>line segments</b> and \b arcs.
10
11 \b or
12
13 <li>  \b Rectangle
14 </ul>
15
16 The \b Result is a \b Wire
17
18 \n <b>Example:</b>
19
20 \image html sketch_example.png
21
22 To create a <b> 2D Sketch</b>:
23
24 <ol>
25 <li>In the main menu select <b>New Entity -> Basic -> 2D Sketch</b> or click on \image html sketch.png </li>
26
27 <li> Select the \b plane or the <b>planar face</b> on which to create the sketch. 
28 \note By default the sketch is created on the XOY plane of the global coordinate system.
29 If Local Coordinate Systems have been created in the study they appear
30 in the combobox and can be selected as a reference coordinate system.</li>
31
32 <li> Choose a \b segment or an \b arc element to start a \b profile or choose \b rectangle to draw a rectangle.
33
34 \n If you draw a \b profile:
35
36 <li> Select a start point. By default the start point of the curve is located at the point of
37 origin of the reference coordinate system.</li>
38
39 <li> Create curve portions and click on \b Apply after each step.</li>
40
41 <li> Select either \b Close or <b>Sketch Closure</b> if you want to close the profile before closing the window.</li>
42 </ol>
43
44 \n To create a \b Segment:
45
46 <ol>
47 <li> In the <b>Element Type</b> part of the dialog box select:
48
49 \image html line_icon.png </li>
50
51 <li> You can define the segment by either its <b>end point</b> or \b direction and \b length. The direction is defined relatively to the tangent at the last point of the sketch. It can be:
52   <ul>
53     <li> Tangent (colinear to the tangent at the last point)</li>
54     <li> Perpendicular</li>
55     <li> Defined by an angle</li>
56     <li> Defined by a vector (Vx, Vy)</li>
57   </ul>
58
59 </li>
60
61 </ol>
62   
63 \n To create an \b Arc:
64
65 <ol>
66 <li> In the <b>Element Type</b> part of the dialog box select \image html arc_icon.png </li>
67
68 <li> You can define the segment by either its <b>end point</b> or \b direction \b radius and \b angle. </li>
69
70 <ul>
71   <li>In case of an end point the arc can be built in three different ways:</li>
72   <ul>
73     <li>From the end point only. The arc is \b tangential to the end of the sketch.</li>
74     <li>From the end point and a \b radius. (The radius must be greater than half of the distance between the last point and the end point of the arc).</li>
75     <li>From the \b center of the circle and the end point. The constraint on the center is first taken into account.
76     The destination point is only used to define the angle of the arc and won't lie on the arc in the general case.</li>
77   </ul>
78   
79   <li>The direction is defined relatively to the tangent at the last point of the sketch. It can be:</li>
80   
81   <ul>
82     <li>Tangent (colinear to the tangent at the last point)</li><
83     <li>Perpendicular</li>
84     <li>Defined by an angle</li>
85     <li>Defined by a vector (Vx, Vy)</li>
86   </ul>
87 </ul>
88     
89 </ol>
90
91 \note For the first segment or arc of the sketch the reference direction is the X direction of the reference coordinate system.
92
93 \n <b>Dialog Box:</b>
94
95 \image html sketcher_dlg.png
96
97 \n <b>Arguments:</b>
98 <ol>
99 <li>Coordinate system (Existing Local CS or Global CS can be selected)</li>
100 <li>A plane or a planar face to define a new Local Coordinate System
101 <li>Element type (segment, arc or rectangle).</li>
102 <li>Destination type (point or direction).</li>
103 <li>Destination point by means of:</li>
104 <ul>
105 <li>absolute coordinates X,Y;</li>
106 <li>relative coordinates DX, DY (with respect to the current point);</li>
107 <li>selection of an existing point.</li>
108 </ul>
109 <li>Destination direction by means of:</li>
110 <ul>
111 <li>angle between the new segment and the previous one;</li>
112 <li>perpendicular to the previous segment (same as previous, but the angle
113 is predefined and is equal to 90 degrees);</li>
114 <li>tangent to the previous segment;</li>
115 <li>vector components DX, DY.</li>
116 </ul>
117 <li>Parameters of an element (for segment : length or target X or Y coordinate value, for arc : radius, angle or center coordinates).</li>
118 </ol>
119
120 \b Buttons:
121
122 <b>"Restore"</b> button orientates the viewer correspondingly to the chosen working plane and fits the scene to show all its objects. 
123 \n <b>"Close"</b> button applies the wire, only the red part will be built.
124 \n <b>"Sketch Closure"</b> will close the Sketch by a straight line
125 from the last red part and apply it.
126
127 \n To draw a \b rectangle:
128
129 <ol>
130 <li> In the <b>Element Type</b> part of the dialog box select \image html rectangle_icon.png </li>
131
132 <li> Draw a rectangle with the mouse directly in the view or fill in the coordinates of two opposite vertices of the rectangle.</li>
133 <li> <b>Apply and Close</b> </li>
134 </ol>
135
136 \n <b>Dialog Box:</b>
137
138 \image html sketcher_dlg2.png
139
140 \n <b>Arguments:</b>
141 <ol>
142 <li>Coordinate system (Existing Local CS or Global CS can be selected)</li>
143 <li>A plane or a planar face to define a new Local Coordinate System
144 <li>Element type (segment, arc or rectangle).</li>
145 <li>The X,Y coordinates of two opposite vertices of the rectangle</li>
146 </ol>
147
148
149 \n <b>TUI Command:</b> <em>geompy.MakeSketcherOnPlane(Command, WorkingPlane)</em>
150 \n This algorithm creates a sketcher (wire or face), following the
151 textual description, passed through the Command argument. The edges of
152 the resulting wire or face will be arcs of circles and/or linear
153 segments.
154 \n \em Command is a string, defining the sketcher by the coordinates of
155 points in the current LCS.
156 \n <em>WorkingPlane</em> can be a Local CS, a plane, or a planar face.
157
158
159 Our <b>TUI Scripts</b> provide you with useful examples of the use of
160 \ref tui_sketcher_page "Sketcher".
161
162 A wrapper also exists to help in the construction of a sketcher using simple commands.
163 The description of this wrapper can be found in the <a class="el" target="_new" href="../../tui/GEOM/docutils/docapi.html#module-salome.geom.sketcher">
164 dedicated page</a> of the <a class="el" target="_new" href="../../tui/GEOM/docutils/index.html">salome.geom python package</a>.
165
166 */