fj_kernel/algorithms/sweep/
mod.rs1mod curve;
4mod edge;
5mod face;
6mod sketch;
7mod vertex;
8
9use std::collections::BTreeMap;
10
11use fj_math::Vector;
12
13use crate::{
14 objects::{GlobalEdge, Vertex},
15 services::Services,
16 storage::{Handle, ObjectId},
17};
18
19pub trait Sweep: Sized {
21 type Swept;
23
24 fn sweep(
26 self,
27 path: impl Into<Vector<3>>,
28 services: &mut Services,
29 ) -> Self::Swept {
30 let mut cache = SweepCache::default();
31 self.sweep_with_cache(path, &mut cache, services)
32 }
33
34 fn sweep_with_cache(
36 self,
37 path: impl Into<Vector<3>>,
38 cache: &mut SweepCache,
39 services: &mut Services,
40 ) -> Self::Swept;
41}
42
43#[derive(Default)]
47pub struct SweepCache {
48 pub global_vertex: BTreeMap<ObjectId, Handle<Vertex>>,
50 pub global_edge: BTreeMap<ObjectId, Handle<GlobalEdge>>,
52}