mirror of https://github.com/hannobraun/Fornjot
Simplify `PartialHalfEdge::with_global_form`
This commit is contained in:
parent
5ccea9e80e
commit
18e1fb6eb3
|
@ -32,8 +32,7 @@ impl TransformObject for PartialHalfEdge {
|
|||
.global_form()
|
||||
.into_partial()
|
||||
.transform(transform, objects)?
|
||||
.with_curve(curve.global_form())
|
||||
.into();
|
||||
.with_curve(curve.global_form());
|
||||
|
||||
Ok(Self::default()
|
||||
.with_curve(curve)
|
||||
|
|
|
@ -89,7 +89,7 @@ impl<'a> ShellBuilder<'a> {
|
|||
.zip(&surfaces)
|
||||
.map(|(half_edge, surface)| {
|
||||
HalfEdge::partial()
|
||||
.with_global_form(Some(half_edge.global_form().clone()))
|
||||
.with_global_form(half_edge.global_form().clone())
|
||||
.update_as_line_segment_from_points(
|
||||
surface.clone(),
|
||||
[[Z, Z], [edge_length, Z]],
|
||||
|
@ -252,7 +252,7 @@ impl<'a> ShellBuilder<'a> {
|
|||
edges.push(
|
||||
HalfEdge::partial()
|
||||
.with_vertices(vertices)
|
||||
.with_global_form(Some(edge.global_form().clone()))
|
||||
.with_global_form(edge.global_form().clone())
|
||||
.update_as_line_segment()
|
||||
.build(self.objects)
|
||||
.unwrap(),
|
||||
|
|
|
@ -107,11 +107,10 @@ impl PartialHalfEdge {
|
|||
/// Update the partial half-edge with the given global form
|
||||
pub fn with_global_form(
|
||||
mut self,
|
||||
global_form: Option<impl Into<MaybePartial<GlobalEdge>>>,
|
||||
global_form: impl Into<MaybePartial<GlobalEdge>>,
|
||||
) -> Self {
|
||||
if let Some(global_form) = global_form {
|
||||
self.global_form = global_form.into();
|
||||
}
|
||||
self.global_form = global_form.into();
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue