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