Skip to content

Conversation

@gunney1
Copy link
Contributor

@gunney1 gunney1 commented Jan 14, 2026

Summary

  • This PR is a feature
  • It does the following:
    • Add TetMeshClipper implementation for MeshClipper. This supports shapes defined by tetrahedral mesh, including ProE shapes.
    • Add tests for TetMeshClipper, with 2 configurations: a simple 3-tet mesh and the mesh in cup.proe.

This is the last of the supported geometries for MeshClipper.

@gunney1 gunney1 force-pushed the feature/gunney/tetmesh-clipper branch from 94f202b to c988fd2 Compare January 14, 2026 03:04
@gunney1 gunney1 self-assigned this Jan 14, 2026
@gunney1 gunney1 added Quest Issues related to Axom's 'quest' component Performance Issues related to code performance labels Jan 14, 2026
@gunney1 gunney1 added this to the FY26 January Release milestone Jan 14, 2026
Copy link
Member

@kennyweiss kennyweiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gunney1

Comment on lines +1018 to +1021
if(!geomTetsView[i].degenerate())
{
pieceBbsView[i] = primal::compute_bounding_box<double, 3>(geomTetsView[i]);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to filter out degenerate tets before running the algorithm?

Copy link
Contributor Author

@gunney1 gunney1 Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that would make sense, and I originally had a SLIC_ERROR_IF there to catch it. But as a user who is given an array of tets generated elsewhere, I found it annoying to have to find and filter out the degenerate ones. The check here makes Axom more robust at a negligible cost.

Comment on lines 113 to 126
/*
* - Put surface triangles in BVH.
* - Create a bounding box and a ray for every mesh hex. The ray
* originates from the bounding box center and points away from
* the center of m_tetMeshBb.
* - Use BVH::findBoundingBoxes and BVH::findRay to get surface
* triangles near the bounding boxes and rays.
* - Loop through the hexes.
* - If hex bb is near any surface triangle bb, label the hex ON.
* - Else, the hex is either IN or OUT. It can't possibly be ON.
* Count number of surface triangles that the hex's ray intersects,
* @see intersect(const Triangle<T, 3>& tri, const Ray<T, 3>& ray)
* If the count is odd, hex is IN, if even, OUT.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please clarify this algorithm?

For each hex, it has a ray from the hex center and it's counting the intersections from the center to each triangle that it encounters within the hex bounding box and returning the parity?

Did I get that right?

Can you post some performance stats for this? Specifically, how expensive is this step (+ the query) vs. a simpler strategy of returning IN if the bounding box of a tet intersects any tets, and returning OUT otherwise? Or perhaps just checking the bounding box of each hex w/ the bounding boxes of the tets?

Copy link
Contributor Author

@gunney1 gunney1 Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You got that right. I will rewrite the comments along those lines. I plan to post performance stats for all the geometries soon. From what I've seen in my toy test configuration, this approach of counting intersections with the boundaries is not expensive. I've also seen that not identifying as many IN tets as possible will degrade fast with mesh resolution, because there will be many that are IN.

- Old version was prone to give wrong answer for concave cells.
- Also, computed the tet vertex average wrong.
Base automatically changed from feature/gunney/sor-clipper to develop January 20, 2026 19:55
@gunney1 gunney1 merged commit b601800 into develop Jan 20, 2026
15 checks passed
@gunney1 gunney1 deleted the feature/gunney/tetmesh-clipper branch January 20, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Performance Issues related to code performance Quest Issues related to Axom's 'quest' component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants