Salome HOME
0020628: EDF 1144 GEOM : In TUI, need a function to know the orientation of an edge...
[modules/geom.git] / doc / salome / gui / GEOM / input / using_measurement_tools.doc
1 /*!\r
2 \r
3 \page using_measurement_tools_page Using measurement tools\r
4 \r
5 \n Measurement tools in GEOM are necessary for getting different data\r
6 concerning created or imported geometrical objects. They are:\r
7 \r
8 <ul>\r
9 <li>\ref point_coord_anchor "Point coordinates"</li>\r
10 <li>\ref basic_prop_anchor "Basic properties"</li>\r
11 <li>\ref center_mass_anchor "Center of mass"</li>
12 <li>\ref vertex_by_index "Get Vertex By Index"</li>
13 <li>\ref inertia_anchor "Inertia"</li>\r
14 <li>\ref normale_anchor "Normal to a Face"</li>\r
15 <li>\ref boundaries_anchor "Check Free Boundaries"</li>\r
16 <li>\ref faces_anchor "Check Faces"</li>\r
17 <li>\ref bounding_box_anchor "Bounding box"</li>\r
18 <li>\ref min_distance_anchor "Min. distance"</li>\r
19 <li>\ref angle_anchor "Angle"</li>\r
20 <li>\ref tolerance_anchor "Tolerance"</li>\r
21 <li>\ref whatis_anchor "WhatIs"</li>\r
22 <li>\ref check_anchor "Check"</li>\r
23 <li>\ref check_compound_anchor "Check compound of blocks"</li>\r
24 </ul>\r
25 \r
26 \n Our <b>TUI Scripts</b> show how to use\r
27 \ref tui_measurement_tools_page "Measurement Tools" with <b>TUI\r
28 commands</b>.\r
29 \r
30 \n <em>To use measurement tools:</em>\r
31 \par\r
32 In the <b>Main menu</b> select \b Measures submenu.\r
33 \r
34 \anchor point_coord_anchor\r
35 <br><h2>Point coordinates</h2>\r
36 \r
37 \n Returns the coordinates of a point.\r
38 \r
39 \n <b>Result:</b> Point coordinates (X, Y, Z) in 3D space in the form of Python Tuple.\r
40 \n <b>TUI Command:</b> <em>geompy.PointCoordinates(Point),</em>\r
41 where \em Point is a point whose coordinates are inquired.\r
42 \r
43 \image html measures1.png\r
44 \r
45 \anchor basic_prop_anchor\r
46 <br><h2>Basic properties</h2>\r
47 \r
48 \n Returns the properties (Length, Surface & Volume) for the selected\r
49 geometrical object.\r
50 \r
51 \n <b>Result:</b> Display Length, Surface & Volume in the form of\r
52 Python Tuple.\r
53 \n <b>TUI Command:</b> <em>geompy.BasicProperties(Shape),</em> where\r
54 \em Shape is a shape whose properties are inquired.\r
55 \r
56 \image html neo-basicprop.png\r
57
58 \anchor center_mass_anchor
59 <br><h2>Center of mass</h2>
60
61 \n Calculates and returns the coordinates of the gravity center for
62 the selected geometrical object.
63
64 \n <b>Result:</b> GEOM_Object (vertex).
65 \n <b>TUI Command:</b> <em> geompy.MakeCDG(Shape),</em> where \em Shape is
66 the shape for which a center of gravity is computed.
67
68 \image html measures3.png
69
70 \anchor vertex_by_index
71 <br><h2>Get Vertex by Index</h2>
72
73 \n It is possible to get the first or the last vertex from an edge or a wire, depending on 
74 its direction (orientation), or to find the vertex by the index inside the wire. 
75 The numeration of vertexes starts from 0. This function has only a TUI implementation) 
76
77 \n <b>Result:</b> GEOM_Object (vertex).
78 \n <b>TUI Command:</b> <em> geompy.GetVertexByIndex(Shape, Index),</em>
79 <em> geompy.GetFirstVertex(Shape),</em>
80 <em> geompy.GetLastVertex(Shape),</em> where \em Shape must be Wire or Edge.
81
82 \anchor inertia_anchor
83 <br><h2>Inertia</h2>
84
85 Returns the axial moments of inertia for the selected geometrical object.
86
87 \n <b>Result:</b> Displays the matrix of the own moments of inertia and
88 the relative moments of inertia in the form of Python Tuple
89  <center>(I11, I12, I13,</center>
90                      <center>I21, I22, I23,</center>
91                      <center>I31, I32, I33,</center>
92                      <center>Ix, Iy, Iz).</center>
93 \n <b>TUI Command:</b> <em>geompy.Inertia(Shape),</em> where \em Shape is
94 a shape for which the own matrix of inertia and the relative moments of inertia are
95 returned.
96
97 \image html measures4.png
98
99 \anchor normale_anchor
100 <br><h2>Normal to a Face</h2>
101
102 \n Calculates the normal vector to the selected \b Face. The \b Point\r
103 is a point of the \b Face, where the Normal should be calculated.\r
104 \r
105 \image html normaletoface.png\r
106 \r
107 \anchor boundaries_anchor\r
108 <br><h2>Check Free Boundaries</h2>\r
109 \r
110 \n Detects and highlights  wires and edges that are not shared between\r
111 two faces and are considered a shape's boundary.\r
112 \r
113 \n <b>TUI Command:</b> <em>(NoError, ClosedWires, OpenWires) =\r
114 geompy.GetFreeBoundary(Shape),</em> where \em Shape is a shape to be\r
115 checked, \em NoError is false if an error occurred while checking free\r
116 boundaries, \em ClosedWires is a list of closed free boundary wires,\r
117 \em OpenWires is a list of open free boundary wires.\r
118 \r
119 \image html repair9.png\r
120 \r
121 \anchor faces_anchor\r
122 <br><h2>Check Free Faces</h2>\r
123 \r
124 \n Highlights all free faces of a given shape. A free\r
125 face is a face which is not shared between two objects of the shape.\r
126 \r
127 \n \b NOTE: This functionality works only in VTK viewer.\r
128 \r
129 \n \b Result: a list of IDs of all free faces, containing in the shape.\r
130 \n <b>TUI Command:</b> <em>GetFreeFacesIDs(Shape),</em> where \em Shape is\r
131 a shape to be checked.\r
132 \r
133 \image html repair10.png\r
134 \r
135 \anchor bounding_box_anchor\r
136 <br><h2>Bounding box</h2>\r
137 \r
138 Returns the dimensions of the bounding box for the selected\r
139 geometrical object.\r
140
141 \b NOTE: In order to take into account any possible distortion of a shape 
142 that affects the resulting bounding box, the algorithm enlarges 
143 the bounding box to the value of the maximum deflection value of 
144 faces (by iterating through all faces of a shape).
145 This functionallity is implemented in such a way in order to have 
146 satisfactory performance.
147
148 <b>Result:</b> Displays the dimensions of the bounding box of a\r
149 geometrical object in the form of Python Tuple (Xmin, Xmax, Ymin,\r
150 Ymax, Zmin, Zmax).\r
151 \n <b>TUI Command:</b> <em>geompy.BoundingBox(Shape),</em> where \em Shape\r
152 is a shape for which a bounding box is computed.\r
153 \r
154 \image html measures5.png\r
155 \r
156 \anchor min_distance_anchor\r
157 <br><h2>Min. distance</h2>\r
158 \r
159 \n Returns the minimum distance between two geometrical objects and\r
160 the coordinates of the vector of distance and shows the vector in the viewer.\r
161 \r
162 \n <b>TUI Command:</b> <em>geompy.MinDistance(Shape1, Shape2),</em>\r
163 where \em Shape1 and \em Shape2 are shapes between which the minimal\r
164 distance is computed.\r
165 \r
166 \image html distance.png\r
167 \r
168 \anchor angle_anchor\r
169 <br><h2>Angle</h2>\r
170 \r
171 \n Returns the angle between two lines or linear edges in degrees\r
172 \n <b>TUI Command:</b> <em>geompy.GetAngle(shape1, shape2),</em> where\r
173 Shape1 and Shape2 are shapes between which the angle is computed. \r
174 Another TUI command is <em>geompy.GetAngleRadians(shape1,shape2),</em> \r
175 which returns the value of angle in radians.\r
176 \r
177 \image html angle.png\r
178 \r
179 \anchor tolerance_anchor\r
180 <br><h2>Tolerance</h2>\r
181 \r
182 \n Returns the maximum and the minimum tolerance for the selected\r
183 geometrical object.\r
184 \r
185 \n <b>Result:</b> Displays the tolerance values (FaceMinTol,\r
186 FaceMaxTol, EgdeMinTol, EgdeMaxTol, VertexMinTol, VertexMaxTol).\r
187 \n <b>TUI Command:</b> <em>geompy.Tolerance(Shape),</em> where \em Shape\r
188 is a shape for which minimal and maximal tolerances are returned.\r
189 \r
190 \image html new-tolerance.png\r
191 \r
192 \anchor whatis_anchor\r
193 <br><h2>WhatIs</h2>\r
194 \r
195 \n General information about the selected geometrical object is the\r
196 list of types and quantities of all topological entities, composing\r
197 the shape.\r
198 \r
199 \n <b>TUI Command:</b> <em>geompy.WhatIs(Shape),</em> where \em Shape is a\r
200 shape from which a description is returned.\r
201 \r
202 \image html measures8.png\r
203 \r
204 \n <b>Kind of Shape</b> field characterises the\r
205 whole shape. If there is no additional information available for the\r
206 shape, <b>Basic Properties</b> button will be disabled, otherwise it\r
207 will show a dialog with information about\r
208 dimensions, position, orientation and other parameters of the shape.\r
209 \r
210 \n <b>TUI Command:</b> <em>geompy.KindOfShape(Shape),</em> where \em Shape is a\r
211 shape from which a description is returned.\r
212 \r
213 \image html measures8a.png\r
214 \r
215 \anchor check_anchor\r
216 <br><h2>Check</h2>\r
217 \r
218 \n Checks the topology of the selected geometrical object and returns\r
219 True if it is valid. Check also geometry checkbox allows to test the\r
220 geometry as well.\r
221 \r
222 \n <b>Result:</b> Boolean.\r
223 \n <b>TUI Command:</b> <em>geompy.CheckShape(theShape, theIsCheckGeom = 0),</em>\r
224 where \em theShape is the shape checked for validity.\r
225 \r
226 \image html measures9.png\r
227 \r
228 \anchor check_compound_anchor\r
229 <br><h2>Check compound of blocks</h2>\r
230 \r
231 \n Checks whether a shape is a compound of glued blocks. To be\r
232 considered as a compound of blocks, the given shape must satisfy the\r
233 following conditions:\r
234 <ul>\r
235 <li>Each element of the compound should be a Block (6 faces and 12 edges);</li>\r
236 <li>A connection between two Blocks should be an entire quadrangle face or an entire edge;</li>\r
237 <li>The compound should be connected;</li>\r
238 <li>Two quadrangle faces should be glued.</li>\r
239 </ul>\r
240 \r
241 \n Informs of the following possible errors:\r
242 <ul>\r
243 <li>not a block;</li>\r
244 <li>not glued;</li>\r
245 <li>not connected;</li>\r
246 <li>extra or degenerated edge.</li>\r
247 </ul>\r
248 \r
249 \n <b>Result:</b> Boolean; highlight in the viewer.\r
250 \n <b>TUI Command:</b>\r
251 <em>geompy.CheckCompoundOfBlocks(Compound).</em> Checks if the shape\r
252 is a valid compound of blocks. If it is true, then the validity flag\r
253 is returned, and encountered errors are printed in the python console.\r
254 \r
255 \image html measures10.png\r
256 \r
257 */\r
258 \r