Move CurveBuilder::update_as_v_axis

This commit is contained in:
Hanno Braun 2023-02-24 14:20:14 +01:00
parent 9f6658ba78
commit 2559043862
2 changed files with 11 additions and 11 deletions

View File

@ -4,11 +4,6 @@ use crate::{geometry::path::SurfacePath, partial::PartialCurve};
/// Builder API for [`PartialCurve`]
pub trait CurveBuilder {
/// Update partial curve to represent the v-axis of the surface it is on
///
/// Returns the updated path.
fn update_as_v_axis(&mut self) -> SurfacePath;
/// Update partial curve to be a circle, from the provided radius
///
/// Returns the updated path.
@ -44,12 +39,6 @@ pub trait CurveBuilder {
}
impl CurveBuilder for PartialCurve {
fn update_as_v_axis(&mut self) -> SurfacePath {
let path = SurfacePath::v_axis();
self.path = Some(path.into());
path
}
fn update_as_circle_from_radius(
&mut self,
radius: impl Into<Scalar>,

View File

@ -19,6 +19,11 @@ pub trait HalfEdgeBuilder {
/// Returns the updated path.
fn update_as_u_axis(&mut self) -> SurfacePath;
/// Update partial curve to represent the v-axis of the surface it is on
///
/// Returns the updated path.
fn update_as_v_axis(&mut self) -> SurfacePath;
/// Update partial half-edge to be a circle, from the given radius
fn update_as_circle_from_radius(&mut self, radius: impl Into<Scalar>);
@ -74,6 +79,12 @@ impl HalfEdgeBuilder for PartialHalfEdge {
path
}
fn update_as_v_axis(&mut self) -> SurfacePath {
let path = SurfacePath::v_axis();
self.curve.write().path = Some(path.into());
path
}
fn update_as_circle_from_radius(&mut self, radius: impl Into<Scalar>) {
let path = self.curve.write().update_as_circle_from_radius(radius);