fj_core/operations/build/
solid.rs1use fj_math::Point;
2
3use crate::{
4 objects::{Shell, Solid},
5 operations::{
6 build::{BuildShell, TetrahedronShell},
7 insert::{Insert, IsInsertedYes},
8 update::UpdateSolid,
9 },
10 Core,
11};
12
13pub trait BuildSolid {
19 fn empty() -> Solid {
21 Solid::new([])
22 }
23
24 fn tetrahedron(
28 points: [impl Into<Point<3>>; 4],
29 core: &mut Core,
30 ) -> Tetrahedron {
31 let shell = Shell::tetrahedron(points, core).insert(core);
32 let solid = Solid::empty().add_shells([shell.shell.clone()], core);
33
34 Tetrahedron { solid, shell }
35 }
36}
37
38impl BuildSolid for Solid {}
39
40pub struct Tetrahedron {
44 pub solid: Solid,
46
47 pub shell: TetrahedronShell<IsInsertedYes>,
49}