Skip to content

Enhance post_process_mesh for improved cluster filtering#253

Open
filippocastelli wants to merge 1 commit intohbb1:mainfrom
filippocastelli:main
Open

Enhance post_process_mesh for improved cluster filtering#253
filippocastelli wants to merge 1 commit intohbb1:mainfrom
filippocastelli:main

Conversation

@filippocastelli
Copy link

This pull request improves the mesh post-processing utility by making the filtering of mesh clusters more robust and configurable. The main enhancement is the ability to specify a minimum cluster size and to ensure that the number of clusters kept is always valid, which helps prevent errors and improves mesh quality.

Improvements to mesh post-processing:

  • The post_process_mesh function now accepts a min_cluster_size parameter, allowing users to filter out clusters smaller than a specified threshold.
  • The function clamps the number of clusters to keep (clusters_to_keep) to a valid range based on the actual number of clusters in the mesh, preventing out-of-bounds errors.
  • Added logic to handle cases where no clusters are found, returning the mesh unchanged and printing a message for clarity.
  • Improved code clarity by removing unused imports and moving the copy import to the top of the file.

Updated the post_process_mesh function to allow for a minimum cluster size parameter and added checks for empty clusters. The function now clamps the number of clusters to keep within valid bounds and ensures that clusters smaller than the specified minimum size are filtered out.
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.

2 participants