Skip to content

Commit

Permalink
Merge pull request #721 from hannobraun/curve
Browse files Browse the repository at this point in the history
Add `Curve::line_from_points`
  • Loading branch information
hannobraun authored Jun 23, 2022
2 parents 8574252 + 98d1d96 commit 2b0db46
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/fj-kernel/src/objects/curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ pub enum Curve<const D: usize> {
}

impl<const D: usize> Curve<D> {
/// Construct a line from two points
pub fn line_from_points(points: [impl Into<Point<D>>; 2]) -> Self {
Self::Line(Line::from_points(points))
}

/// Access the origin of the curve's coordinate system
pub fn origin(&self) -> Point<D> {
match self {
Expand Down

0 comments on commit 2b0db46

Please sign in to comment.