use std::fmt::Debug; use bvh::{ aabb::{Aabb, Bounded}, bounding_hierarchy::BHShape, bvh::Bvh, }; use nalgebra::{Point, Scalar, SimdPartialOrd}; pub mod base_slices; #[derive(Debug, PartialEq, Clone, Copy)] pub struct Triangle { pub a: Point, pub b: Point, pub c: Point, pub normal: Point, pub node_index: usize, } impl Bounded for Triangle { fn aabb(&self) -> Aabb { let mut aabb = self.a.aabb(); aabb.grow_mut(&self.b); aabb.grow_mut(&self.c); aabb } } impl BHShape for Triangle { fn set_bh_node_index(&mut self, node_index: usize) { self.node_index = node_index; } fn bh_node_index(&self) -> usize { self.node_index } } #[derive(Debug, PartialEq, Clone, Copy)] pub struct Line { pub start: Point, pub end: Point, } #[derive(Debug)] pub struct SlicerOptions { pub aabb: bvh::aabb::Aabb, pub bvh: Bvh, pub triangles: Vec>, pub layer_height: f32, }