Salome HOME
[bos #36177] [FORUM] - Remove extra-edge on hemisphere
[modules/geom.git] / doc / salome / gui / GEOM / input / shape_proximity.doc
1 /*! 
2
3 \page shape_proximity_page Shape Proximity
4
5 The Shape Proximity operation calculates maximal of all possible distances between two shapes.
6 Considering this case :
7
8 \image html Shape_proximity_0.png
9
10 The proximity of blue shape to the red one is computed like this :
11 For each point of blue the distance to the red is computed using perpendicular projection. The proximity value returned is equal to maximal value of all of this distances.
12 To do that the implemented algorithm
13
14 1 - sampling shapes by points then calculating the distance from each sample point from one shape to another
15
16 2 - find the position which gives the maximal distance
17
18 3 - improve the proximity value basing on the exact shapes using the points found on step 2 as a start position
19
20 It may happen that for some point of blue shape no distance to red shape exist using perpendicular projection.
21 This is typically the case here :
22
23 \image html Shape_proximity_1.png
24
25 In the case of no perpendicular projection of a point on blue shape exists, instead of perpendicular projection the minimal distance to border point of red shape is considered.
26 The distance from EndBlue Point is taken using EndRed Point (black line represents the distance for EndBlue).
27
28 This is just a TUI functionality. The provided class
29 <pre>
30 geompy.ShapeProximity()
31 </pre>
32 has an interface to compute proximity value with default parameters
33 <pre>
34 p = geompy.ShapeProximity()
35 value = p.proximity(shape1, shape2)
36 </pre>
37
38 Moreover, it also provides the functionality to customize the calculation. 
39 For example, compute coarse proximity value basing on the number of sampling points for each shape, 
40 or compute the precise value as a refining operation after the coarse value calculation.
41 <pre>
42 p = geompy.ShapeProximity()
43 p.setShapes(shape1, shape2) # customize calculator with input shapes
44 p.setSampling(shape1, 100)  # assign number of sample points for the first shape
45 p.setSampling(shape2, 25)   # assign number of sample points for the second shape
46 coarse_proximity = p.coarseProximity() # rough proximity value basing on the shape sampling and tessellation
47 fine_proximity = p.preciseProximity()  # more precise proximity value using exact shapes
48 </pre>
49
50 See also a \ref tui_shape_proximity_page "TUI example".
51
52 */