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