mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-03 17:38:27 +00:00
Add points_line
field to LineSegment
This commit is contained in:
parent
b2c73bde94
commit
78c1b5fd43
@ -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(
|
||||
|
@ -19,6 +19,7 @@ impl<const D: usize> GenPolyline<D> for Line<D> {
|
||||
|
||||
LineSegment {
|
||||
points: [point, point],
|
||||
points_line: [point_curve; 2],
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user