Skip to content

Commit baeb4b1

Browse files
committed
Solve issue with int rounding in discretize
1 parent 8c20c14 commit baeb4b1

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

simpeg_drivers/utils/utils.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,17 @@ def get_drape_model(
414414
distances = compute_alongline_distance(xyz_smooth)
415415
x_interp = interp1d(distances[:, 0], xyz_smooth[:, 0], fill_value="extrapolate")
416416
y_interp = interp1d(distances[:, 0], xyz_smooth[:, 1], fill_value="extrapolate")
417+
418+
# Round the values for mesh creation to avoid issue with floor (int) rounding
419+
limits = np.vstack(
420+
[
421+
np.floor(distances.min(axis=0)),
422+
np.ceil(distances.max(axis=0)),
423+
]
424+
)
425+
417426
mesh = mesh_utils.mesh_builder_xyz(
418-
distances,
427+
limits,
419428
h,
420429
padding_distance=[
421430
[pads[0], pads[1]],

0 commit comments

Comments
 (0)