From 6c3abd8e83c5aa634c36626e7e2987254f16d76c Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 13 Oct 2022 16:57:17 +0200 Subject: [PATCH] Add methods to access single `HalfEdge` vertices --- crates/fj-kernel/src/objects/edge.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/fj-kernel/src/objects/edge.rs b/crates/fj-kernel/src/objects/edge.rs index dbdff6f48..8df8d823d 100644 --- a/crates/fj-kernel/src/objects/edge.rs +++ b/crates/fj-kernel/src/objects/edge.rs @@ -79,6 +79,18 @@ impl HalfEdge { &self.vertices } + /// Access the vertex at the back of the half-edge + pub fn back(&self) -> &Vertex { + let [back, _] = self.vertices(); + back + } + + /// Access the vertex at the front of the half-edge + pub fn front(&self) -> &Vertex { + let [_, front] = self.vertices(); + front + } + /// Access the global form of this half-edge pub fn global_form(&self) -> &GlobalEdge { &self.global_form