mirror of
https://github.com/hannobraun/Fornjot
synced 2025-01-28 19:09:25 +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`]
|
/// Builder API for [`PartialCurve`]
|
||||||
pub trait CurveBuilder {
|
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
|
/// Update partial curve to be a line, from provided points and line coords
|
||||||
///
|
///
|
||||||
/// Returns the updated path.
|
/// Returns the updated path.
|
||||||
@ -22,15 +14,6 @@ pub trait CurveBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl CurveBuilder for PartialCurve {
|
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(
|
fn update_as_line_from_points_with_line_coords(
|
||||||
&mut self,
|
&mut self,
|
||||||
points: [(impl Into<Point<1>>, impl Into<Point<2>>); 2],
|
points: [(impl Into<Point<1>>, impl Into<Point<2>>); 2],
|
||||||
|
@ -181,10 +181,8 @@ impl HalfEdgeBuilder for PartialHalfEdge {
|
|||||||
boundary.zip_ext(points_surface),
|
boundary.zip_ext(points_surface),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
let path = self
|
let (path, _) = SurfacePath::line_from_points(points_surface);
|
||||||
.curve
|
self.curve.write().path = Some(path.into());
|
||||||
.write()
|
|
||||||
.update_as_line_from_points(points_surface);
|
|
||||||
|
|
||||||
for (vertex, position) in
|
for (vertex, position) in
|
||||||
self.vertices.each_mut_ext().zip_ext([0., 1.])
|
self.vertices.each_mut_ext().zip_ext([0., 1.])
|
||||||
|
Loading…
Reference in New Issue
Block a user