mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-05 02:18: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 {
|
||||
pub fn line_from_points([a, b]: [Point<3>; 2]) -> Self {
|
||||
let origin = a;
|
||||
let direction = b - a;
|
||||
|
||||
pub fn line_from_origin_and_direction(
|
||||
origin: Point<3>,
|
||||
direction: Vector<3>,
|
||||
) -> Self {
|
||||
let line = Line { direction };
|
||||
|
||||
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> {
|
||||
self.floating.point_from_local(point)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user