Salome HOME
Update of CheckDone
[modules/smesh.git] / doc / salome / gui / SMESH / input / extrusion.rst
1 .. _extrusion_page:
2
3 *********
4 Extrusion
5 *********
6
7 Extrusion is used to build mesh elements of plus one dimension than the input ones. Boundary elements around generated mesh of plus one dimension are additionally created. All created elements can be automatically grouped. Extrusion can be used to create a :ref:`structured mesh from scratch <extrusion_struct>`.
8
9 .. image:: ../images/extrusion_box.png
10         :align: center
11
12 .. centered::
13         If you extrude several quadrangles, you get exactly the same mesh as if you meshed a geometrical box (except for that the initial quadrangles can be incorrectly oriented): quadrangles and segments are created on the boundary of the generated mesh
14
15 Any node, segment or 2D element can be extruded. Each type of elements is extruded into a corresponding type of result elements:
16
17 +----------------------+--------------------+
18 | **Extruded element** | **Result element** |
19 +======================+====================+
20 |Node                  | Segment            |
21 +----------------------+--------------------+
22 |Segment               | Quadrilateral      |
23 +----------------------+--------------------+
24 |Triangle              | Pentahedron        |
25 +----------------------+--------------------+
26 |Quadrilateral         | Hexahedron         |
27 +----------------------+--------------------+
28 |Polygon               | Polyhedron         |
29 +----------------------+--------------------+
30 |Hexagonal polygon     | Hexagonal prism    |
31 +----------------------+--------------------+
32
33
34 When 2D elements are extruded, in addition to 3D elements segments are created on the ribs of the resulting 3D mesh. Free edges of input 2D elements generate logically horizontal rib segments. Logically vertical rib segments are generated from the nodes belonging to a sole input 2D element (the figure below illustrates this rule).
35
36 .. image:: ../images/extru_rib_segs.png
37         :align: center
38
39 .. centered::
40         Two triangles extruded: no vertical rib segments generated from nodes #2 and #3 as they are shared by both triangles
41
42
43 *To use extrusion:*
44
45 .. |img| image:: ../images/image91.png
46 .. |sel_img| image:: ../images/image120.png
47
48 #. From the **Modification** menu choose the **Extrusion** item or click *"Extrusion"* button |img| in the toolbar. 
49
50    The following dialog will appear:
51
52         .. image:: ../images/extrusionalongaline1.png
53                 :align: center
54
55
56 #. In this dialog:
57
58         * Use *Selection* button |sel_img| to specify what you are going to select at a given moment, **Nodes**, **Edges** or **Faces**.
59   
60         * Specify **Nodes**, **Edges** and **Faces**, which will be extruded, by one of following means:
61                 * **Select the whole mesh, sub-mesh or group** activating the corresponding check-box.
62                 * Choose mesh elements with the mouse in the 3D Viewer. It is possible to select a whole area with a mouse frame. 
63                 * Input the element IDs directly in **Node IDs**, **Edge IDs** and **Face IDs** fields. The selected elements will be highlighted in the viewer, if the mesh is shown there. 
64                 * Apply Filters. **Set filter** button allows to apply a filter to the selection of elements. See more about filters in the :ref:`filtering_elements` page. 
65
66         * If the **Extrusion to distance** radio button is selected 
67                 * specify the translation vector by which the elements will be extruded.
68
69         * If the **Extrusion along vector** radio button is selected
70
71                 .. image:: ../images/extrusionalongaline2.png  
72                         :align: center
73     
74                 * specify the components of the **Vector** along which the elements will be extruded, either directly or by selecting the mesh face (the normal to the face will define the vector),
75                 * specify the **Distance** of extrusion along the vector (it can be negative).
76     
77   
78
79         * If the **Extrusion by normal** radio button is selected, every node of the selected faces is extruded along the *average* of the *normal* vectors to the faces sharing the node. (Nodes and edges cannot be extruded in this mode.)
80
81                 .. image:: ../images/extrusionalongaline3.png 
82                         :align: center
83     
84                 * Specify the **Distance** of extrusion (it can be negative),
85                 * Use **Along average normal** check-box to specify along which vector the distance is measured.
86                 * If it is *activated* the distance is measured along the average normal mentioned above. 
87                 * If it is *deactivated* every node is extruded along the average normal till its intersection with a virtual plane obtained by translation of the face sharing the node along its own normal by the **Distance**.
88         
89                 The picture below shows a cross-section of a 2D mesh extruded with **Along average normal** activated (to the left) and deactivated (to the right). 
90
91                 .. image:: ../images/extrusionbynormal_alongavgnorm.png
92                         :align: center
93
94                 .. centered::
95                         'Along average normal' activated (to the left) and deactivated (to the right)
96
97
98
99                 * **Use only input elements** check-box specifies what elements will be used to compute the average normal.
100
101                   * If it is *activated* only selected faces, among faces sharing the node, are used to compute the average normal at the node. 
102                   * Else all faces sharing the node are used.
103
104                   The picture below shows a cross-section of a 2D mesh the upper plane of which is extruded with **Use only input elements** activated (to the left) and deactivated (to the right). 
105
106         .. image:: ../images/extrusionbynormal_useonly.png
107                 :align: center
108
109         .. centered::
110                 'Use only input elements' activated (to the left) and deactivated (to the right)
111   
112   
113         .. |add| image:: ../images/add.png
114         .. |rm| image:: ../images/remove.png
115
116
117         * Specify the **Number of steps**.
118         * Optionally specify **Scale factors**. Each scale factor in the list is applied to nodes of a corresponding extrusion step unless **Linear variation of factors** is checked, is which case the scale factors are spread over all extrusion steps.
119                 * **Base point** serving as a scaling canter can be defined either using spin boxes or by picking a node in the Viewer or by picking a geometrical vertex in the Object Browser.
120                 * **Add** button |add| adds a scale factor to the list.   
121                 * **Remove** button |rm| removes selected scale factors from the list.
122
123         * The elements can also be rotated around the **Base point** to get the resulting mesh in a helical fashion. You can set the values of **Rotation angles** to the list by pressing the *"Add"* button |add| and remove them from the list by pressing the *"Remove"* button |rm|.
124
125           **Linear variation of angles** option allows defining the angle of gradual rotation for the whole path. At each step the elements will be rotated by *( angle / nb. of steps )*.
126
127         * If you activate **Generate Groups** check-box, the *result elements* created from *selected elements* contained in groups will be included into new groups named by pattern "<old group name>_extruded" and "<old group name>_top". For example if a selected quadrangle is included in *g_Faces* group (see figures below) then result hexahedra will be included in *g_Faces_extruded* group and a quadrangle created at the "top" of extruded mesh will be included in *g_Faces_top group*.  
128
129                 .. image:: ../images/extrusion_groups.png
130                         :align: center
131
132                 .. image:: ../images/extrusion_groups_res.png
133                         :align: center
134
135           This check-box is active only if there are some groups in the mesh.
136   
137
138
139 #. Click **Apply** or **Apply and Close**  button to confirm the operation.
140
141 .. _extrusion_struct:
142
143 Example: creation of a structured mesh from scratch
144 ###################################################
145
146 .. image:: ../images/image75.jpg
147         :align: center
148
149 .. centered::
150         A node is extruded into a line of segments
151
152 .. image:: ../images/image76.jpg
153         :align: center
154
155 .. centered::
156         The line of segments is extruded into a quadrangle mesh
157
158 .. image:: ../images/image77.jpg
159         :align: center
160
161 .. centered::
162         The quadrangle mesh is revolved into a hexahedral mesh
163
164
165 **See Also** a sample TUI Script of an :ref:`tui_extrusion` operation. 
166
167