mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-06 10:58:28 +00:00
Simplify
This commit is contained in:
parent
c2eb84c84b
commit
0c46ec8d3b
@ -1,15 +1,16 @@
|
||||
use std::fs::File;
|
||||
|
||||
pub fn export(
|
||||
vertices: impl IntoIterator<Item = [f64; 3]>,
|
||||
triangles: impl IntoIterator<Item = [usize; 3]>,
|
||||
) -> anyhow::Result<()> {
|
||||
let vertices = vertices
|
||||
use crate::mesh::Mesh;
|
||||
|
||||
pub fn export(mesh: Mesh) -> anyhow::Result<()> {
|
||||
let vertices = mesh
|
||||
.vertices
|
||||
.into_iter()
|
||||
.map(|[x, y, z]| threemf::model::Vertex { x, y, z })
|
||||
.collect();
|
||||
|
||||
let triangles = triangles
|
||||
let triangles = mesh
|
||||
.triangles
|
||||
.into_iter()
|
||||
.map(|[v1, v2, v3]| threemf::model::Triangle { v1, v2, v3 })
|
||||
.collect();
|
||||
|
@ -4,6 +4,6 @@ mod model;
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
let mesh = model::model()?;
|
||||
export::export(mesh.vertices, mesh.triangles)?;
|
||||
export::export(mesh)?;
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user