From 2141ef4c2dc7b351ff6fc462db0f15b286ff59e6 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 1 Aug 2023 11:53:56 +0200 Subject: [PATCH] Add `SurfacePath::reverse` --- crates/fj-core/src/geometry/path.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/fj-core/src/geometry/path.rs b/crates/fj-core/src/geometry/path.rs index 92d0d3d94..1801a2a4d 100644 --- a/crates/fj-core/src/geometry/path.rs +++ b/crates/fj-core/src/geometry/path.rs @@ -68,6 +68,15 @@ impl SurfacePath { Self::Line(line) => line.point_from_line_coords(point), } } + + /// Create a new path that is the reverse of this one + #[must_use] + pub fn reverse(self) -> Self { + match self { + Self::Circle(circle) => Self::Circle(circle.reverse()), + Self::Line(line) => Self::Line(line.reverse()), + } + } } /// A path through global (3D) space