Simplify model

This commit is contained in:
Hanno Braun 2024-10-30 01:29:06 +01:00
parent 663a794840
commit fc595f6246
2 changed files with 6 additions and 9 deletions

View File

@ -3,6 +3,7 @@ mod model;
mod export;
fn main() -> anyhow::Result<()> {
model::model()?;
let mesh = model::model()?;
export::export(mesh.vertices, mesh.triangles)?;
Ok(())
}

View File

@ -1,6 +1,6 @@
use crate::{export::export, mesh::Mesh};
use crate::mesh::Mesh;
pub fn model() -> anyhow::Result<()> {
pub fn model() -> anyhow::Result<Mesh> {
let vertices = vec![
[-0.5, -0.5, -0.5], // 0
[0.5, -0.5, -0.5], // 1
@ -27,12 +27,8 @@ pub fn model() -> anyhow::Result<()> {
[4, 7, 6],
];
let mesh = Mesh {
Ok(Mesh {
vertices,
triangles,
};
export(mesh.vertices, mesh.triangles)?;
Ok(())
})
}