Add ConnectExt

This commit is contained in:
Hanno Braun 2025-02-06 20:52:15 +01:00
parent ef73336cd2
commit 9efd5211c7
3 changed files with 16 additions and 2 deletions

View File

@ -0,0 +1,13 @@
use crate::geometry::Handle;
use super::{face::Face, solid::Solid};
pub trait ConnectExt {
fn connect(self, other: Handle<Face>) -> Solid;
}
impl ConnectExt for Handle<Face> {
fn connect(self, other: Handle<Face>) -> Solid {
Solid::connect_faces([self, other])
}
}

View File

@ -1,3 +1,4 @@
pub mod connect;
pub mod face;
pub mod solid;
pub mod sweep;

View File

@ -5,7 +5,7 @@ use crate::{
math::Vector,
};
use super::{face::Face, solid::Solid};
use super::{connect::ConnectExt, face::Face, solid::Solid};
pub trait SweepExt {
/// Sweep a face along a path, creating a solid
@ -27,7 +27,7 @@ impl SweepExt for Handle<Face> {
let bottom = self;
let top = Handle::new(bottom.flip().translate(path));
let solid = Solid::connect_faces([top, bottom]);
let solid = top.connect(bottom);
Sweep { output: solid }
}