-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: identify overlapping vertices at UV seams #4
Conversation
- Introduce `get_overlapping_vertices` for vertex grouping. - Account for floating-point imprecision in vertex positions. - Ensure accurate identification without false positives. - Function returns a list of arrays with vertex indices. test: ensure accurate overlapping vertex identification - Verify accurate detection of overlapping vertices. - Confirm no false positives are returned. - Test with varying mesh complexities. - Check for match detection within a few milliseconds.
- Update function to process all vertices if indices are not provided. - Handle cases with 'None' or empty list for indices. - Improve function's flexibility and robustness for various cases. test: add new cases for get_overlapping_vertices function - Include unit tests for scenarios with 'None' or empty indices. - Ensure function behaves as expected in these special cases. - Enhance reliability and test coverage.
imprecision test is failing with current implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left comments
- Implement a tolerance parameter in get_overlapping_vertices for better vertex grouping. - Add tests to verify the new functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still missing a test for expected IndexError
Add test for IndexError in get_overlapping_vertices
fix type of expected in test_get_overlapping_vertices to IndexGroups
- Handle empty and negative indices in get_overlapping_vertices. - Include additional tests to cover new checks.
# Not using try / except because when using an index of -1 gets the last element and creates a false positive | ||
if indices is None: | ||
selected_vertices = vertices_pos | ||
else: | ||
if len(indices) == 0: | ||
return [] | ||
if np.any(indices < 0): | ||
msg = "Negative index value is not allowed." | ||
raise IndexError(msg) | ||
|
||
if np.max(indices) >= len(vertices_pos): | ||
msg = "Index is out of bounds." | ||
raise IndexError(msg) | ||
|
||
selected_vertices = vertices_pos[indices] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnnessary and pushed after approval.
# Case with index out of bounds (higher than max) | ||
np.array([0, 3], dtype=np.uint16), | ||
# Case with index out of bounds (negative index) | ||
np.array([0, -1], dtype=np.int32), # Using int32 to allow negative values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should still be valid. Only negative indices that are out of bounds should raise. -1 is not out of bounds in this example, neither is -2, but -3 would be out of bounds.
get_overlapping_vertices
for vertex grouping.test: ensure accurate overlapping vertex identification
Description
We need to group the vertices that share the same 3D Position so we ca blend the vertex color.
This function is vital for the vertex color blending.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Test Configuration:
Checklist