fj_core/objects/kinds/
sketch.rs

1use crate::{
2    objects::{ObjectSet, Region},
3    storage::Handle,
4};
5
6/// A 2-dimensional shape
7#[derive(Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)]
8pub struct Sketch {
9    regions: ObjectSet<Region>,
10}
11
12impl Sketch {
13    /// Construct an empty instance of `Sketch`
14    pub fn new(regions: impl IntoIterator<Item = Handle<Region>>) -> Self {
15        Self {
16            regions: regions.into_iter().collect(),
17        }
18    }
19
20    /// Access the regions of the sketch
21    pub fn regions(&self) -> &ObjectSet<Region> {
22        &self.regions
23    }
24}