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