@@ -12,18 +12,17 @@ class TriAnalyzer:
12
12
"""
13
13
Define basic tools for triangular mesh analysis and improvement.
14
14
15
- A TriAnalyzer encapsulates a :class:`~matplotlib.tri.Triangulation`
16
- object and provides basic tools for mesh analysis and mesh improvement.
17
-
18
- Parameters
19
- ----------
20
- triangulation : :class:`~matplotlib.tri.Triangulation` object
21
- The encapsulated triangulation to analyze.
15
+ A TriAnalyzer encapsulates a `~matplotlib.tri.Triangulation` object and
16
+ provides basic tools for mesh analysis and mesh improvement.
22
17
23
18
Attributes
24
19
----------
25
- ` scale_factors`
20
+ scale_factors
26
21
22
+ Parameters
23
+ ----------
24
+ triangulation : `~matplotlib.tri.Triangulation`
25
+ The encapsulated triangulation to analyze.
27
26
"""
28
27
def __init__ (self , triangulation ):
29
28
cbook ._check_isinstance (Triangulation , triangulation = triangulation )
@@ -34,12 +33,10 @@ def scale_factors(self):
34
33
"""
35
34
Factors to rescale the triangulation into a unit square.
36
35
37
- Returns *k*, tuple of 2 scale factors.
38
-
39
36
Returns
40
37
-------
41
- k : tuple of 2 floats (kx, ky )
42
- Tuple of floats that would rescale the triangulation :
38
+ k : (float, float )
39
+ Scaling factors (kx, ky) so that the triangulation
43
40
``[triangulation.x * kx, triangulation.y * ky]``
44
41
fits exactly inside a unit square.
45
42
@@ -52,7 +49,7 @@ def scale_factors(self):
52
49
53
50
def circle_ratios (self , rescale = True ):
54
51
"""
55
- Returns a measure of the triangulation triangles flatness.
52
+ Return a measure of the triangulation triangles flatness.
56
53
57
54
The ratio of the incircle radius over the circumcircle radius is a
58
55
widely used indicator of a triangle flatness.
@@ -61,22 +58,21 @@ def circle_ratios(self, rescale=True):
61
58
62
59
To avoid unduly low values due to a difference of scale between the 2
63
60
axis, the triangular mesh can first be rescaled to fit inside a unit
64
- square with :attr: `scale_factors` (Only if *rescale* is True, which is
61
+ square with `scale_factors` (Only if *rescale* is True, which is
65
62
its default value).
66
63
67
64
Parameters
68
65
----------
69
66
rescale : bool, default: True
70
67
If True, a rescaling will be internally performed (based on
71
- :attr: `scale_factors`, so that the (unmasked) triangles fit
68
+ `scale_factors`, so that the (unmasked) triangles fit
72
69
exactly inside a unit square mesh.
73
70
74
71
Returns
75
72
-------
76
73
circle_ratios : masked array
77
- Ratio of the incircle radius over the
78
- circumcircle radius, for each 'rescaled' triangle of the
79
- encapsulated triangulation.
74
+ Ratio of the incircle radius over the circumcircle radius, for
75
+ each 'rescaled' triangle of the encapsulated triangulation.
80
76
Values corresponding to masked triangles are masked out.
81
77
82
78
"""
@@ -121,7 +117,7 @@ def circle_ratios(self, rescale=True):
121
117
122
118
def get_flat_tri_mask (self , min_circle_ratio = 0.01 , rescale = True ):
123
119
"""
124
- Eliminates excessively flat border triangles from the triangulation.
120
+ Eliminate excessively flat border triangles from the triangulation.
125
121
126
122
Returns a mask *new_mask* which allows to clean the encapsulated
127
123
triangulation from its border-located flat triangles
@@ -137,15 +133,14 @@ def get_flat_tri_mask(self, min_circle_ratio=0.01, rescale=True):
137
133
138
134
Parameters
139
135
----------
140
- min_circle_ratio : float, optional
136
+ min_circle_ratio : float, default: 0.01
141
137
Border triangles with incircle/circumcircle radii ratio r/R will
142
- be removed if r/R < *min_circle_ratio*. Default value: 0.01
143
- rescale : bool, optional
138
+ be removed if r/R < *min_circle_ratio*.
139
+ rescale : bool, default: True
144
140
If True, a rescaling will first be internally performed (based on
145
- :attr:`scale_factors` ), so that the (unmasked) triangles fit
146
- exactly inside a unit square mesh. This rescaling accounts for the
147
- difference of scale which might exist between the 2 axis. Default
148
- (and recommended) value is True.
141
+ `scale_factors`), so that the (unmasked) triangles fit exactly
142
+ inside a unit square mesh. This rescaling accounts for the
143
+ difference of scale which might exist between the 2 axis.
149
144
150
145
Returns
151
146
-------
@@ -206,11 +201,11 @@ def _get_compressed_triangulation(self, return_tri_renum=False,
206
201
207
202
Parameters
208
203
----------
209
- return_tri_renum : bool, optional
204
+ return_tri_renum : bool, default: False
210
205
Indicates whether a renumbering table to translate the triangle
211
206
numbers from the encapsulated triangulation numbering into the
212
207
new (compressed) renumbering will be returned.
213
- return_node_renum : bool, optional
208
+ return_node_renum : bool, default: False
214
209
Indicates whether a renumbering table to translate the nodes
215
210
numbers from the encapsulated triangulation numbering into the
216
211
new (compressed) renumbering will be returned.
0 commit comments