Salome HOME
0021209: Bug GetInPlace with faces. Integrate self-intersections checker.
[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 \n <b>TUI Command:</b> <em>geompy.GetAngle(shape1, shape2),</em> where
174 Shape1 and Shape2 are shapes between which the angle is computed. 
175 Another TUI command is <em>geompy.GetAngleRadians(shape1,shape2),</em> 
176 which returns the value of angle in radians.
177
178 \image html angle.png
179
180 \anchor tolerance_anchor
181 <br><h2>Tolerance</h2>
182
183 \n Returns the maximum and the minimum tolerance for the selected
184 geometrical object.
185
186 \n <b>Result:</b> Displays the tolerance values (FaceMinTol,
187 FaceMaxTol, EgdeMinTol, EgdeMaxTol, VertexMinTol, VertexMaxTol).
188 \n <b>TUI Command:</b> <em>geompy.Tolerance(Shape),</em> where \em Shape
189 is a shape for which minimal and maximal tolerances are returned.
190
191 \image html new-tolerance.png
192
193 \anchor whatis_anchor
194 <br><h2>WhatIs</h2>
195
196 \n General information about the selected geometrical object is the
197 list of types and quantities of all topological entities, composing
198 the shape.
199
200 \n <b>TUI Command:</b> <em>geompy.WhatIs(Shape),</em> where \em Shape is a
201 shape from which a description is returned.
202
203 \image html measures8.png
204
205 \n <b>Kind of Shape</b> field characterises the
206 whole shape. If there is no additional information available for the
207 shape, <b>Basic Properties</b> button will be disabled, otherwise it
208 will show a dialog with information about
209 dimensions, position, orientation and other parameters of the shape.
210
211 \n <b>TUI Command:</b> <em>geompy.KindOfShape(Shape),</em> where \em Shape is a
212 shape from which a description is returned.
213
214 \image html measures8a.png
215
216 \anchor check_anchor
217 <br><h2>Check</h2>
218
219 \n Checks the topology of the selected geometrical object and returns
220 True if it is valid. Check also geometry checkbox allows to test the
221 geometry as well.
222
223 \n <b>Result:</b> Boolean.
224 \n <b>TUI Command:</b> <em>geompy.CheckShape(theShape, theIsCheckGeom = 0),</em>
225 where \em theShape is the shape checked for validity.
226
227 \image html measures9.png
228
229 \anchor check_compound_anchor
230 <br><h2>Check compound of blocks</h2>
231
232 \n Checks whether a shape is a compound of glued blocks. To be
233 considered as a compound of blocks, the given shape must satisfy the
234 following conditions:
235 <ul>
236 <li>Each element of the compound should be a Block (6 faces and 12 edges);</li>
237 <li>A connection between two Blocks should be an entire quadrangle face or an entire edge;</li>
238 <li>The compound should be connected;</li>
239 <li>Two quadrangle faces should be glued.</li>
240 </ul>
241
242 \n Informs of the following possible errors:
243 <ul>
244 <li>not a block;</li>
245 <li>not glued;</li>
246 <li>not connected;</li>
247 <li>extra or degenerated edge.</li>
248 </ul>
249
250 \n <b>Result:</b> Boolean; highlight in the viewer.
251 \n <b>TUI Command:</b>
252 <em>geompy.CheckCompoundOfBlocks(Compound).</em> Checks if the shape
253 is a valid compound of blocks. If it is true, then the validity flag
254 is returned, and encountered errors are printed in the python console.
255
256 \image html measures10.png
257
258 \anchor check_self_intersections_anchor
259 <br><h2>Detect Self-intersections</h2>
260
261 \n Checks the topology of the selected shape to detect self-intersections.
262  Returns True if there are no self-intersections. Reports pairs of
263  intersected sub shapes, if there are any.
264
265 \n <b>Result:</b> Boolean.
266 \n <b>TUI Command:</b> <em>geompy.CheckSelfIntersections(theShape),</em>
267 where \em theShape is the shape checked for validity.
268
269 \image html measures11.png
270
271 */
272