mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-08 20:08:30 +00:00
Add Mesh
This commit is contained in:
parent
02348ebe9e
commit
b610abeffc
@ -1,3 +1,4 @@
|
|||||||
|
mod mesh;
|
||||||
mod model;
|
mod model;
|
||||||
mod export;
|
mod export;
|
||||||
|
|
||||||
|
4
experiments/2024-10-30/src/mesh.rs
Normal file
4
experiments/2024-10-30/src/mesh.rs
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
pub struct Mesh {
|
||||||
|
pub vertices: Vec<[f64; 3]>,
|
||||||
|
pub triangles: Vec<[usize; 3]>,
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
use crate::export::export;
|
use crate::{export::export, mesh::Mesh};
|
||||||
|
|
||||||
pub fn model() -> anyhow::Result<()> {
|
pub fn model() -> anyhow::Result<()> {
|
||||||
let vertices = [
|
let vertices = [
|
||||||
@ -27,7 +27,12 @@ pub fn model() -> anyhow::Result<()> {
|
|||||||
[4, 7, 6],
|
[4, 7, 6],
|
||||||
];
|
];
|
||||||
|
|
||||||
export(vertices, triangles)?;
|
let mesh = Mesh {
|
||||||
|
vertices: vertices.into_iter().collect(),
|
||||||
|
triangles: triangles.into_iter().collect(),
|
||||||
|
};
|
||||||
|
|
||||||
|
export(mesh.vertices, mesh.triangles)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user