Inline CurveBuilder::update_as_line_from_points

This commit is contained in:
Hanno Braun 2023-02-24 14:28:43 +01:00
parent b94f9a7ab0
commit 0df6ef2e3f
2 changed files with 2 additions and 21 deletions

View File

@ -4,14 +4,6 @@ use crate::{geometry::path::SurfacePath, partial::PartialCurve};
/// Builder API for [`PartialCurve`]
pub trait CurveBuilder {
/// Update partial curve to be a line, from the provided points
///
/// Returns the updated path.
fn update_as_line_from_points(
&mut self,
points: [impl Into<Point<2>>; 2],
) -> SurfacePath;
/// Update partial curve to be a line, from provided points and line coords
///
/// Returns the updated path.
@ -22,15 +14,6 @@ pub trait CurveBuilder {
}
impl CurveBuilder for PartialCurve {
fn update_as_line_from_points(
&mut self,
points: [impl Into<Point<2>>; 2],
) -> SurfacePath {
let (path, _) = SurfacePath::line_from_points(points);
self.path = Some(path.into());
path
}
fn update_as_line_from_points_with_line_coords(
&mut self,
points: [(impl Into<Point<1>>, impl Into<Point<2>>); 2],

View File

@ -181,10 +181,8 @@ impl HalfEdgeBuilder for PartialHalfEdge {
boundary.zip_ext(points_surface),
)
} else {
let path = self
.curve
.write()
.update_as_line_from_points(points_surface);
let (path, _) = SurfacePath::line_from_points(points_surface);
self.curve.write().path = Some(path.into());
for (vertex, position) in
self.vertices.each_mut_ext().zip_ext([0., 1.])