Fix loop variables not getting saved in closures
This commit is contained in:
parent
f486209950
commit
1067c3b780
@ -153,7 +153,7 @@ def draw_polygons(self,
|
|||||||
# 2) Generate weights in z-direction
|
# 2) Generate weights in z-direction
|
||||||
w_z = numpy.zeros(((bdi_max - bdi_min + 1)[surface_normal], ))
|
w_z = numpy.zeros(((bdi_max - bdi_min + 1)[surface_normal], ))
|
||||||
|
|
||||||
def get_zi(offset):
|
def get_zi(offset, i=i, w_z=w_z):
|
||||||
edges = self.shifted_exyz(i)[surface_normal]
|
edges = self.shifted_exyz(i)[surface_normal]
|
||||||
point = center[surface_normal] + offset
|
point = center[surface_normal] + offset
|
||||||
grid_coord = numpy.digitize(point, edges) - 1
|
grid_coord = numpy.digitize(point, edges) - 1
|
||||||
@ -365,7 +365,7 @@ def draw_extrude_rectangle(self,
|
|||||||
ind[direction] += 1
|
ind[direction] += 1
|
||||||
eps += mult[1] * grid[ind]
|
eps += mult[1] * grid[ind]
|
||||||
|
|
||||||
def f_eps(xs, ys, zs):
|
def f_eps(xs, ys, zs, i=i, eps=eps) -> numpy.ndarray:
|
||||||
# transform from natural position to index
|
# transform from natural position to index
|
||||||
xyzi = numpy.array([self.pos2ind(qrs, which_shifts=i)
|
xyzi = numpy.array([self.pos2ind(qrs, which_shifts=i)
|
||||||
for qrs in zip(xs.flat, ys.flat, zs.flat)], dtype=int)
|
for qrs in zip(xs.flat, ys.flat, zs.flat)], dtype=int)
|
||||||
|
Loading…
Reference in New Issue
Block a user