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();
|
.into();
|
||||||
|
|
||||||
Ok(Self::default()
|
Ok(Self::default()
|
||||||
.with_curve(Some(curve))
|
.with_curve(curve)
|
||||||
.with_vertices(Some(vertices))
|
.with_vertices(Some(vertices))
|
||||||
.with_global_form(global_form))
|
.with_global_form(global_form))
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ impl CycleBuilder for PartialCycle {
|
||||||
|
|
||||||
half_edges.push(
|
half_edges.push(
|
||||||
HalfEdge::partial()
|
HalfEdge::partial()
|
||||||
.with_curve(Some(curve))
|
.with_curve(curve)
|
||||||
.with_vertices(Some([from, to])),
|
.with_vertices(Some([from, to])),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -79,9 +79,7 @@ impl HalfEdgeBuilder for PartialHalfEdge {
|
||||||
.with_surface_form(surface_vertex.clone())
|
.with_surface_form(surface_vertex.clone())
|
||||||
});
|
});
|
||||||
|
|
||||||
Ok(self
|
Ok(self.with_curve(curve).with_vertices(Some([back, front])))
|
||||||
.with_curve(Some(curve))
|
|
||||||
.with_vertices(Some([back, front])))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_as_line_segment_from_points(
|
fn update_as_line_segment_from_points(
|
||||||
|
@ -181,8 +179,7 @@ impl HalfEdgeBuilder for PartialHalfEdge {
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
self.with_curve(Some(curve))
|
self.with_curve(curve).with_vertices(Some([back, front]))
|
||||||
.with_vertices(Some([back, front]))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -148,7 +148,7 @@ impl<'a> ShellBuilder<'a> {
|
||||||
));
|
));
|
||||||
|
|
||||||
HalfEdge::partial()
|
HalfEdge::partial()
|
||||||
.with_curve(Some(curve))
|
.with_curve(curve)
|
||||||
.with_vertices(Some([
|
.with_vertices(Some([
|
||||||
Vertex::partial().with_surface_form(from),
|
Vertex::partial().with_surface_form(from),
|
||||||
Vertex::partial().with_surface_form(to),
|
Vertex::partial().with_surface_form(to),
|
||||||
|
|
|
@ -67,13 +67,9 @@ impl PartialHalfEdge {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Update the partial half-edge with the given curve
|
/// Update the partial half-edge with the given curve
|
||||||
pub fn with_curve(
|
pub fn with_curve(mut self, curve: impl Into<MaybePartial<Curve>>) -> Self {
|
||||||
mut self,
|
|
||||||
curve: Option<impl Into<MaybePartial<Curve>>>,
|
|
||||||
) -> Self {
|
|
||||||
if let Some(curve) = curve {
|
|
||||||
self.curve = curve.into();
|
self.curve = curve.into();
|
||||||
}
|
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue