Salome HOME
Merge commit 'f709219506b7cd587e94abc5ebed18d629df92d8'
[modules/shaper.git] / src / SketchPlugin / doc / rectangleFeature.rst
1 .. _create_sketch_rectangle:
2
3 Rectangle
4 =========
5
6 .. |rectangle.icon|    image:: images/Rectangle.png
7
8 Rectangle feature creates a rectangle by two opposite points in the current Sketch.
9
10 The result is represented in form of four Lines which compose a rectangle.
11 Two lines have Vertical constraint and two others have Horizontal constraint.
12
13 To add a new Rectangle to the Sketch:
14
15 #. select in the Main Menu *Sketch - > Rectangle* item  or
16 #. click |rectangle.icon| **Rectangle** button in Sketch toolbar:
17
18 There are 2 algorithms for creation of a Rectangle:
19
20 .. figure:: images/rectangle_start_end.png
21    :align: left
22    :height: 24px
23
24 **By start and end points** creates a rectangle with the given two corners points.
25
26 .. figure:: images/rectangle_center_end.png
27    :align: left
28    :height: 24px
29
30 **By center and end point** creates a rectangle with center and end point as corner.
31
32 -------------------------------------------------------------------------------------------
33
34 By start and end points
35 """"""""""""""""""""""""""
36
37 .. figure:: images/Rectangle_start_end_panel.png
38    :align: center
39
40    Rectangle
41
42 Click in the view once to set the first corner, then move the mouse and click a second time to set the opposite corner.
43 If an existing object is clicked, a constraint for the point will be created automatically.
44
45 Start and end points coordinates are displayed in the property panel.
46
47 **TUI Command**:
48
49 .. py:function:: Sketch_1.addRectangle(X1, Y1, X2, Y2)
50
51     :param real: X1 corner X value.
52     :param real: Y1 corner Y value.
53     :param real: X2 opposite corner X value.
54     :param real: Y2 opposite corner Y value.
55     :return: Result object.
56
57 By center and end point
58 """"""""""""""""""""""""""
59
60 .. figure:: images/Rectangle_center_end_panel.png
61    :align: center
62
63    Rectangle
64
65 Click in the view once to set the center, then move the mouse and click a second time to set the corner.
66 If an existing object is clicked, a constraint for the point will be created automatically.
67
68 Center and end points coordinates are displayed in the property panel.
69
70 **TUI Command**:
71
72 .. py:function:: Sketch_1.addRectangleCentered(X1, Y1, X2, Y2)
73
74     :param real: X1 center X value.
75     :param real: Y1 center Y value.
76     :param real: X2 corner X value.
77     :param real: Y2 corner Y value.
78     :return: Result object.
79
80 Result
81 """"""
82
83 Created rectangle appears in the view.
84
85 .. figure:: images/Rectangle_res2.png
86    :align: center
87
88    Rectangles created
89
90 **See Also** a sample TUI Script of :ref:`tui_create_rectangle` operation.