Prepare for making Scalar NaN-safe

This commit is contained in:
Hanno Braun 2024-11-06 19:08:56 +01:00
parent c55bb57338
commit babe357f11
2 changed files with 7 additions and 1 deletions

View File

@ -4,3 +4,9 @@ pub type Point = [Scalar; 3];
pub struct Scalar {
pub inner: f64,
}
impl Scalar {
pub fn new(value: f64) -> Self {
Self { inner: value }
}
}

View File

@ -13,7 +13,7 @@ pub fn model() -> anyhow::Result<Mesh> {
[-0.5, 0.5, 0.5], // 6
[0.5, 0.5, 0.5], // 7
]
.map(|point| mesh.vertex(point.map(|coord| Scalar { inner: coord })));
.map(|point| mesh.vertex(point.map(Scalar::new)));
[
[0, 4, 6], // left