mirror of
https://github.com/hannobraun/Fornjot
synced 2025-02-11 09:45:53 +00:00
Move CurveBuilder::update_as_v_axis
This commit is contained in:
parent
9f6658ba78
commit
2559043862
@ -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>,
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user