Salome HOME
tutoriel anglais en cours
[modules/hydro.git] / doc / salome / tutorial / english / english_polylignes.rst
1 ..
2    Copyright (C) 2015-2016 EDF
3
4    This file is part of SALOME HYDRO module.
5
6    SALOME HYDRO module is free software: you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation, either version 3 of the License, or
9    (at your option) any later version.
10
11    SALOME HYDRO module is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with SALOME HYDRO module.  If not, see <http://www.gnu.org/licenses/>.
18
19 #########################################
20 Creation / modification of polylines
21 #########################################
22
23 .. |contour_garonne| image:: /../_static/contourGaronne.png
24    :align: middle
25
26 .. |contour_lit_majeur| image:: /../_static/contourLitMajeur.png
27    :align: middle
28
29 .. |icone_polyligne_xy| image:: /../_static/icon_polyline_xy.png
30    :align: middle
31
32 .. |createPolyligneDialogue1| image:: /../_static/createPolyligneDialogue1.png
33    :align: middle
34
35 .. |insertNewSection| image:: /../_static/insertNewSection.png
36    :align: middle
37
38 .. |createPolyligneDialogue2| image:: /../_static/createPolyligneDialogue2.png
39    :align: middle
40
41 .. |addition_mode| image:: /../_static/additionMode.png
42    :align: middle
43
44 .. |ajoutPointsPolyligne| image:: /../_static/ajoutPointsPolyligne.png
45    :align: middle
46
47 .. |modification_mode| image:: /../_static/modificationMode.png
48    :align: middle
49
50 .. |undoPoly| image:: /../_static/undoPoly.png
51    :align: middle
52
53 .. |modificationPolyligne2| image:: /../_static/modificationPolyligne2.png
54    :align: middle
55
56 We are going to create three lines by drawing on the maps and the bathymetry.
57  
58 * A closed contour representing a portion of the Garonne (extending beyond the study domain defined later)
59   represented by the dark blue surface in the following image: 
60
61   |contour_garonne|
62
63 * Another closed contour on a portion of the major bed of the river (still extending beyond the study domain 
64   both upstream and downstream), corresponding to the bathymetry field garonne_point_L93. 
65
66 * A closed contour in broken lines that will delineate the boundaries of our study domain.
67
68 The contour of the major bed and the study domain: 
69
70   |contour_lit_majeur|
71
72 Drawing the river banks
73 =======================
74
75 The context menu |icone_polyligne_xy| of the *POLYLINES* folder in the SALOME study tree is used to create a polyline.
76
77 The first section of the creation dialog box is used to name the polyline. 
78 It is important to give the objects meaningful names as a large number of them may be need to be handled. 
79
80 * **remarque** : attention à ne pas utiliser d'espaces ou d'accents pour les noms d'objets : problèmes potentiels
81   à différents niveaux dont les scripts Python.
82   
83 They can always be renamed later: 
84
85   |createPolyligneDialogue1|
86
87 The polylines may comprise several sections. We will only be using one, which has to be created: 
88
89   |insertNewSection|
90
91 In the dialog box related to the section, choose a spline-type, closed line and click on the add button. 
92
93   |createPolyligneDialogue2|
94
95  * **Note**: There are two types of polyline: 
96
97    * *spline*: a single continuous line, with derivative continuity passing through all the points.
98      This type of line is privileged when creating curved lines; the control points will not be reused in the mesh,
99      resulting in more flexibility control of the mesh refinement.
100  
101    * polyline: a single continuous line, composed of straight segments. This type of line must be used for artificial
102      objects comprising straight segments and whenever broken lines are needed. The points are kept in the mesh. 
103
104 Once the section has been created, points must be added by switching to the addition mode: 
105
106   |addition_mode|
107
108 Now click on the map, starting at one end **(upstream or downstream of the domain)** and follow the contour of the river. 
109 Each click adds a point and the closed contour is progressively drawn. One or more of the last points can be deleted
110 with the undo / redo buttons: 
111
112   |undoPoly|
113
114  * **Note**: **The choice of where to start a closed line is important: the corresponding point is the only mesh-imposed
115    point. In the case of a river, it is best to put this point outside the domain.**
116
117   |ajoutPointsPolyligne|
118
119 Continue to add points as needed until you arrive back at the starting point, having represented the two banks. 
120 There is no need to add too many points, unless the riverbank is deeply incised and these details need to be captured.
121 For example, about sixty points are required along the river portion of interest in this case.
122
123 When the entry is finished, confirm the created section by clicking *apply and close*.
124
125 Modifying and editing polylines
126 -------------------------------
127  
128 If the result is not satisfactory, the polyline can be modified through the associated context menu,
129 by first selecting the section and afterwards clicking on modification mode:
130
131   |modification_mode|
132
133 It is then possible to: 
134
135  * Select a single point by clicking on it, 
136
137  * Select several points by enclosing them in a selection box, 
138
139  * Create an intermediate point by clicking on the line, between two points. 
140
141 The selected point(s) can be moved using drag-and-drop (left button click and hold down while moving).
142
143 They remain selected until another click or selection is made. 
144
145 The Undo button can be used, if needed, to cancel the latest changes. 
146
147 The coordinates of the selected points are displayed in the dialog box as editable text.
148
149   |modificationPolyligne2|
150
151 Two lines appear when editing: a precise, solid black line that is not recalculated each time an edit is made
152 and a red line that changes with each modification. The latter is less precise but is redrawn more quickly 
153 (This is an important factor when lines containing a "large" number of points need to be modified).
154
155 The line can be recalculated from within the dialog box by clicking the *apply* button.
156 If you wish to continue the modifications, the section can then be reselected with a double click, 
157 followed by *OK* or *Cancel*. 
158
159  * **Note**: In edition mode, double clicking on the section provides options to change the segment type,
160    from spline to polyline or vice versa, and the closure. 
161
162 Drawing the contour of the major bed and the study domain
163 =========================================================
164
165 Once the river has been drawn, the next step is to draw the contour of the major river bed bathymetry,
166 *garonne_point_L93*, then define the outside contour of the computational domain,
167 which must cut the other two lines upstream and downstream. 
168
169 **It is preferable for the computational domain to cut the river perpendicular to its axis,
170 in order to correctly define the upstream and downstream boundary conditions.
171 The creation of acute angles at the boundary of the domain should be avoided, as they increase the risk
172 of over-constrained triangles appearing when the mesh is created**
173 (this problem that can be corrected by diagonal detection and inversion).
174
175 .. only:: html
176
177    :ref:`ref_exempleInondation`