geodesic 0.1.0

A Rust library for constructing and sampling 3D geometric scenes.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Bounded geometry trait.

use nalgebra::RealField;
use std::borrow::Cow;

use crate::{error::Result, geometry::Aabb};

/// Types implementing this type can be bounded by an axis-aligned bounding box (`Aabb`).
pub trait Bounded<T: RealField + Copy> {
    /// Get the axis-aligned bounding box of the geometry.
    ///
    /// # Errors
    ///
    /// Returns an error if the bounding box calculation fails due to invalid
    /// geometry parameters or mathematical operations.
    fn aabb(&self) -> Result<Cow<Aabb<T>>>;
}