axom icon indicating copy to clipboard operation
axom copied to clipboard

Add `intersection_volume(Hexahedron, Tetrahedron)` geometric primitive to primal

Open kennyweiss opened this issue 2 years ago • 0 comments

A user requested a new primitive operation in primal to return the intersection volume between a hexahedron and a tetrahedron.

We already have

  • a Tetrahedron object
  • functionality to decompose a hexahedron into 24 Tetrahedra, and
  • a geometric primitive to find the clipped region in the intersection of two tetrahedra (primal::clip(primal::Tetrahedron, primal::Tetrahedron) -> primal::Polyhedron) which has a volume() function.

To implement this, we'd need

  • a new geometric primitive:: Hexahedron to define a (linear) hexahedron in 3D defined by 8 vertices, and
  • an intersection_volume(Hexahedron, Tetrahedron) operator

Note: The new intersection_volume operator needs to work on the host or device.

See:

  • https://github.com/LLNL/axom/blob/develop/src/axom/primal/geometry/Tetrahedron.hpp
  • https://github.com/LLNL/axom/blob/88cac26073cafb969bbdbe71c86b51a3ecfea211/src/axom/quest/IntersectionShaper.hpp#L124-L178
  • https://github.com/LLNL/axom/blob/88cac26073cafb969bbdbe71c86b51a3ecfea211/src/axom/primal/operators/clip.hpp#L132-L161

kennyweiss avatar Aug 23 '22 00:08 kennyweiss