raytracing/shapes/_3d/
rectangular_prism.rs

1use crate::shapes::nd::HyperRectangle;
2
3pub type RectangularPrism<F> = HyperRectangle<F, 3>;
4
5#[cfg(test)]
6mod test
7{
8    use core::f64::consts::FRAC_PI_4;
9
10    use crate::{shapes::Transform, tests};
11
12    use super::RectangularPrism;
13
14    #[test]
15    #[ignore]
16    fn test()
17    {
18        let shape = Transform::new(RectangularPrism {
19            c1: [-2.0, -1.0, -1.0],
20            c2: [2.0, 1.0, 1.0]
21        }).rotate([1.0, 0.0, 0.0], -FRAC_PI_4)
22        .rotate([0.0, 1.0, 0.0], FRAC_PI_4);
23
24        const D: f64 = 3.0;
25        const A: f64 = 0.0;
26
27        tests::project_3d_spin(&shape, [0.0, 0.0, -3.0], D, A);
28    }
29}