mirror of
https://github.com/hannobraun/Fornjot
synced 2025-08-05 16:56:06 +00:00
Prepare for follow-on change
This commit is contained in:
parent
3ac70f4877
commit
2d4b58e07f
@ -5,8 +5,6 @@ use crate::geometry::{Mesh, Vertex};
|
||||
pub fn export(mesh: &Mesh) -> anyhow::Result<()> {
|
||||
let vertices = mesh
|
||||
.vertices()
|
||||
.iter()
|
||||
.copied()
|
||||
.map(|Vertex { point: [x, y, z] }| threemf::model::Vertex { x, y, z })
|
||||
.collect();
|
||||
|
||||
|
@ -5,8 +5,8 @@ pub struct Mesh {
|
||||
}
|
||||
|
||||
impl Mesh {
|
||||
pub fn vertices(&self) -> &[Vertex] {
|
||||
&self.vertices
|
||||
pub fn vertices(&self) -> impl Iterator<Item = Vertex> + '_ {
|
||||
self.vertices.iter().copied()
|
||||
}
|
||||
|
||||
pub fn triangles(&self) -> impl Iterator<Item = Triangle> + '_ {
|
||||
|
@ -194,7 +194,9 @@ impl Renderer {
|
||||
for triangle in mesh.triangles() {
|
||||
let triangle = triangle.map(|index| {
|
||||
Vec3::from(
|
||||
mesh.vertices()[index as usize]
|
||||
mesh.vertices()
|
||||
.nth(index as usize)
|
||||
.unwrap()
|
||||
.point
|
||||
.map(|coord| coord as f32),
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user