mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-04 01:48:28 +00:00
Simplify return value of ConnectExt::connect
This commit is contained in:
parent
e9fde5da24
commit
85c7253bcf
@ -25,11 +25,11 @@ pub trait ConnectExt {
|
||||
///
|
||||
/// It should be seen as more of a placeholder for a real implementation of
|
||||
/// this operation.
|
||||
fn connect(self, other: Self) -> Connect;
|
||||
fn connect(self, other: Self) -> Handle<Solid>;
|
||||
}
|
||||
|
||||
impl ConnectExt for Handle<Face> {
|
||||
fn connect(self, other: Self) -> Connect {
|
||||
fn connect(self, other: Self) -> Handle<Solid> {
|
||||
assert_eq!(
|
||||
self.output().vertices().count(),
|
||||
other.output().vertices().count(),
|
||||
@ -53,9 +53,7 @@ impl ConnectExt for Handle<Face> {
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let output = Solid::new([self, other].into_iter().chain(side_faces));
|
||||
Connect {
|
||||
output: Handle::new(output),
|
||||
}
|
||||
Handle::new(output)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,10 +7,7 @@ use crate::{
|
||||
};
|
||||
|
||||
use super::{
|
||||
connect::{Connect, ConnectExt},
|
||||
face::Face,
|
||||
flip::FlipExt,
|
||||
solid::Solid,
|
||||
connect::ConnectExt, face::Face, flip::FlipExt, solid::Solid,
|
||||
translate::TranslateExt,
|
||||
};
|
||||
|
||||
@ -40,7 +37,7 @@ impl SweepExt for Handle<Face> {
|
||||
}
|
||||
|
||||
pub struct Sweep {
|
||||
pub output: Connect,
|
||||
pub output: Handle<Solid>,
|
||||
}
|
||||
|
||||
impl Operation for Sweep {
|
||||
@ -59,6 +56,6 @@ impl Operation for Sweep {
|
||||
|
||||
impl OperationOutput<Solid> for Sweep {
|
||||
fn output(&self) -> &Solid {
|
||||
self.output.output.output()
|
||||
self.output.output()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user