mirror of
https://github.com/hannobraun/Fornjot
synced 2025-02-06 07:15:55 +00:00
Inline CurveBuilder
method
This commit is contained in:
parent
ea5704cebe
commit
b3cc84608a
@ -4,14 +4,6 @@ use crate::{geometry::path::SurfacePath, partial::PartialCurve};
|
||||
|
||||
/// Builder API for [`PartialCurve`]
|
||||
pub trait CurveBuilder {
|
||||
/// Update partial curve to be a circle, from the provided radius
|
||||
///
|
||||
/// Returns the updated path.
|
||||
fn update_as_circle_from_radius(
|
||||
&mut self,
|
||||
radius: impl Into<Scalar>,
|
||||
) -> SurfacePath;
|
||||
|
||||
/// Update partial curve to be a circle, from the provided radius
|
||||
///
|
||||
/// Returns the updated path.
|
||||
@ -39,15 +31,6 @@ pub trait CurveBuilder {
|
||||
}
|
||||
|
||||
impl CurveBuilder for PartialCurve {
|
||||
fn update_as_circle_from_radius(
|
||||
&mut self,
|
||||
radius: impl Into<Scalar>,
|
||||
) -> SurfacePath {
|
||||
let path = SurfacePath::circle_from_radius(radius);
|
||||
self.path = Some(path.into());
|
||||
path
|
||||
}
|
||||
|
||||
fn update_as_circle_from_center_and_radius(
|
||||
&mut self,
|
||||
center: impl Into<Point<2>>,
|
||||
|
@ -92,7 +92,8 @@ impl HalfEdgeBuilder for PartialHalfEdge {
|
||||
&mut self,
|
||||
radius: impl Into<Scalar>,
|
||||
) -> SurfacePath {
|
||||
let path = self.curve.write().update_as_circle_from_radius(radius);
|
||||
let path = SurfacePath::circle_from_radius(radius);
|
||||
self.curve.write().path = Some(path.into());
|
||||
|
||||
let [a_curve, b_curve] =
|
||||
[Scalar::ZERO, Scalar::TAU].map(|coord| Point::from([coord]));
|
||||
|
Loading…
Reference in New Issue
Block a user