initial commit

This commit is contained in:
2025-12-25 10:23:02 -06:00
commit d5da9213aa
24 changed files with 4320 additions and 0 deletions

27
src/geometry/atom.rs Normal file
View 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>>;