28 lines
585 B
Rust
28 lines
585 B
Rust
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>>;
|