Add points_line field to LineSegment

This commit is contained in:
Hanno Braun 2024-09-26 19:38:22 +02:00
parent b2c73bde94
commit 78c1b5fd43
3 changed files with 9 additions and 1 deletions

View File

@ -43,7 +43,10 @@ impl<const D: usize> GenPolyline<D> for Circle<D> {
let points = points_curve
.map(|point_curve| self.point_from_circle_coords(point_curve));
LineSegment { points }
LineSegment {
points,
points_line: points_curve,
}
}
fn generate_polyline(

View File

@ -19,6 +19,7 @@ impl<const D: usize> GenPolyline<D> for Line<D> {
LineSegment {
points: [point, point],
points_line: [point_curve; 2],
}
}

View File

@ -13,6 +13,9 @@ use super::Point;
pub struct LineSegment<const D: usize> {
/// # The end points of the line segment
pub points: [Point<D>; 2],
/// # The end points of the line segment, in line coordinates
pub points_line: [Point<1>; 2],
}
impl<const D: usize> LineSegment<D> {
@ -50,6 +53,7 @@ where
fn from(points: [P; 2]) -> Self {
Self {
points: points.map(Into::into),
points_line: [[0.], [1.]].map(Into::into),
}
}
}