3 \page using_measurement_tools_page Using measurement tools
5 \n Measurement tools in GEOM are necessary for getting different data
6 concerning created or imported geometrical objects. They are:
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>
27 \n Our <b>TUI Scripts</b> show how to use
28 \ref tui_measurement_tools_page "Measurement Tools" with <b>TUI
31 \n <em>To use measurement tools:</em>
33 In the <b>Main menu</b> select \b Measures submenu.
35 \anchor point_coord_anchor
36 <br><h2>Point coordinates</h2>
38 \n Returns the coordinates of a point.
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.
44 \image html measures1.png
46 \anchor basic_prop_anchor
47 <br><h2>Basic properties</h2>
49 \n Returns the properties (Length, Surface & Volume) for the selected
52 \n <b>Result:</b> Display Length, Surface & Volume in the form of
54 \n <b>TUI Command:</b> <em>geompy.BasicProperties(Shape),</em> where
55 \em Shape is a shape whose properties are inquired.
57 \image html neo-basicprop.png
59 \anchor center_mass_anchor
60 <br><h2>Center of mass</h2>
62 \n Calculates and returns the coordinates of the gravity center for
63 the selected geometrical object.
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.
69 \image html measures3.png
71 \anchor vertex_by_index
72 <br><h2>Get Vertex by Index</h2>
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)
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.
83 \anchor inertia_anchor
86 Returns the axial moments of inertia for the selected geometrical object.
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
98 \image html measures4.png
100 \anchor normale_anchor
101 <br><h2>Normal to a Face</h2>
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.
106 \image html normaletoface.png
108 \anchor boundaries_anchor
109 <br><h2>Check Free Boundaries</h2>
111 \n Detects and highlights wires and edges that are not shared between
112 two faces and are considered a shape's boundary.
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.
120 \image html repair9.png
123 <br><h2>Check Free Faces</h2>
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.
128 \n \b NOTE: This functionality works only in VTK viewer.
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.
134 \image html repair10.png
136 \anchor bounding_box_anchor
137 <br><h2>Bounding box</h2>
139 Returns the dimensions of the bounding box for the selected
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.
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,
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.
155 \image html measures5.png
157 \anchor min_distance_anchor
158 <br><h2>Min. distance</h2>
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.
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.
167 \image html distance.png
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.
178 \image html angle.png
180 \anchor tolerance_anchor
181 <br><h2>Tolerance</h2>
183 \n Returns the maximum and the minimum tolerance for the selected
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.
191 \image html new-tolerance.png
193 \anchor whatis_anchor
196 \n General information about the selected geometrical object is the
197 list of types and quantities of all topological entities, composing
200 \n <b>TUI Command:</b> <em>geompy.WhatIs(Shape),</em> where \em Shape is a
201 shape from which a description is returned.
203 \image html measures8.png
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.
211 \n <b>TUI Command:</b> <em>geompy.KindOfShape(Shape),</em> where \em Shape is a
212 shape from which a description is returned.
214 \image html measures8a.png
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
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.
227 \image html measures9.png
229 \anchor check_compound_anchor
230 <br><h2>Check compound of blocks</h2>
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:
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>
242 \n Informs of the following possible errors:
244 <li>not a block;</li>
246 <li>not connected;</li>
247 <li>extra or degenerated edge.</li>
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.
256 \image html measures10.png
258 \anchor check_self_intersections_anchor
259 <br><h2>Detect Self-intersections</h2>
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.
265 \note This tool is useful for detection of shapes, not suitable for
266 arguments of Boolean operations and Partition algorithm.
267 For more information about Partition and Boolean Operations Algorithms
268 and their limitations refer to <a href="SALOME_BOA_PA.pdf">this document</a>.
270 \n <b>Result:</b> Boolean.
271 \n <b>TUI Command:</b> <em>geompy.CheckSelfIntersections(theShape),</em>
272 where \em theShape is the shape checked for validity.
274 \image html measures11.png