bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Tetrahedron sampling

Open mweatherley opened this issue 9 months ago • 0 comments

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 Triangle3ds. 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.

mweatherley avatar May 20 '24 00:05 mweatherley