Simplify type of function parameter

This commit is contained in:
Hanno Braun 2024-11-05 18:18:32 +01:00
parent 68b97e02a2
commit bc62168984
2 changed files with 4 additions and 4 deletions

View File

@ -15,8 +15,8 @@ impl Mesh {
self.triangles.iter().copied()
}
pub fn vertex(&mut self, vertex: Vertex) {
self.vertices.push(vertex);
pub fn vertex(&mut self, point: Point) {
self.vertices.push(Vertex { point });
}
pub fn triangle(&mut self, triangle: Triangle) {

View File

@ -1,4 +1,4 @@
use crate::geometry::{Mesh, Vertex};
use crate::geometry::Mesh;
pub fn model() -> anyhow::Result<Mesh> {
let mut mesh = Mesh::default();
@ -13,7 +13,7 @@ pub fn model() -> anyhow::Result<Mesh> {
[-0.5, 0.5, 0.5], // 6
[0.5, 0.5, 0.5], // 7
]
.map(|vertex| mesh.vertex(Vertex { point: vertex }));
.map(|vertex| mesh.vertex(vertex));
[
[0, 4, 6], // left