mirror of
https://github.com/hannobraun/Fornjot
synced 2025-02-14 11:15: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`]
|
/// Builder API for [`PartialCurve`]
|
||||||
pub trait CurveBuilder {
|
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
|
/// Update partial curve to be a circle, from the provided radius
|
||||||
///
|
///
|
||||||
/// Returns the updated path.
|
/// Returns the updated path.
|
||||||
@ -44,12 +39,6 @@ pub trait CurveBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl CurveBuilder for PartialCurve {
|
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(
|
fn update_as_circle_from_radius(
|
||||||
&mut self,
|
&mut self,
|
||||||
radius: impl Into<Scalar>,
|
radius: impl Into<Scalar>,
|
||||||
|
@ -19,6 +19,11 @@ pub trait HalfEdgeBuilder {
|
|||||||
/// Returns the updated path.
|
/// Returns the updated path.
|
||||||
fn update_as_u_axis(&mut self) -> SurfacePath;
|
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
|
/// Update partial half-edge to be a circle, from the given radius
|
||||||
fn update_as_circle_from_radius(&mut self, radius: impl Into<Scalar>);
|
fn update_as_circle_from_radius(&mut self, radius: impl Into<Scalar>);
|
||||||
|
|
||||||
@ -74,6 +79,12 @@ impl HalfEdgeBuilder for PartialHalfEdge {
|
|||||||
path
|
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>) {
|
fn update_as_circle_from_radius(&mut self, radius: impl Into<Scalar>) {
|
||||||
let path = self.curve.write().update_as_circle_from_radius(radius);
|
let path = self.curve.write().update_as_circle_from_radius(radius);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user