axiolid_model/
surface_relation.rs1use axiolid_core::{Scalar, Vec3};
4
5use crate::NodeId;
6
7#[non_exhaustive]
9#[derive(Debug, Clone, PartialEq)]
10pub enum SurfaceRelation {
11 CurveBounded {
13 basis: NodeId,
14 boundaries: Vec<NodeId>,
15 implicit_outer: bool,
16 },
17 RectangularTrimmed {
19 basis: NodeId,
20 u: (Scalar, Scalar),
21 v: (Scalar, Scalar),
22 u_sense: bool,
23 v_sense: bool,
24 },
25 Offset {
27 basis: NodeId,
28 distance: Scalar,
29 self_intersect: Option<bool>,
30 },
31 LinearExtrusion {
33 swept_curve: NodeId,
34 direction: Vec3,
35 },
36 Revolution {
38 swept_curve: NodeId,
39 axis_origin: axiolid_core::Point3,
40 axis_direction: Vec3,
41 },
42}
43
44impl SurfaceRelation {
45 pub(crate) fn references(&self, out: &mut Vec<NodeId>) {
46 match self {
47 Self::CurveBounded {
48 basis, boundaries, ..
49 } => {
50 out.push(*basis);
51 out.extend(boundaries.iter().copied());
52 }
53 Self::RectangularTrimmed { basis, .. } | Self::Offset { basis, .. } => out.push(*basis),
54 Self::LinearExtrusion { swept_curve, .. } | Self::Revolution { swept_curve, .. } => {
55 out.push(*swept_curve)
56 }
57 }
58 }
59}