Another project
0

Configure Feed

Select the types of activity you want to include in your feed.

at main 1.4 kB View raw
1use bone_types::{Plane3, SketchEntityId}; 2 3use crate::curve2::Curve2Kind; 4 5#[derive(Copy, Clone, Debug, PartialEq)] 6pub struct ProfileEdge { 7 curve: Curve2Kind, 8 curve_entity: SketchEntityId, 9 corner: SketchEntityId, 10} 11 12impl ProfileEdge { 13 #[must_use] 14 pub const fn new( 15 curve: Curve2Kind, 16 curve_entity: SketchEntityId, 17 corner: SketchEntityId, 18 ) -> Self { 19 Self { 20 curve, 21 curve_entity, 22 corner, 23 } 24 } 25 26 #[must_use] 27 pub const fn curve(self) -> Curve2Kind { 28 self.curve 29 } 30 31 #[must_use] 32 pub const fn curve_entity(self) -> SketchEntityId { 33 self.curve_entity 34 } 35 36 #[must_use] 37 pub const fn corner(self) -> SketchEntityId { 38 self.corner 39 } 40} 41 42#[derive(Clone, Debug, PartialEq)] 43pub enum ProfileLoop { 44 Closed { 45 curve: Curve2Kind, 46 curve_entity: SketchEntityId, 47 }, 48 Open(Vec<ProfileEdge>), 49} 50 51#[derive(Clone, Debug, PartialEq)] 52pub struct ExtrudeProfile { 53 plane: Plane3, 54 loops: Vec<ProfileLoop>, 55} 56 57impl ExtrudeProfile { 58 #[must_use] 59 pub fn new(plane: Plane3, loops: Vec<ProfileLoop>) -> Self { 60 Self { plane, loops } 61 } 62 63 #[must_use] 64 pub fn plane(&self) -> Plane3 { 65 self.plane 66 } 67 68 #[must_use] 69 pub fn loops(&self) -> &[ProfileLoop] { 70 &self.loops 71 } 72}