Skip to content

Updated integral_mean_curvature function #2416

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

Merged
merged 4 commits into from
Jun 11, 2025

Conversation

yajushikhurana
Copy link
Contributor

The integral_mean_curvature (IMC) function did not agree with the analytical value for non-convex objects such as a torus and an annulus. The angle in the function needs to have an appropriate sign to detect concave angles. This code corrects that error and also adds a test function for IMC to test for non-convex objects.

@mikedh
Copy link
Owner

mikedh commented Jun 11, 2025

Awesome thanks for the PR and test! Quick question, do we need another function and attribute for vector_angle_with_sign? Couldn't one use the existing mesh.face_adjacency_convex value?

In [12]: signs = np.array([-1.0, 1.0])[m.face_adjacency_convex.astype(np.int64)]

In [13]: angles = m.face_adjacency_angles * signs

@yajushikhurana
Copy link
Contributor Author

Thank you for the review. You are right! I initially added vector_angle_with_sign to handle signed angles manually, but I overlooked the fact that mesh.face_adjacency_convex can provide what’s needed. I've updated the PR.

@mikedh mikedh changed the base branch from main to release/docfix June 11, 2025 18:58
@mikedh mikedh merged commit 64e03ea into mikedh:release/docfix Jun 11, 2025
9 checks passed
@mikedh
Copy link
Owner

mikedh commented Jun 11, 2025

Looks great thanks for the update!

mikedh added a commit that referenced this pull request Jun 11, 2025
- fix minimum Python version in readme
- release #2416
- release #2415
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