25 void init_shamrock_math_AABB(py::module &m, std::string name) {
26 py::class_<shammath::AABB<T>>(m, name.c_str())
27 .def(py::init([](f64_3 min, f64_3 max) {
28 return std::make_unique<shammath::AABB<T>>(min, max);
46 [](
const shammath::AABB<T> &aabb) {
47 return shambase::format(
"AABB(lower={}, upper={})", aabb.
lower, aabb.
upper);
49 .def(
"__repr__", [](
const shammath::AABB<T> &aabb) {
50 return shambase::format(
"AABB(lower={}, upper={})", aabb.
lower, aabb.
upper);
54 template void init_shamrock_math_AABB<f64_3>(py::module &m, std::string name);
Define the fmt formatters for sycl::vec.
Pybind11 include and definitions.
T delt() const
Returns the delta of the AABB.
T get_center() const noexcept
Returns the center of the AABB.
bool is_surface() const noexcept
Checks if the AABB is a surface.
bool is_surface_or_volume() const noexcept
Checks if the AABB is a surface or a volume.
bool intersect_ray(Ray< T > ray) const noexcept
Check if the ray intersect the AABB.
bool is_volume_not_null() const noexcept
Checks if the AABB has a non-zero volume.
T lower
Lower bound of the AABB.
bool is_not_empty() const noexcept
Checks if the AABB is non-empty.
Tscal get_volume()
Returns the volume of the AABB.
T upper
Upper bound of the AABB.
AABB get_intersect(AABB other) const noexcept
Compute the intersection of two AABB.
T sum_bounds() const noexcept
Returns the sum of the lower and upper bounds of the AABB.