diff --git a/crates/fj-kernel/src/algorithms/sweep/vertex.rs b/crates/fj-kernel/src/algorithms/sweep/vertex.rs index 0176721df..72881a028 100644 --- a/crates/fj-kernel/src/algorithms/sweep/vertex.rs +++ b/crates/fj-kernel/src/algorithms/sweep/vertex.rs @@ -137,7 +137,7 @@ impl Sweep for GlobalVertex { let a = self; let b = GlobalVertex::from_position(self.position() + path.into()); - let curve = GlobalCurve::build(stores) + let curve = GlobalCurve::builder(stores) .line_from_points([a.position(), b.position()]); GlobalEdge::new(curve, [a, b]) @@ -178,7 +178,7 @@ mod tests { .sweep([0., 0., 1.], &stores); let expected_edge = GlobalEdge::new( - GlobalCurve::build(&stores).z_axis(), + GlobalCurve::builder(&stores).z_axis(), [[0., 0., 0.], [0., 0., 1.]].map(GlobalVertex::from_position), ); assert_eq!(edge, expected_edge); diff --git a/crates/fj-kernel/src/builder/curve.rs b/crates/fj-kernel/src/builder/curve.rs index e47aed87e..3997380d0 100644 --- a/crates/fj-kernel/src/builder/curve.rs +++ b/crates/fj-kernel/src/builder/curve.rs @@ -40,7 +40,7 @@ impl<'a> CurveBuilder<'a> { let path = SurfacePath::circle_from_radius(radius); let global_form = - GlobalCurve::build(self.stores).circle_from_radius(radius); + GlobalCurve::builder(self.stores).circle_from_radius(radius); Curve::new(self.surface, path, global_form) } @@ -62,18 +62,14 @@ impl<'a> CurveBuilder<'a> { } /// API for building a [`GlobalCurve`] +/// +/// Also see [`GlobalCurve::builder`]. pub struct GlobalCurveBuilder<'a> { - stores: &'a Stores, + /// The stores that the created objects are put in + pub stores: &'a Stores, } impl<'a> GlobalCurveBuilder<'a> { - /// Construct a new instance of [`GlobalCurveBuilder`] - /// - /// Also see [`GlobalCurve::build`]. - pub fn new(stores: &'a Stores) -> Self { - Self { stores } - } - /// Build a line that represents the x-axis pub fn x_axis(&self) -> Handle { self.stores diff --git a/crates/fj-kernel/src/builder/edge.rs b/crates/fj-kernel/src/builder/edge.rs index 104ce63ce..f0b1e11cd 100644 --- a/crates/fj-kernel/src/builder/edge.rs +++ b/crates/fj-kernel/src/builder/edge.rs @@ -30,8 +30,8 @@ impl<'a> HalfEdgeBuilder<'a> { let [a_curve, b_curve] = [Scalar::ZERO, Scalar::TAU].map(|coord| Point::from([coord])); - let global_vertex = - GlobalVertex::build().from_curve_and_position(&curve, a_curve); + let global_vertex = GlobalVertex::builder() + .from_curve_and_position(&curve, a_curve); let surface_vertices = [a_curve, b_curve].map(|point_curve| { let point_surface = @@ -65,7 +65,7 @@ impl<'a> HalfEdgeBuilder<'a> { let points = points.map(Into::into); let global_vertices = points.map(|position| { - GlobalVertex::build() + GlobalVertex::builder() .from_surface_and_position(&self.surface, position) }); diff --git a/crates/fj-kernel/src/builder/vertex.rs b/crates/fj-kernel/src/builder/vertex.rs index 35c0ff37a..c6ec8c9f4 100644 --- a/crates/fj-kernel/src/builder/vertex.rs +++ b/crates/fj-kernel/src/builder/vertex.rs @@ -17,7 +17,7 @@ impl VertexBuilder { let &surface = self.curve.surface(); let global_form = - GlobalVertex::build().from_curve_and_position(&self.curve, point); + GlobalVertex::builder().from_curve_and_position(&self.curve, point); let surface_form = SurfaceVertex::new( self.curve.path().point_from_path_coords(point), @@ -30,6 +30,8 @@ impl VertexBuilder { } /// API for building a [`GlobalVertex`] +/// +/// Also see [`GlobalVertex::builder`]. pub struct GlobalVertexBuilder; impl GlobalVertexBuilder { diff --git a/crates/fj-kernel/src/iter.rs b/crates/fj-kernel/src/iter.rs index d3ec7919b..d5853e2a1 100644 --- a/crates/fj-kernel/src/iter.rs +++ b/crates/fj-kernel/src/iter.rs @@ -423,7 +423,7 @@ mod tests { fn global_curve() { let stores = Stores::new(); - let object = GlobalCurve::build(&stores).x_axis(); + let object = GlobalCurve::builder(&stores).x_axis(); assert_eq!(0, object.curve_iter().count()); assert_eq!(0, object.cycle_iter().count()); diff --git a/crates/fj-kernel/src/objects/curve.rs b/crates/fj-kernel/src/objects/curve.rs index be66f52e7..934a2fa3b 100644 --- a/crates/fj-kernel/src/objects/curve.rs +++ b/crates/fj-kernel/src/objects/curve.rs @@ -56,9 +56,9 @@ pub struct GlobalCurve { } impl GlobalCurve { - /// Build a curve using [`GlobalCurveBuilder`] - pub fn build(stores: &Stores) -> GlobalCurveBuilder { - GlobalCurveBuilder::new(stores) + /// Build a `Curve` using [`GlobalCurveBuilder`] + pub fn builder(stores: &Stores) -> GlobalCurveBuilder { + GlobalCurveBuilder { stores } } /// Construct a `GlobalCurve` from the path that defines it diff --git a/crates/fj-kernel/src/objects/vertex.rs b/crates/fj-kernel/src/objects/vertex.rs index f8ad9b340..f7439c265 100644 --- a/crates/fj-kernel/src/objects/vertex.rs +++ b/crates/fj-kernel/src/objects/vertex.rs @@ -135,7 +135,7 @@ pub struct GlobalVertex { impl GlobalVertex { /// Build a `GlobalVertex` using [`GlobalVertexBuilder`] - pub fn build() -> GlobalVertexBuilder { + pub fn builder() -> GlobalVertexBuilder { GlobalVertexBuilder }