你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-06 20:46:52 +08:00
Remove -1 from when setting limits for building objects and setting solid array.
这个提交包含在:
@@ -558,16 +558,16 @@ cpdef void build_cylinder(float x1, float y1, float z1, float x2, float y2, floa
|
|||||||
# Set bounds to domain if they outside
|
# Set bounds to domain if they outside
|
||||||
if xs < 0:
|
if xs < 0:
|
||||||
xs = 0
|
xs = 0
|
||||||
if xf >= solid.shape[0]:
|
if xf > solid.shape[0]:
|
||||||
xf = solid.shape[0] - 1
|
xf = solid.shape[0]
|
||||||
if ys < 0:
|
if ys < 0:
|
||||||
ys = 0
|
ys = 0
|
||||||
if yf >= solid.shape[1]:
|
if yf > solid.shape[1]:
|
||||||
yf = solid.shape[1] - 1
|
yf = solid.shape[1]
|
||||||
if zs < 0:
|
if zs < 0:
|
||||||
zs = 0
|
zs = 0
|
||||||
if zf >= solid.shape[2]:
|
if zf > solid.shape[2]:
|
||||||
zf = solid.shape[2] - 1
|
zf = solid.shape[2]
|
||||||
|
|
||||||
# Vectors between centres of cylinder faces
|
# Vectors between centres of cylinder faces
|
||||||
f1f2 = np.array([x2 - x1, y2 - y1, z2 - z1], dtype=np.float32)
|
f1f2 = np.array([x2 - x1, y2 - y1, z2 - z1], dtype=np.float32)
|
||||||
@@ -642,16 +642,16 @@ cpdef void build_sphere(int xc, int yc, int zc, float r, float dx, float dy, flo
|
|||||||
# Set bounds to domain if they outside
|
# Set bounds to domain if they outside
|
||||||
if xs < 0:
|
if xs < 0:
|
||||||
xs = 0
|
xs = 0
|
||||||
if xf >= solid.shape[0]:
|
if xf > solid.shape[0]:
|
||||||
xf = solid.shape[0] - 1
|
xf = solid.shape[0]
|
||||||
if ys < 0:
|
if ys < 0:
|
||||||
ys = 0
|
ys = 0
|
||||||
if yf >= solid.shape[1]:
|
if yf > solid.shape[1]:
|
||||||
yf = solid.shape[1] - 1
|
yf = solid.shape[1]
|
||||||
if zs < 0:
|
if zs < 0:
|
||||||
zs = 0
|
zs = 0
|
||||||
if zf >= solid.shape[2]:
|
if zf > solid.shape[2]:
|
||||||
zf = solid.shape[2] - 1
|
zf = solid.shape[2]
|
||||||
|
|
||||||
for i in range(xs, xf):
|
for i in range(xs, xf):
|
||||||
for j in range(ys, yf):
|
for j in range(ys, yf):
|
||||||
@@ -677,22 +677,22 @@ cpdef void build_voxels_from_array(int xs, int ys, int zs, int numexistmaterials
|
|||||||
# Set bounds to domain if they outside
|
# Set bounds to domain if they outside
|
||||||
if xs < 0:
|
if xs < 0:
|
||||||
xs = 0
|
xs = 0
|
||||||
if xs + data.shape[0] >= solid.shape[0]:
|
if xs + data.shape[0] > solid.shape[0]:
|
||||||
xf = solid.shape[0] - 1
|
xf = solid.shape[0]
|
||||||
else:
|
else:
|
||||||
xf = xs + data.shape[0]
|
xf = xs + data.shape[0]
|
||||||
|
|
||||||
if ys < 0:
|
if ys < 0:
|
||||||
ys = 0
|
ys = 0
|
||||||
if ys + data.shape[1] >= solid.shape[1]:
|
if ys + data.shape[1] > solid.shape[1]:
|
||||||
yf = solid.shape[1] - 1
|
yf = solid.shape[1]
|
||||||
else:
|
else:
|
||||||
yf = ys + data.shape[1]
|
yf = ys + data.shape[1]
|
||||||
|
|
||||||
if zs < 0:
|
if zs < 0:
|
||||||
zs = 0
|
zs = 0
|
||||||
if zs + data.shape[2] >= solid.shape[2]:
|
if zs + data.shape[2] > solid.shape[2]:
|
||||||
zf = solid.shape[2] - 1
|
zf = solid.shape[2]
|
||||||
else:
|
else:
|
||||||
zf = zs + data.shape[2]
|
zf = zs + data.shape[2]
|
||||||
|
|
||||||
@@ -721,9 +721,9 @@ cpdef void build_voxels_from_array_mask(int xs, int ys, int zs, int waternumID,
|
|||||||
cdef int xf, yf, zf, numID, numIDx, numIDy, numIDz
|
cdef int xf, yf, zf, numID, numIDx, numIDy, numIDz
|
||||||
|
|
||||||
# Set upper bounds
|
# Set upper bounds
|
||||||
xf = xs + data.shape[0] - 1
|
xf = xs + data.shape[0]
|
||||||
yf = ys + data.shape[1] - 1
|
yf = ys + data.shape[1]
|
||||||
zf = zs + data.shape[2] - 1
|
zf = zs + data.shape[2]
|
||||||
|
|
||||||
for i in range(xs, xf):
|
for i in range(xs, xf):
|
||||||
for j in range(ys, yf):
|
for j in range(ys, yf):
|
||||||
|
在新工单中引用
屏蔽一个用户