mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-06 10:58:28 +00:00
Split module
This commit is contained in:
parent
f8c928a940
commit
19e2c099e3
@ -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];
|
|
||||||
|
18
experiments/2024-10-30/src/geometry/primitives.rs
Normal file
18
experiments/2024-10-30/src/geometry/primitives.rs
Normal 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];
|
Loading…
Reference in New Issue
Block a user