mirror of https://github.com/hannobraun/Fornjot
Simplify `PartialHalfEdge::with_curve`
This commit is contained in:
parent
076400632c
commit
421e03efda
|
@ -36,7 +36,7 @@ impl TransformObject for PartialHalfEdge {
|
|||
.into();
|
||||
|
||||
Ok(Self::default()
|
||||
.with_curve(Some(curve))
|
||||
.with_curve(curve)
|
||||
.with_vertices(Some(vertices))
|
||||
.with_global_form(global_form))
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ impl CycleBuilder for PartialCycle {
|
|||
|
||||
half_edges.push(
|
||||
HalfEdge::partial()
|
||||
.with_curve(Some(curve))
|
||||
.with_curve(curve)
|
||||
.with_vertices(Some([from, to])),
|
||||
);
|
||||
|
||||
|
|
|
@ -79,9 +79,7 @@ impl HalfEdgeBuilder for PartialHalfEdge {
|
|||
.with_surface_form(surface_vertex.clone())
|
||||
});
|
||||
|
||||
Ok(self
|
||||
.with_curve(Some(curve))
|
||||
.with_vertices(Some([back, front])))
|
||||
Ok(self.with_curve(curve).with_vertices(Some([back, front])))
|
||||
}
|
||||
|
||||
fn update_as_line_segment_from_points(
|
||||
|
@ -181,8 +179,7 @@ impl HalfEdgeBuilder for PartialHalfEdge {
|
|||
})
|
||||
};
|
||||
|
||||
self.with_curve(Some(curve))
|
||||
.with_vertices(Some([back, front]))
|
||||
self.with_curve(curve).with_vertices(Some([back, front]))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ impl<'a> ShellBuilder<'a> {
|
|||
));
|
||||
|
||||
HalfEdge::partial()
|
||||
.with_curve(Some(curve))
|
||||
.with_curve(curve)
|
||||
.with_vertices(Some([
|
||||
Vertex::partial().with_surface_form(from),
|
||||
Vertex::partial().with_surface_form(to),
|
||||
|
|
|
@ -67,13 +67,9 @@ impl PartialHalfEdge {
|
|||
}
|
||||
|
||||
/// Update the partial half-edge with the given curve
|
||||
pub fn with_curve(
|
||||
mut self,
|
||||
curve: Option<impl Into<MaybePartial<Curve>>>,
|
||||
) -> Self {
|
||||
if let Some(curve) = curve {
|
||||
pub fn with_curve(mut self, curve: impl Into<MaybePartial<Curve>>) -> Self {
|
||||
self.curve = curve.into();
|
||||
}
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue