diff --git a/crates/fj-kernel/src/algorithms/transform/curve.rs b/crates/fj-kernel/src/algorithms/transform/curve.rs index 351f1e689..a89192b7f 100644 --- a/crates/fj-kernel/src/algorithms/transform/curve.rs +++ b/crates/fj-kernel/src/algorithms/transform/curve.rs @@ -42,8 +42,7 @@ impl TransformObject for PartialCurve { Ok(PartialCurve { path: self.path, surface, - ..Default::default() - } - .with_global_form(global_form)) + global_form, + }) } } diff --git a/crates/fj-kernel/src/builder/edge.rs b/crates/fj-kernel/src/builder/edge.rs index a1cf231f6..1c6abd920 100644 --- a/crates/fj-kernel/src/builder/edge.rs +++ b/crates/fj-kernel/src/builder/edge.rs @@ -68,11 +68,9 @@ impl HalfEdgeBuilder for PartialHalfEdge { radius: impl Into, objects: &Objects, ) -> Result { - let curve = self - .curve() - .into_partial() - .with_global_form(Some(self.extract_global_curve())) - .update_as_circle_from_radius(radius); + let mut curve = self.curve().into_partial(); + curve.global_form = Some(self.extract_global_curve()); + let curve = curve.update_as_circle_from_radius(radius); let path = curve.path.expect("Expected path that was just created"); @@ -143,9 +141,9 @@ impl HalfEdgeBuilder for PartialHalfEdge { let curve = PartialCurve { surface: Some(surface), + global_form: Some(self.extract_global_curve()), ..Default::default() } - .with_global_form(Some(self.extract_global_curve())) .update_as_line_from_points(points); let [back, front] = { diff --git a/crates/fj-kernel/src/builder/shell.rs b/crates/fj-kernel/src/builder/shell.rs index bee310e32..fcd8a61f3 100644 --- a/crates/fj-kernel/src/builder/shell.rs +++ b/crates/fj-kernel/src/builder/shell.rs @@ -9,10 +9,10 @@ use crate::{ builder::{FaceBuilder, HalfEdgeBuilder}, insert::Insert, objects::{ - Curve, Cycle, Face, FaceSet, HalfEdge, Objects, Shell, Surface, - SurfaceVertex, Vertex, + Cycle, Face, FaceSet, HalfEdge, Objects, Shell, Surface, SurfaceVertex, + Vertex, }, - partial::HasPartial, + partial::{HasPartial, PartialCurve}, storage::Handle, }; @@ -152,9 +152,16 @@ impl<'a> ShellBuilder<'a> { .with_surface(Some(surface.clone())) .with_global_form(Some(from.global_form().clone())); - let curve = Curve::partial().with_global_form(Some( - side_up_prev.curve().global_form().clone(), - )); + let curve = PartialCurve { + global_form: Some( + side_up_prev + .curve() + .global_form() + .clone() + .into(), + ), + ..Default::default() + }; HalfEdge::partial() .with_curve(curve) diff --git a/crates/fj-kernel/src/partial/objects/curve.rs b/crates/fj-kernel/src/partial/objects/curve.rs index 846438a8a..10ba14dee 100644 --- a/crates/fj-kernel/src/partial/objects/curve.rs +++ b/crates/fj-kernel/src/partial/objects/curve.rs @@ -22,17 +22,6 @@ pub struct PartialCurve { } impl PartialCurve { - /// Provide a global form for the partial curve - pub fn with_global_form( - mut self, - global_form: Option>>, - ) -> Self { - if let Some(global_form) = global_form { - self.global_form = Some(global_form.into()); - } - self - } - /// Build a full [`Curve`] from the partial curve pub fn build(self, objects: &Objects) -> Result { let path = self.path.expect("Can't build `Curve` without path");