Skip to content

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
mikedh added a commit that referenced this pull request Jun 27, 2025
- add and test `path.copy(layers={1, 2})` to only copy particular
layers.
- add the note about signed angles discussed in #2416 
- add a `trimesh.primitives.Extrusion(..., mid_plane: bool)` option as a
helper to produce extrusions that are centered at the origin.
- convert `test_extrude` and `test_primitives` to pytest style, and
remove the outdated test skip if `triangle` isn't installed.
- fix and test units on 3MF imports, which were being stomped by the
`metadata = None` keyword argument.
- remove unused `trimesh.exchange.gltf._mesh_to_materials` function.
- release #2420
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