egml_core/util/
plane.rs

1use crate::Error;
2use crate::model::geometry::DirectPosition;
3use nalgebra::Vector3;
4
5#[derive(Debug, Clone, Copy, PartialEq, Default)]
6pub struct Plane {
7    pub point: DirectPosition,
8    normal: Vector3<f64>,
9}
10
11impl Plane {
12    pub fn new(point: DirectPosition, normal: Vector3<f64>) -> Result<Self, Error> {
13        Ok(Self { point, normal })
14    }
15
16    pub fn normal(&self) -> Vector3<f64> {
17        self.normal
18    }
19}