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
use fj_math::Point;
use crate::{
objects::{Face, Sketch, Surface},
stores::Stores,
};
pub struct SketchBuilder<'a> {
pub stores: &'a Stores,
pub surface: Surface,
}
impl<'a> SketchBuilder<'a> {
pub fn build_polygon_from_points(
self,
points: impl IntoIterator<Item = impl Into<Point<2>>>,
) -> Sketch {
let face = Face::builder(self.stores, self.surface)
.with_exterior_polygon_from_points(points)
.build();
Sketch::new().with_faces([face])
}
}