Salome HOME
Revert "Synchronize adm files"
[modules/geom.git] / doc / salome / gui / GEOM / input / creating_sketcher.doc
index 88629274f780ddd10016267f573c5e8968457c10..159361772d2516a72ac5fb73c115142fa8c863ba 100644 (file)
 /*!
 
-\page create_sketcher_page Sketcher
-
-Sketcher allows to create curves of 2 types: line segment and arc.
-By default the start point of the curve is located at the point of
-origin of the reference coordinate system and the curve lies in the
-plane XOY.  The end of the curve is defined by
-means of "destination", which can be a destination point (for segment
-only) or destination direction coupled with length of a segment or
-angle and radius of an arc.
-
-\n Sketcher is able to create planar curves only. Therefore, it is
-necessary to select a working plane before starting a sketch (by
-default, XOY plane is used). Sketcher creates curves lying in the
-current working plane (New Entity -> Basic -> Working Plane).
-
-\n This functionality is available from the main menu via <em>New
-Entity / Sketch</em>.
-
-\n The Result of the operation will be a \b GEOM_Object.
-
-\n <b>TUI Command:</b> <em>geompy.MakeSketcher(Command, WorkingPlane)</em>
-\n This algorithm creates a sketcher (wire or face), following the
-textual description, passed through the Command argument. The edges of
-the resulting wire or face will be arcs of circles and/or linear
-segments.
-\n \em Command is a string, defining the sketcher by the coordinates of
-points in the local working plane.
-\n <em>WorkingPlane</em> can be a plane or a planar face. The plane is
-defined by the XYZ coordinates of three non-coincident points. The
-planar face is an existing GEOM_Object.
-
-\n <b>Arguments:</b>
-<ol>
-<li>Element type (segment or arc).</li>
-<li>Destination type (point or direction).</li>
-<li>Destination point by means of:</li>
-<ul>
-<li>absolute coordinates X,Y;</li>
-<li>relative coordinates DX, DY (with respect to the current point);</li>
-<li>selection of an existing point.</li>
-</ul>
-<li>Destination direction by means of:</li>
-<ul>
-<li>angle between the new segment and the previous one;</li>
-<li>perpendicular to the previous segment (same as previous, but angle
-is predefined and is equal to 90 degrees);</li>
-<li>tangent to the previous segment;</li>
-<li>vector components DX, DY.</li>
-</ul>
-<li>Parameters of an element (for segment : length or target X or Y coordinate value, for arc : radius and angle).</li>
-</ol>
-
-\n <b>Dialog Box:</b>
-
-\image html neo-scetcher1.png
-
-\image html neo-scetcher2.png
-
-\n <b>Example:</b>
-
-\image html image204.jpg
-
-\image html image206.jpg
+\page create_sketcher_page 2D Sketcher
 
-Our <b>TUI Scripts</b> provide you with useful examples of the use of
-\ref tui_sketcher_page "Sketcher".
+The 2D Sketcher allows drawing  arbitrary 2D shapes. 
+
+To create a <b>2D Sketch</b> select in the main menu  <b>New Entity -> Basic -> 2D Sketch</b>. 
+
+\image html sketcher_dlg.png
+
+At first it is necessary to define the reference coordinate system, where the sketch will be created:
+- 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). 
+- 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.
+- 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.  
+- <b>Restore</b> button orientates the viewer correspondingly to the chosen working plane and fits the scene to show all objects. 
+
+It is possible to create sketches of two types:
+- \b Profiles made of <b>line segments</b> and \b arcs, or 
+- \b Rectangles. 
+
+<h2>Creation of a Profile by straight segments</h2>
+
+- Choose \b segment radio button to start a \b profile.
+
+- 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: 
+
+  - 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:
+  \image html 2dsketch1.png
+  
+  - 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. 
+  \image html 2dsketch2.png
+
+  - 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.
+  \image html 2dsketch3.png
+
+- Define the next point. Together these two points form the first segment of the sketch.
+
+Alternatively to the definition by \b Points it is possible to define segments by \b Direction and \b Distance.  
+- The \b Direction can be:
+
+  - Defined by an \b Angle to the previous segment.
+  \image html 2dsketch4.png
+  
+  - \b Perpendicular to the previous segment (i.e. the Angle is 90 degrees).
+  \image html 2dsketch5.png
+  
+  - \b Tangent (collinear) to the previous segment (i.e. the Angle is 0 degrees).
+  \image html 2dsketch6.png
+  
+  - Defined by <b>VX-VY</b> vector coordinates.   
+  \image html 2dsketch7.png
+       
+- The \b Distance can be defined: 
+
+  - By the absolute segment \b Length
+  - By \b DX - the length of segment projection on X-axis. 
+  - By \b DY - the length of segment projection on Y-axis. 
+       
+- Proceed with creation of the sketch segments and click \b Apply after each step. The drawn segments will be displayed in the viewer. 
+- Use \b Undo and \b Redo buttons to cancel an erroneously applied segment or to restore it. 
+- To finalize, click <b>"Close"</b> button to apply the created wire "as is". 
+- Alternatively, click <b>"Sketch Closure"</b> to close the Sketch by a straight line
+from the last created segment to the start point and apply it.
+
+<h2>Creation of a Profile by ark segments </h2>
+
+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. 
 
+\image html 2dsketch10.png "Ark segments"
+       
+- 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.
+
+\image html 2dsketch12.png
+
+- \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. 
+       
+\image html 2dsketch8.png
+
+- 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.
+       
+\image html 2dsketch9.png 
+       
+<h2>Creation of a Rectangle profile</h2>
+
+\n To draw a \b rectangle, select a \b rectangle radio button.
+
+\image html sketcher_dlg2.png
+
+Draw a rectangle with the mouse directly in the view or input the coordinates of its two opposite vertices in the dialog.
+
+<h2>TUI Commands</h2>
+
+<em>geompy.MakeSketcherOnPlane(Command, WorkingPlane)</em>
+
+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.
+
+- \em Command is a string, defining the sketcher by the coordinates of points in the current LCS.
+- <em>WorkingPlane</em> can be a Local CS, a plane, or a planar face.
+
+Another way to create the 2D Sketcher in TUI is using Sketcher2D interface.
+
+<em>sk = geompy.Sketcher2D()</em> - returns an instance of Sketcher2D interface <i>sk</i>.
+
+\image html sketch_example.png
+
+See the \ref gsketcher.Sketcher2D "Sketcher2D" interface documentation for more information.
+
+Our <b>TUI Scripts</b> provide you with useful examples of the use of
+\ref tui_sketcher_page "2D Sketcher".
 */