You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[REFACTOR] Use center grid for dual contouring instead of corners grid (#24)
# Combining centers and corners
This PR refactors the dual contouring implementation to use a more efficient approach for handling grid corners:
- Adds `corners_grid` property to `EngineGrid` to store corner values alongside centers
- Modifies `interpolate_on_octree` to compute corners as part of the center grid rather than separately
- Adds corner-related properties to `InterpOutput` for accessing corner data
- Fixes `__len__` in `RegularGrid` to return the correct number of active cells
- Replaces `_get_intersection_on_edges` with direct calls to `find_intersection_on_edge` for improved consistency
- Updates masking logic to work with the new grid structure
- Simplifies octree generation by removing redundant corner-related code
These changes improve the efficiency of the dual contouring algorithm by reducing redundant computations and simplifying the data flow.
Copy file name to clipboardExpand all lines: gempy_engine/core/data/regular_grid.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,8 @@ class RegularGrid:
20
20
original_values: np.ndarray=field(default=None, repr=False, init=False) #: When the regular grid is representing a octree level, only active cells are stored in values. This is the original values of the regular grid.
0 commit comments