Split module

This commit is contained in:
Hanno Braun 2024-11-06 21:09:00 +01:00
parent f8c928a940
commit 19e2c099e3
2 changed files with 24 additions and 18 deletions

View File

@ -1,21 +1,9 @@
mod operation; mod operation;
mod ops_log; mod ops_log;
mod primitives;
pub use self::{operation::Operation, ops_log::OpsLog}; pub use self::{
operation::Operation,
use crate::math::Point; ops_log::OpsLog,
primitives::{Triangle, Vertex},
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)] };
pub struct Vertex {
pub point: Point,
}
impl Operation for Vertex {
fn vertices(&self, vertices: &mut Vec<Vertex>) {
vertices.push(*self);
}
fn triangles(&self, _: &mut Vec<Triangle>) {}
}
pub type Triangle = [Vertex; 3];

View File

@ -0,0 +1,18 @@
use crate::math::Point;
use super::Operation;
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
pub struct Vertex {
pub point: Point,
}
impl Operation for Vertex {
fn vertices(&self, vertices: &mut Vec<Vertex>) {
vertices.push(*self);
}
fn triangles(&self, _: &mut Vec<Triangle>) {}
}
pub type Triangle = [Vertex; 3];