@@ -12,19 +12,23 @@ class Triangulation(object):
12
12
13
13
Parameters
14
14
----------
15
- x, y : array_like of shape (npoints)
15
+ x, y : array-like of shape (npoints)
16
16
Coordinates of grid points.
17
17
triangles : integer array_like of shape (ntri, 3), optional
18
18
For each triangle, the indices of the three points that make
19
19
up the triangle, ordered in an anticlockwise manner. If not
20
20
specified, the Delaunay triangulation is calculated.
21
- mask : boolean array_like of shape (ntri), optional
21
+ mask : boolean array-like of shape (ntri), optional
22
22
Which triangles are masked out.
23
23
24
24
Attributes
25
25
----------
26
- `edges`
27
- `neighbors`
26
+ edges : int array of shape (nedges, 2)
27
+ See `~.Triangulation.edges`
28
+ neighbors : int array of shape (ntri, 3)
29
+ See `~.Triangulation.neighbors`
30
+ mask : bool array of shape (ntri, 3)
31
+ Masked out triangles.
28
32
is_delaunay : bool
29
33
Whether the Triangulation is a calculated Delaunay
30
34
triangulation (where `triangles` was not specified) or not.
@@ -76,29 +80,32 @@ def __init__(self, x, y, triangles=None, mask=None):
76
80
def calculate_plane_coefficients (self , z ):
77
81
"""
78
82
Calculate plane equation coefficients for all unmasked triangles from
79
- the point (x,y) coordinates and specified z-array of shape (npoints).
80
- Returned array has shape (npoints,3) and allows z-value at (x,y)
83
+ the point (x, y) coordinates and specified z-array of shape (npoints).
84
+ The returned array has shape (npoints, 3) and allows z-value at (x, y)
81
85
position in triangle tri to be calculated using
82
- z = array[tri,0] *x + array[tri,1]* y + array[tri,2] .
86
+ `` z = array[tri, 0] *x + array[tri, 1] * y + array[tri, 2]`` .
83
87
"""
84
88
return self .get_cpp_triangulation ().calculate_plane_coefficients (z )
85
89
86
90
@property
87
91
def edges (self ):
88
92
"""
89
- Return integer array of shape (nedges,2) containing all edges of
93
+ Return integer array of shape (nedges, 2) containing all edges of
90
94
non-masked triangles.
91
95
92
- Each edge is the start point index and end point index. Each
93
- edge (start,end and end,start) appears only once.
96
+ Each row defines an edge by it's start point index and end point
97
+ index. Each edge appears only once, i.e. for an edge between points
98
+ *i* and *j*, there will only be either *(i, j)* or *(j, i)*.
94
99
"""
95
100
if self ._edges is None :
96
101
self ._edges = self .get_cpp_triangulation ().get_edges ()
97
102
return self ._edges
98
103
99
104
def get_cpp_triangulation (self ):
100
- # Return the underlying C++ Triangulation object, creating it
101
- # if necessary.
105
+ """
106
+ Return the underlying C++ Triangulation object, creating it
107
+ if necessary.
108
+ """
102
109
if self ._cpp_triangulation is None :
103
110
self ._cpp_triangulation = _tri .Triangulation (
104
111
self .x , self .y , self .triangles , self .mask , self ._edges ,
@@ -175,7 +182,7 @@ def get_trifinder(self):
175
182
@property
176
183
def neighbors (self ):
177
184
"""
178
- Return integer array of shape (ntri,3) containing neighbor
185
+ Return integer array of shape (ntri, 3) containing neighbor
179
186
triangles.
180
187
181
188
For each triangle, the indices of the three triangles that
0 commit comments