mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-06 10:58:28 +00:00
Add line_from_origin_and_direction
This commit is contained in:
parent
4f8047d92e
commit
7dfb01485a
@ -23,10 +23,10 @@ pub struct AnchoredCurve {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl AnchoredCurve {
|
impl AnchoredCurve {
|
||||||
pub fn line_from_points([a, b]: [Point<3>; 2]) -> Self {
|
pub fn line_from_origin_and_direction(
|
||||||
let origin = a;
|
origin: Point<3>,
|
||||||
let direction = b - a;
|
direction: Vector<3>,
|
||||||
|
) -> Self {
|
||||||
let line = Line { direction };
|
let line = Line { direction };
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
@ -35,6 +35,13 @@ impl AnchoredCurve {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn line_from_points([a, b]: [Point<3>; 2]) -> Self {
|
||||||
|
let origin = a;
|
||||||
|
let direction = b - a;
|
||||||
|
|
||||||
|
Self::line_from_origin_and_direction(origin, direction)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn point_from_local(&self, point: Point<1>) -> Point<3> {
|
pub fn point_from_local(&self, point: Point<1>) -> Point<3> {
|
||||||
self.floating.point_from_local(point)
|
self.floating.point_from_local(point)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user