conspire 0.7.1

The Rust interface to conspire.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[cfg(test)]
mod test;

use crate::geometry::{
    bbox::{BoundingBox, Unite},
    bvh::primitive::Primitive,
};

impl<const D: usize> From<&[Primitive<D>]> for BoundingBox<D> {
    fn from(primitives: &[Primitive<D>]) -> Self {
        primitives
            .iter()
            .skip(1)
            .fold(primitives[0].bounding_box.clone(), |bbox, primitive| {
                bbox.unite(&primitive.bounding_box)
            })
    }
}