bevy
bevy copied to clipboard
Tetrahedron sampling
Objective
Add interior and boundary sampling for the Tetrahedron
primitive. This is part of ongoing work to bring the primitives to parity with each other in terms of their capabilities.
Solution
Tetrahedron
implements the ShapeSample
trait. To support this, there is a new public method Tetrahedron::faces
which gets the faces of a tetrahedron as Triangle3d
s. There are more sophisticated ideas for getting the faces we might want to consider in the future (e.g. adjusting according to the orientation), but this method gives the most mathematically straightforward answer, giving the faces the orientation induced by the tetrahedron itself.