Skip to content

[REFACTOR] Reorganize dual contouring vertex overlap logic into separate modules#49

Merged
Leguark merged 8 commits intomainfrom
pretty_faults
Mar 20, 2026
Merged

[REFACTOR] Reorganize dual contouring vertex overlap logic into separate modules#49
Leguark merged 8 commits intomainfrom
pretty_faults

Conversation

@Leguark
Copy link
Member

@Leguark Leguark commented Mar 13, 2026

[CLN] Refactor dual contouring vertex overlap logic and remove unused parallel processing code

Remove unused parallel processing code

  • Removed unused parallel processing functions _parallel_process, _parallel_process_surfaces_v2, and _process_surface_batch_v2 from _dual_contouring_v2.py
  • Cleaned up sequential processing fallback logic

Split vertex overlap logic into focused modules

  • Split _vertex_overlap.py into three specialized modules:
    • _find_vertex_overlap.py: Contains voxel overlap detection logic
    • _apply_vertex_overlap_logic.py: Handles relation-based overlap application
    • _apply_mesh_modifications.py: Contains mesh modification operations
  • Made apply_overlap_to_surface_pair public by removing underscore prefix
  • Updated function name from _apply_relations_to_overlaps to apply_relations_to_overlaps

Separate legacy vertex generation code

  • Moved _compute_vertices function from _gen_vertices.py to new _gen_vertices_legacy.py module
  • Updated imports in _dual_contouring.py and _sequential_triangulation.py to use legacy implementation
  • Cleaned up _gen_vertices.py to focus on core vertex generation functionality

Update interface references

  • Updated dual_contouring_interface.py to import from the new module structure
  • Changed function call from _apply_relations_to_overlaps to apply_relations_to_overlaps

Leguark added 7 commits March 10, 2026 08:15
- Made `apply_overlap_to_surface_pair` a public function by removing the leading underscore.
- Updated all relevant references to use the new function name for consistency.
- Moved `_compute_vertices` to a new `_gen_vertices_legacy.py` module for better code organization.
- Updated references to use the legacy implementation where appropriate.
… vertex averaging

- Added `find_and_inject_multi_surface_constraints` to inject cross-surface weighted QEF constraints at shared voxels.
- Enhanced `_gen_vertices` to incorporate extra constraints and apply weight scaling during QEF computation.
- Implemented `_average_overlapping_vertices` for watertight vertex alignment across overlapping meshes.
- Updated tests to validate the weighted QEF pipeline, vertex overlap resolution, and high-resolution stress scenarios.
…moval

- Replaced pairwise vertex averaging with all-surface averaging for watertightness at overlap voxels.
- Introduced `_remove_fault_overlap_triangles` to handle removal of triangles from overlapping fault and layer meshes.
- Reduced `DEFAULT_CROSS_SURFACE_WEIGHT` to 10.0 for better constraint handling.
- Updated tests to validate triangle removal at
Copy link
Member Author

Leguark commented Mar 13, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Leguark Leguark marked this pull request as ready for review March 18, 2026 14:17
@Leguark Leguark changed the title [CLN] Remove unused code for parallel processing [REFACTOR] Reorganize dual contouring vertex overlap logic into separate modules Mar 18, 2026
- Disabled `plt.savefig` calls in `test_finite_fault_splines.py` and `test_finite_fault_uv_map_plots.py` for cleaner test outputs.
- Streamlined test behavior by focusing on plot display without file generation.
Copy link
Member Author

Leguark commented Mar 20, 2026

Merge activity

  • Mar 20, 10:28 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 20, 10:28 AM UTC: @Leguark merged this pull request with Graphite.

@Leguark Leguark merged commit 77c93f2 into main Mar 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant