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