From 98d1d96bd799cd7e21672201f2baa5c2ecf4aa8f Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 23 Jun 2022 12:43:32 +0200 Subject: [PATCH] Add `Curve::line_from_points` This is a useful constructor that has been missing so far. --- crates/fj-kernel/src/objects/curve.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/fj-kernel/src/objects/curve.rs b/crates/fj-kernel/src/objects/curve.rs index 87c9b5b77..96fd57349 100644 --- a/crates/fj-kernel/src/objects/curve.rs +++ b/crates/fj-kernel/src/objects/curve.rs @@ -27,6 +27,11 @@ pub enum Curve { } impl Curve { + /// Construct a line from two points + pub fn line_from_points(points: [impl Into>; 2]) -> Self { + Self::Line(Line::from_points(points)) + } + /// Access the origin of the curve's coordinate system pub fn origin(&self) -> Point { match self {