initial commit
This commit is contained in:
27
src/geometry/atom.rs
Normal file
27
src/geometry/atom.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
use std::{cell::RefCell, collections::HashMap, rc::Rc};
|
||||
|
||||
use kiss3d::nalgebra::Point3;
|
||||
|
||||
use crate::geometry::{
|
||||
face::{Face, FaceId, FaceType},
|
||||
polyhedra::cube::create_cube_atom,
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Polyhedron {
|
||||
pub vertices: Vec<Point3<f32>>,
|
||||
pub faces: Vec<Face>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct PrimitiveAtom {
|
||||
pub geometry: Polyhedron,
|
||||
pub faces: Vec<FaceId>,
|
||||
pub face_types: HashMap<FaceId, FaceType>,
|
||||
}
|
||||
|
||||
pub fn load_atoms() -> Vec<PrimitiveAtom> {
|
||||
vec![create_cube_atom()]
|
||||
}
|
||||
|
||||
pub type AtomRef = Rc<RefCell<PrimitiveAtom>>;
|
||||
Reference in New Issue
Block a user