#[derive(Debug, Clone, PartialEq)]
pub struct Vertex2D {
pub x: f64,
pub y: f64,
}
impl Vertex2D {
pub fn new(x: f64, y: f64) -> Self {
Self { x, y }
}
}
#[derive(Debug, Clone, PartialEq)]
pub struct SliceSegment {
pub v2: usize,
}
impl SliceSegment {
pub fn new(v2: usize) -> Self {
Self { v2 }
}
}
#[derive(Debug, Clone)]
pub struct SlicePolygon {
pub startv: usize,
pub segments: Vec<SliceSegment>,
}
impl SlicePolygon {
pub fn new(startv: usize) -> Self {
Self {
startv,
segments: Vec::new(),
}
}
}
#[derive(Debug, Clone)]
pub struct Slice {
pub ztop: f64,
pub vertices: Vec<Vertex2D>,
pub polygons: Vec<SlicePolygon>,
}
impl Slice {
pub fn new(ztop: f64) -> Self {
Self {
ztop,
vertices: Vec::new(),
polygons: Vec::new(),
}
}
}
#[derive(Debug, Clone)]
pub struct SliceRef {
pub slicestackid: usize,
pub slicepath: String,
}
impl SliceRef {
pub fn new(slicestackid: usize, slicepath: String) -> Self {
Self {
slicestackid,
slicepath,
}
}
}
#[derive(Debug, Clone)]
pub struct SliceStack {
pub id: usize,
pub zbottom: f64,
pub slices: Vec<Slice>,
pub slice_refs: Vec<SliceRef>,
}
impl SliceStack {
pub fn new(id: usize, zbottom: f64) -> Self {
Self {
id,
zbottom,
slices: Vec::new(),
slice_refs: Vec::new(),
}
}
}