Correctness of primal::intersection_volume(Hexahedron, Tetrahedron)
for general hexahedra
#1396
Labels
bug
Something isn't working
Documentation
Issues related to documentation
Primal
Issues related to Axom's 'primal component
Reviewed
The current implementation of
primal::intersection_volume(Hexahedron, Tetrahedron)
usesprimal::clip(Hexahedron, Tetrahedron)
, which in turn usesprimal::Polyhedron::from_primitive(Hexahedron)
.However, since our
Polyhedron
class assumes planar faces,primal::Polyhedron::from_primitive(Hexahedron)
is not valid for hexahedra with non-planar faces. Since ourHexahedron
class is initialized with 8 unconstrained vertices, the faces of a (valid) Hexahedron will be bilinear rather than planar.To remedy this:
Hexahedron
to check if its faces are (nearly) planarPolyhedron::from_primitive(Hexahedron)
should only operate on Hexahedra with planar faces. This should either be explicitly checked at runtime, or in debug mode (viaSLIC_DEBUG
). At the very least, we should document thisprimal::clip(Hexahedron, Tetrahedron)
is only applicable to planar Hexahedra. We should add this to the docs, and consider adding runtime/debug checks, as appropriateprimal::intersection_volume(Hexahedron, Tetrahedron)
should be updated to split Hexahedra into 24 tets and return the sum of the volumes of their intersections. When the inputHexahedron
has planar faces, we can use the current clip algorithm.clip
is more performant than the "sum of intersections" algorithm and use the more performant oneintersection_volume(Hex, Tet)
to ensure we have cases with non-planar hexahedra.The text was updated successfully, but these errors were encountered: