fj_kernel/algorithms/sweep/
sketch.rs

1use fj_math::Vector;
2
3use crate::{
4    objects::{Sketch, Solid},
5    operations::Insert,
6    services::Services,
7    storage::Handle,
8};
9
10use super::{Sweep, SweepCache};
11
12impl Sweep for Handle<Sketch> {
13    type Swept = Handle<Solid>;
14
15    fn sweep_with_cache(
16        self,
17        path: impl Into<Vector<3>>,
18        cache: &mut SweepCache,
19        services: &mut Services,
20    ) -> Self::Swept {
21        let path = path.into();
22
23        let mut shells = Vec::new();
24        for face in self.faces().clone() {
25            let shell = face.sweep_with_cache(path, cache, services);
26            shells.push(shell);
27        }
28
29        Solid::new(shells).insert(services)
30    }
31}