fj_kernel/operations/build/surface.rs
1use fj_math::Point;
2
3use crate::{
4 geometry::{curve::GlobalPath, surface::SurfaceGeometry},
5 objects::Surface,
6};
7
8/// Build a [`Surface`]
9pub trait BuildSurface {
10 /// Build a plane from the provided points
11 fn plane_from_points(points: [impl Into<Point<3>>; 3]) -> Surface {
12 let [a, b, c] = points.map(Into::into);
13
14 let geometry = SurfaceGeometry {
15 u: GlobalPath::line_from_points([a, b]).0,
16 v: c - a,
17 };
18
19 Surface::new(geometry)
20 }
21}
22
23impl BuildSurface for Surface {}