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()
|
.global_form()
|
||||||
.into_partial()
|
.into_partial()
|
||||||
.transform(transform, objects)?
|
.transform(transform, objects)?
|
||||||
.with_curve(curve.global_form())
|
.with_curve(curve.global_form());
|
||||||
.into();
|
|
||||||
|
|
||||||
Ok(Self::default()
|
Ok(Self::default()
|
||||||
.with_curve(curve)
|
.with_curve(curve)
|
||||||
|
|
|
@ -89,7 +89,7 @@ impl<'a> ShellBuilder<'a> {
|
||||||
.zip(&surfaces)
|
.zip(&surfaces)
|
||||||
.map(|(half_edge, surface)| {
|
.map(|(half_edge, surface)| {
|
||||||
HalfEdge::partial()
|
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(
|
.update_as_line_segment_from_points(
|
||||||
surface.clone(),
|
surface.clone(),
|
||||||
[[Z, Z], [edge_length, Z]],
|
[[Z, Z], [edge_length, Z]],
|
||||||
|
@ -252,7 +252,7 @@ impl<'a> ShellBuilder<'a> {
|
||||||
edges.push(
|
edges.push(
|
||||||
HalfEdge::partial()
|
HalfEdge::partial()
|
||||||
.with_vertices(vertices)
|
.with_vertices(vertices)
|
||||||
.with_global_form(Some(edge.global_form().clone()))
|
.with_global_form(edge.global_form().clone())
|
||||||
.update_as_line_segment()
|
.update_as_line_segment()
|
||||||
.build(self.objects)
|
.build(self.objects)
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
|
|
|
@ -107,11 +107,10 @@ impl PartialHalfEdge {
|
||||||
/// Update the partial half-edge with the given global form
|
/// Update the partial half-edge with the given global form
|
||||||
pub fn with_global_form(
|
pub fn with_global_form(
|
||||||
mut self,
|
mut self,
|
||||||
global_form: Option<impl Into<MaybePartial<GlobalEdge>>>,
|
global_form: impl Into<MaybePartial<GlobalEdge>>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
if let Some(global_form) = global_form {
|
|
||||||
self.global_form = global_form.into();
|
self.global_form = global_form.into();
|
||||||
}
|
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue