mirror of
https://github.com/hannobraun/Fornjot
synced 2025-01-27 10:29:28 +00:00
Inline CurveBuilder::update_as_line_from_points
This commit is contained in:
parent
b94f9a7ab0
commit
0df6ef2e3f
@ -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],
|
||||
|
@ -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.])
|
||||
|
Loading…
Reference in New Issue
Block a user