Skip to content

Commit eeb6956

Browse files
author
Miguel de la Varga
committed
[ENH] Runnign
1 parent 12c37be commit eeb6956

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

gempy_engine/API/dual_contouring/multi_scalar_dual_contouring.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,20 @@ def dual_contouring_multi_scalar(
139139
voxel_overlaps = find_repeated_voxels_across_stacks(foo)
140140
if voxel_overlaps and options.debug:
141141
print(f"Found voxel overlaps between stacks: {voxel_overlaps}")
142-
idx_j = voxel_overlaps["stack_0_vs_stack_3"]["indices_in_stack_j"]
143-
idx_i = voxel_overlaps["stack_0_vs_stack_3"]["indices_in_stack_i"]
144-
meshes[1].vertices[idx_j] = meshes[0].vertices[idx_i]
142+
_f(all_meshes, 1, 0, voxel_overlaps)
143+
_f(all_meshes, 2, 0, voxel_overlaps)
144+
_f(all_meshes, 3, 0, voxel_overlaps)
145+
_f(all_meshes, 4, 0, voxel_overlaps)
146+
_f(all_meshes, 5, 0, voxel_overlaps)
145147

146148
return all_meshes
147149

148150

151+
def _f(all_meshes: list[DualContouringMesh], destination: int, origin: int, voxel_overlaps: dict):
152+
key = f"stack_{origin}_vs_stack_{destination}"
153+
all_meshes[destination].vertices[voxel_overlaps[key]["indices_in_stack_j"]] = all_meshes[origin].vertices[voxel_overlaps[key]["indices_in_stack_i"]]
154+
155+
149156
def find_repeated_voxels_across_stacks(all_left_right_codes: List[np.ndarray]) -> dict:
150157
"""
151158
Find repeated voxels using NumPy operations - better for very large arrays.

tests/fixtures/complex_geometries.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def one_fault_model():
4848
grid=grid,
4949
unit_values=ids
5050
)
51+
5152

5253
# endregion
5354

0 commit comments

Comments
 (0)