Salome HOME
Correct documentation bugs, adapt for 'Read The Docs' theme (bos #18858)
[modules/shaper.git] / src / SketchPlugin / doc / SketchPlugin.rst
1
2 .. _sketchPlugin:
3
4
5 Sketch plug-in
6 ================
7
8 .. |SketchButton.icon|    image:: images/SketchButton.png
9
10 Sketch plug-in includes features for creation of 2D shapes.
11
12 The sketch creation takes the following steps:
13
14 - definition of sketch plane;
15 - creation of sketch objects from scratch;
16 - generation of sketch objects via operations on the existing operations;
17 - definition of constraints.
18
19 Sketch can be created in the active part or in a partset (if there is no active part).
20
21 To create a Sketch:
22
23 #. select in the Main Menu *Sketch - > Sketch* item  or
24 #. click |SketchButton.icon| **Sketch** button in Sketch toolbar:
25
26 First define a plane for the sketch:
27
28 .. image:: images/PlaneDefinition.png
29    :align: center
30
31 - specify plane size (equal to 25 in the example above);
32 - select the appropriate plane in the viewer.
33
34 Note that coordinate planes will be suggested for selection if no convenient objects for plane selection are displayed in the viewer:
35
36 .. image:: images/CoordinatePlanes.png
37    :align: center
38
39 After the plane for sketch is selected, the following property panel will be opened:
40
41 .. image:: images/SketchPanel.png
42    :align: center
43
44 .. centered::
45   Sketch general panel
46
47 - **Reversed** check box - allows reversing the sketch plane normal;
48 - **Set plane view** button - switches the viewer to the top view for the sketch plane;
49 - **Show geometrical constraints** check box - displays/hides geometrical constraints:
50 - **Show dimensional constraints** check box - displays/hides dimensional constraints; 
51 - **Show existing expressions** check box - displays/hides expressions.
52 - **Show free points** check box - highlights free points in the current sketch if it is checked.
53 - **Automatic constraints** - automatically create horizontal or vertical constraints if angle between created line and horizontal or vertical less then angular tolerance (defined in preferences).
54 - **Change sketch plane** button - allows to change working plane of the current sketch.
55 - **Show remaining DoFs** button - highlights all sketch edges which are not fully constrained.
56
57 Now it is possible to:
58
59 - create :ref:`sketch objects <sketch_objects>`
60 - create :ref:`constraints <sketch_constraints>`
61 - perform :ref:`sketch operations <sketch_operations>`
62
63 To apply or cancel sketch creation use Apply and Cancel buttons from the
64 Sketch panel as well as equivalent buttons from Sketch toolbar.
65
66 The Result of operation will be a COMPOUND. In the object tree, Result node is located in
67 **Constructions** folder.
68
69 The Name is assigned automatically: **Sketch_1**, **Sketch_2**, ... both for Feature and Result.
70
71 **TUI Command**:
72
73 .. py:function:: model.addSketch(PartOrPartSet, plane)
74
75     :param part: The current part object.
76     :param object: A plane.
77     :return: Result object.
78
79 .. _sketch_objects:
80
81 Sketch objects
82 --------------
83
84 The plug-in includes the following features for creation of 2D objects:
85
86 .. toctree::
87    :maxdepth: 1
88
89    pointFeature.rst
90    lineFeature.rst
91    rectangleFeature.rst
92    circleFeature.rst
93    arcFeature.rst
94    ellipseFeature.rst
95    arcEllipseFeature.rst
96    bsplineFeature.rst
97
98 .. _sketch_constraints:
99
100 Constraints
101 -----------
102
103 Constraints are available and viewable during sketch creation or editing.
104
105 The goal of constraints creation is to fix sketch geometry, i.e. set degrees of freedom to zero.
106
107 If all degrees of freedom are eliminated, the sketch is fixed and displayed with green color.
108
109 .. image:: images/Sketch_fixed.png
110    :align: center
111
112 .. centered::
113   Fixed Sketch
114
115 If any degrees of freedom remain unsolved, the sketch is under-constrained and displayed with red color.
116
117 .. image:: images/Sketch_underconstrained.png
118    :align: center
119
120 .. centered::
121   Underconstrained Sketch
122
123 The plug-in includes the following constraints:
124
125 .. toctree::
126    :maxdepth: 1
127
128    distanceFeature.rst
129    horizontalDistFeature.rst
130    verticalDistFeature.rst
131    lengthFeature.rst
132    angleFeature.rst
133    radiusFeature.rst
134    horizontalFeature.rst
135    verticalFeature.rst
136    fixedFeature.rst
137    parallelFeature.rst
138    perpendicularFeature.rst
139    tangentFeature.rst
140    coincedentFeature.rst
141    middleFeature.rst
142    equalFeature.rst
143    collinearFeature.rst
144
145 .. _sketch_operations:
146
147 Overconstraned state
148 --------------------
149
150 Sketcher comes into overconstrained state when an extra constraint was defined. The following picture shows an example of the overconstrained state:
151
152 .. image:: images/Overconstrained.png
153    :align: center
154
155 .. centered::
156   Overconstrained Sketch
157
158 When Sketcher gets this state then:
159
160 - buttons Apply and Cancel for the whole Sketcher are blocked;
161 - a constraint which causes the overconstraint state is highlightid by red color;
162 - a warning message in sketcher Property Panel is shown with recomendation what to do in this case;
163 - an additional Undo button is shown under the warning messages;
164
165 After undoing the last operation or deletion of a conflicting constraint Sketcher will be reverted into a normal state.
166
167 Operations
168 ----------
169 Operations modify existing features of the sketch or create new ones by copying them.
170
171 The plug-in includes the following operations:
172
173 .. toctree::
174    :maxdepth: 1
175
176    filletFeature.rst
177    splitFeature.rst
178    trimFeature.rst
179    projectionFeature.rst
180    intersectionFeature.rst
181    mirrorFeature.rst
182    translationFeature.rst
183    rotationFeature.rst
184    sketchDrawer.rst
185    sketchCopy.rst