use axiolid_core::{Scalar, Vec3};
use crate::NodeId;
#[non_exhaustive]
#[derive(Debug, Clone, PartialEq)]
pub enum SurfaceRelation {
CurveBounded {
basis: NodeId,
boundaries: Vec<NodeId>,
implicit_outer: bool,
},
RectangularTrimmed {
basis: NodeId,
u: (Scalar, Scalar),
v: (Scalar, Scalar),
u_sense: bool,
v_sense: bool,
},
Offset {
basis: NodeId,
distance: Scalar,
self_intersect: Option<bool>,
},
LinearExtrusion {
swept_curve: NodeId,
direction: Vec3,
},
Revolution {
swept_curve: NodeId,
axis_origin: axiolid_core::Point3,
axis_direction: Vec3,
},
}
impl SurfaceRelation {
pub(crate) fn references(&self, out: &mut Vec<NodeId>) {
match self {
Self::CurveBounded {
basis, boundaries, ..
} => {
out.push(*basis);
out.extend(boundaries.iter().copied());
}
Self::RectangularTrimmed { basis, .. } | Self::Offset { basis, .. } => out.push(*basis),
Self::LinearExtrusion { swept_curve, .. } | Self::Revolution { swept_curve, .. } => {
out.push(*swept_curve)
}
}
}
}