mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-05 18:38:28 +00:00
Add Mesh::push_triangle
This commit is contained in:
parent
e1f79bd171
commit
924e9a03d4
@ -8,4 +8,8 @@ impl Mesh {
|
||||
pub fn push_vertex(&mut self, vertex: [f32; 3]) {
|
||||
self.vertices.push(vertex);
|
||||
}
|
||||
|
||||
pub fn push_triangle(&mut self, triangle: [u32; 3]) {
|
||||
self.triangles.push(triangle);
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ pub fn model() -> anyhow::Result<Mesh> {
|
||||
[4, 5, 7], // top
|
||||
[4, 7, 6],
|
||||
]
|
||||
.map(|triangle| mesh.triangles.push(triangle));
|
||||
.map(|triangle| mesh.push_triangle(triangle));
|
||||
|
||||
Ok(mesh)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user