Salome HOME
merge V7_7_BR suite
[modules/smesh.git] / doc / salome / gui / SMESH / input / sewing_meshes.doc
1 /*!
2
3 \page sewing_meshes_page Sewing meshes
4
5 \n In SMESH you can sew elements of a mesh. The current
6 functionality allows you to sew:
7 <ul>
8 <li>\ref free_borders_anchor "Free borders"</li>
9 <li>\ref conform_free_borders_anchor "Conform free borders"</li>
10 <li>\ref border_to_side_anchor "Border to side"</li>
11 <li>\ref side_elements_anchor "Side elements"</li>
12 </ul>
13
14 \image html sewing.png "Sewing button"
15
16 <em>To sew elements of a mesh:</em>
17 <ol>
18 <li>From the \b Modification menu choose the \b Transformation item
19 and from its sub-menu select the \b Sewing item.</li>
20 <li>Check in the dialog box one of the radio buttons corresponding to
21 the type of sewing operation you would like to perform.</li>
22 <li>Fill the other fields available in the dialog box.</li>
23 <li>Click the \b Apply or <b>Apply and Close</b> button to perform the
24   operation of sewing.</li>
25 </ol>
26
27
28 <br>
29 \anchor free_borders_anchor
30 <h2>Sew free borders</h2>
31
32 This functionality allows you to unite free borders of a 2D mesh.
33
34 There are two working modes: \a Automatic and \a Manual. In the \b
35 Automatic mode, the program finds free borders coincident within a
36 specified tolerance and sews them. Optionally it is possible to
37 visually check and correct is necessary the found free borders before
38 sewing. <br>
39 In the \b Manual mode you are to define borders to sew by picking
40 three nodes of each of two borders.
41
42 \image html sewing1.png
43 <center>Default mode is \a Automatic</center>
44
45 To use \b Automatic sewing:
46 <ul>
47 <li>Specify a mesh you want to sew by selecting it or any its part
48   (group or sub-mesh) in the Object Browser or in the VTK Viewer.</li>
49 <li>Specify the \b Tolerance within which free borders are considered
50   coincident. At the default zero \b Tolerance, the tolerance used by
51   the search algorithm is defined as one tenth of an average size of
52   elements adjacent to free borders being compared.</li>
53 <li>To visually check the coincident free borders found by the
54   algorithm, switch off <b>Auto Sewing</b> check-box. Then controls
55   to adjust groups of coincident free borders will become available in
56   the dialog.</li>
57
58 \image html sewing_auto.png
59 <center>Controls to adjust groups of coincident free borders</center>
60
61 <li>\b Detect button launches the algorithm of search of coincident
62   free borders.</li>
63 <li>The found groups of <b>Coincident Free Borders</b> are shown in a
64   list, a group per a line. Each group has its own color which is used
65   to display the borders of the group in the VTK Viewer. A free border
66   within a group is designated by IDs of its first, second and last
67   nodes within parenthesis. All borders present in the list will be
68   sewn upon \b Apply.</li>
69 <li>\b Remove button removes selected groups from the list.</li>
70 <li><b>Select All</b> check-box selects all groups in the list.</li>
71 <li>When a group is selected, its borders appear in <b>Edit Selected
72     Group</b> list that allows you to change this group.</li>
73 <li>
74 \image html sort.png
75 <em>Set First</em> button moves the selected border to the
76   first position in the group, as a result other borders will be moved
77   to this border during sewing.
78 </li><li>
79 \image html remove.png
80 <em>Remove Border</em> button removes selected borders from the
81   group. It is active if there are more than two borders in the group.
82 </li>
83 <li>Selection of a border in the list allows to change its first and
84   last nodes whose IDs appear in two fields below the list. \a Arrow
85   buttons near each field move the corresponding end node by
86   number of nodes defined by \b Step field.</li>
87 <li>
88 \image html swap.png
89 <em>Swap</em> button swaps the first and last nodes of a
90   selected border.
91 </li>
92 </ul>
93
94 For sewing free borders manually you should switch the \b Mode to \b
95 Manual and define three points on each border: first, second and the
96 last node:
97
98 \image html sewing_manual.png
99 <ul>
100 <li>the first node specifies beginning of the border;</li>
101 <li>the second node specifies the part of the border which should be
102 considered (as far as the free border usually forms a closed
103 contour);</li>
104 <li>the last node specifies the end of the border.</li>
105 </ul>
106
107 You can select these nodes in the 3D viewer or define by its id.
108
109 The first and the second nodes should belong to the same link of a
110 face. The second and the last nodes of a border can be the same. The
111 first and the last nodes of two borders can be the same. The
112 corresponding end nodes of two borders will be merged. Intermediate
113 nodes of two borders will be either merged or inserted into faces of
114 the opposite border.
115
116 In practice the borders to sew often coincide and in this case it is
117 difficult to specify the first and the last nodes of a border since
118 they coincide with the first and the last nodes of the other
119 border. To cope with this,
120 \ref merging_nodes_page "merge" coincident nodes into one
121 beforehand. Two figures below illustrate this approach.
122 \image html sew_using_merge.png "Merge coincident nodes which are difficult to distinguish"
123 <br>
124 \image html sew_after_merge.png "After merging nodes it is easy to specify border nodes"
125
126 The sewing algorithm is as follows:
127 <ol>
128 <li>The parameter (U) of each node within a border is computed. So
129 that the first node has U=0.0, the last node has U=1.0, for the rest
130 nodes 0.0 < U < 1.0;</li>
131 <li>Compare node parameters of the two borders. If two nodes of the
132 opposite borders have close parameters, they are merged, i.e. a node
133 of the first border is replaced in all elements by a node of the
134 second border. If a node has no node with a close parameter in the
135 opposite border, it is inserted into an edge of element of the
136 opposite border, an element is split. Two nodes are considered close
137 enough to merge, if difference of their parameters is less than one
138 fifth of minimum length of adjacent face edges on the borders.</li>
139 </ol>
140
141 \image html image22.jpg "Sewing free borders"
142
143 <b>See Also</b> a sample TUI Script of a 
144 \ref tui_sew_free_borders "Sew Free Borders" operation.
145
146 <br>
147 \anchor conform_free_borders_anchor
148 <h2>Sew conform free borders</h2>
149
150 This functionality can be used to unite two free borders of a 2D mesh.
151
152 \image html sewing2.png
153
154 The borders of meshes for sewing are defined as for "Sew free borders"
155 except that the second free border is not limited and can be defined
156 by the first and the second nodes only. The first nodes of two borders
157 can be the same.
158
159 The algorithm is following: counting nodes starting at the first ones,
160 the n-th node of the first border is merged with the n-th node of the
161 other border, until the end of either of borders. Nodes of the first
162 border are replaced in all elements with corresponding nodes of the
163 second border.
164 \n For sewing conform free borders you should define three points on
165 the first border and two points on the second one. User can select
166 these nodes in 3D viewer or define node by its id.
167
168 \image html image23.jpg "Sewing conform free borders"
169
170 <b>See Also</b> a sample TUI Script of a 
171 \ref tui_sew_conform_free_borders "Sew Conform Free Borders"
172 operation.
173
174 <br>
175 \anchor border_to_side_anchor
176 <h2>Sew border to side</h2>
177
178 "Sew border to side" is intended to sew a free border to a mesh
179 surface.
180 \n The free border is defined as for "Sewing of free borders". The
181 place where to sew the border is defined by two nodes, between which
182 the border faces are placed, so that the first border node is merged
183 with the first node on the side and the last node of the border is
184 merged with the second specified node on the side.
185
186 \image html sewing3.png
187
188 The algorithm is following.
189 <ol>
190 <li>Find a sequence of linked nodes on the side such that the found
191 links to be most co-directed with the links of the free border.</li>
192 <li>Sew two sequences of nodes using algorithm of "Sewing of free berders".
193 \n For sewing border to side you should define three points on the
194 border and two points on the side. User can select these nodes in 3D
195 viewer or define node by its id.</li>
196 </ol>
197
198 \image html image30.jpg "Sewing border to side"
199
200 <b>See Also</b> a sample TUI Script of a 
201 \ref tui_sew_meshes_border_to_side "Sew Border to Side" operation.  
202
203 <br>
204 \anchor side_elements_anchor
205 <h2>Sew side elements</h2>
206
207 This operation is intended to unite two mesh surfaces.
208
209 \image html sewing4.png 
210
211 Surfaces may be defined by either 2d or 3d elements. The number of
212 given elements of the sides must be the same. The sets of given
213 elements must be topologically equal, i.e. each node of one element
214 set must have a corresponding node in the other element set and
215 corresponding nodes must be equally linked. If there are 3d elements
216 in a set, only their free faces must obey to that rule.
217 \n Two corresponding nodes on each side must be specified. They must
218 belong to one element and must be located on an element set boundary.
219
220 Sewing algorithm finds and merges the corresponding nodes starting
221 from the specified ones.
222
223 \image html image31.jpg "Step-by-step sewing process"
224
225 \image html image32.jpg "The result of side elements sewing"
226
227 For sewing side elements you should define elements for sewing and two
228 nodes for merging on the each side. User can select these elements and
229 nodes in 3D viewer or define them by its id.
230
231 <b>See Also</b> a sample TUI Script of a 
232 \ref tui_sew_side_elements "Sew Side Elements" operation.  
233
234 */