Implement Operation for Connect

This commit is contained in:
Hanno Braun 2025-02-06 21:00:53 +01:00
parent 1c7a6e1c16
commit 9510d0f72e

View File

@ -1,4 +1,9 @@
use crate::{geometry::Handle, math::Plane};
use std::fmt;
use crate::{
geometry::{AnyOp, Handle, Operation, TriMesh},
math::Plane,
};
use super::{face::Face, solid::Solid};
@ -53,3 +58,23 @@ impl ConnectExt for Handle<Face> {
pub struct Connect {
pub output: Solid,
}
impl Operation for Connect {
type Output = Solid;
fn output(&self) -> &Self::Output {
&self.output
}
fn display(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Connect")
}
fn tri_mesh(&self) -> TriMesh {
self.output.tri_mesh()
}
fn children(&self) -> Vec<AnyOp> {
self.output.children()
}
}