Prepare for making Scalar NaN-safe

This commit is contained in:
Hanno Braun 2024-11-06 19:09:17 +01:00
parent babe357f11
commit 378047b79a
3 changed files with 6 additions and 2 deletions

View File

@ -14,7 +14,7 @@ pub fn export(mesh: &Mesh) -> anyhow::Result<()> {
vertex: mesh_vertices vertex: mesh_vertices
.into_iter() .into_iter()
.map(|Vertex { point }| point) .map(|Vertex { point }| point)
.map(|point| point.map(|coord| coord.inner)) .map(|point| point.map(|coord| coord.value()))
.map(|[x, y, z]| threemf::model::Vertex { x, y, z }) .map(|[x, y, z]| threemf::model::Vertex { x, y, z })
.collect(), .collect(),
}, },

View File

@ -9,4 +9,8 @@ impl Scalar {
pub fn new(value: f64) -> Self { pub fn new(value: f64) -> Self {
Self { inner: value } Self { inner: value }
} }
pub fn value(&self) -> f64 {
self.inner
}
} }

View File

@ -204,7 +204,7 @@ impl Renderer {
.get(index as usize) .get(index as usize)
.unwrap() .unwrap()
.point .point
.map(|coord| coord.inner as f32), .map(|coord| coord.value() as f32),
) )
}); });
let normal = { let normal = {