Salome HOME
ce7b6fd1920467a943cc0457e7826acf463c0bfe
[modules/shaper.git] / src / SketchPlugin / doc / SketchPlugin.rst
1
2 .. _sketchPlugin:
3 .. |SketchButton.icon|    image:: images/SketchButton.png
4
5
6 Sketch plug-in
7 ================
8
9 Sketch plug-in includes features for creation of 2D shapes.
10
11 The sketch creation takes the following steps:
12
13 - definition of sketch plane;
14 - creation of sketch objects from scratch;
15 - generation of sketch objects via operations on the existing operations;
16 - definition of constraints.
17
18 Sketch can be created in the active part or in a partset (if there is no active part).
19
20 To create a Sketch:
21
22 #. select in the Main Menu *Sketch - > Sketch* item  or
23 #. click |SketchButton.icon| **Sketch** button in Sketch toolbar:
24
25 First define a plane for the sketch:
26
27 .. image:: images/PlaneDefinition.png
28    :align: center
29
30 - specify plane size (equal to 25 in the example above);
31 - select the appropriate plane in the viewer.
32
33 Note that coordinate planes will be suggested for selection if no convenient objects for plane selection are displayed in the viewer:
34
35 .. image:: images/CoordinatePlanes.png
36    :align: center
37
38 After the plane for sketch is selected, the following property panel will be opened:
39
40 .. image:: images/SketchPanel.png
41    :align: center
42
43 .. centered::
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
52 Now it is possible to:
53
54 - create :ref:`sketch objects <sketch_objects>`
55 - create :ref:`constraints <sketch_constraints>`
56 - perform :ref:`sketch operations <sketch_operations>`
57
58 To apply or cancel sketch creation use Apply and Cancel buttons from the
59 Sketch panel as well as equivalent buttons from Sketch toolbar.
60
61 The Result of operation will be a COMPOUND. In the object tree, Result node is located in
62 **Constructions** folder.
63
64 The Name is assigned automatically: **Sketch_1**, **Sketch_2**, ... both for Feature and Result.
65
66 **TUI Command**:
67
68 .. py:function:: model.addSketch(PartOrPartSet, plane)
69
70     :param part: The current part object.
71     :param object: A plane.
72     :return: Result object.
73
74 .. _sketch_objects:
75
76 Sketch objects
77 --------------
78
79 The plug-in includes the following features for creation of 2D objects:
80
81 .. toctree::
82    :maxdepth: 1
83
84    pointFeature.rst
85    lineFeature.rst
86    rectangleFeature.rst
87    circleFeature.rst
88    arcFeature.rst
89
90 .. _sketch_constraints:
91
92 Constraints
93 -----------
94
95 Constraints are available and viewable during sketch creation or editing.
96
97 The goal of constraints creation is to fix sketch geometry, i.e. set degrees of freedom to zero.
98
99 If all degrees of freedom are eliminated, the sketch is fixed and displayed with green color.
100
101 .. image:: images/Sketch_fixed.png
102    :align: center
103
104 .. centered::
105   Fixed Sketch
106
107 If any degrees of freedom remain unsolved, the sketch is under-constrained and displayed with red color.
108
109 .. image:: images/Sketch_underconstrained.png
110    :align: center
111
112 .. centered::
113   Underconstrained Sketch
114
115 The plug-in includes the following constraints:
116
117 .. toctree::
118    :maxdepth: 1
119
120    distanceFeature.rst
121    horizontalDistFeature.rst
122    verticalDistFeature.rst
123    lengthFeature.rst
124    angleFeature.rst
125    radiusFeature.rst
126    horizontalFeature.rst
127    verticalFeature.rst
128    fixedFeature.rst
129    parallelFeature.rst
130    perpendicularFeature.rst
131    tangentFeature.rst
132    coincedentFeature.rst
133    middleFeature.rst
134    equalFeature.rst
135    collinearFeature.rst
136
137 .. _sketch_operations:
138
139 Operations
140 ----------
141 Operations modify existing features of the sketch or create new ones by copying them.
142
143 The plug-in includes the following operations:
144
145 .. toctree::
146    :maxdepth: 1
147
148    filletFeature.rst
149    splitFeature.rst
150    trimFeature.rst
151    projectionFeature.rst
152    intersectionFeature.rst
153    mirrorFeature.rst
154    translationFeature.rst
155    rotationFeature.rst
156    sketchDrawer.rst