mirror of
https://github.com/hannobraun/Fornjot
synced 2025-09-07 01:46:50 +00:00
Update name of struct
This commit is contained in:
parent
25f49d9bc5
commit
204362bdcc
@ -8,9 +8,9 @@ use winit::{
|
|||||||
window::{Window, WindowAttributes, WindowId},
|
window::{Window, WindowAttributes, WindowId},
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{geometry::Mesh, render::Renderer};
|
use crate::{geometry::Operations, render::Renderer};
|
||||||
|
|
||||||
pub fn run(mesh: Mesh) -> anyhow::Result<()> {
|
pub fn run(mesh: Operations) -> anyhow::Result<()> {
|
||||||
let event_loop = EventLoop::new()?;
|
let event_loop = EventLoop::new()?;
|
||||||
|
|
||||||
let mut app = App {
|
let mut app = App {
|
||||||
@ -24,7 +24,7 @@ pub fn run(mesh: Mesh) -> anyhow::Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct App {
|
struct App {
|
||||||
mesh: Mesh,
|
mesh: Operations,
|
||||||
window: Option<Arc<Window>>,
|
window: Option<Arc<Window>>,
|
||||||
renderer: Option<Renderer>,
|
renderer: Option<Renderer>,
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
use std::{collections::BTreeMap, fs::File};
|
use std::{collections::BTreeMap, fs::File};
|
||||||
|
|
||||||
use crate::geometry::{Mesh, Operation, Vertex};
|
use crate::geometry::{Operation, Operations, Vertex};
|
||||||
|
|
||||||
pub fn export(mesh: &Mesh) -> anyhow::Result<()> {
|
pub fn export(mesh: &Operations) -> anyhow::Result<()> {
|
||||||
let mut mesh_vertices = Vec::new();
|
let mut mesh_vertices = Vec::new();
|
||||||
let mut mesh_triangles = Vec::new();
|
let mut mesh_triangles = Vec::new();
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
use crate::math::Point;
|
use crate::math::Point;
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct Mesh {
|
pub struct Operations {
|
||||||
pub vertices: Vec<Vertex>,
|
pub vertices: Vec<Vertex>,
|
||||||
pub triangles: Vec<Triangle>,
|
pub triangles: Vec<Triangle>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Mesh {
|
impl Operations {
|
||||||
pub fn vertex(&mut self, point: Point) {
|
pub fn vertex(&mut self, point: Point) {
|
||||||
let vertex = Vertex { point };
|
let vertex = Vertex { point };
|
||||||
self.vertices.push(vertex);
|
self.vertices.push(vertex);
|
||||||
@ -17,7 +17,7 @@ impl Mesh {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Operation for Mesh {
|
impl Operation for Operations {
|
||||||
fn vertices(&self, vertices: &mut Vec<Vertex>) {
|
fn vertices(&self, vertices: &mut Vec<Vertex>) {
|
||||||
vertices.extend(&self.vertices);
|
vertices.extend(&self.vertices);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use crate::{geometry::Mesh, math::Scalar};
|
use crate::{geometry::Operations, math::Scalar};
|
||||||
|
|
||||||
pub fn model() -> anyhow::Result<Mesh> {
|
pub fn model() -> anyhow::Result<Operations> {
|
||||||
let mut mesh = Mesh::default();
|
let mut mesh = Operations::default();
|
||||||
|
|
||||||
[
|
[
|
||||||
[-0.5, -0.5, -0.5], // 0
|
[-0.5, -0.5, -0.5], // 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user