From 6c3abd8e83c5aa634c36626e7e2987254f16d76c Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 13 Oct 2022 16:57:17 +0200 Subject: [PATCH 1/3] 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 From b622282bd6c1ddadba8761015ccbfc9d4f4c561b Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 13 Oct 2022 16:58:33 +0200 Subject: [PATCH 2/3] Update function name to latest nomenclature --- crates/fj-kernel/src/partial/objects/cycle.rs | 2 +- crates/fj-kernel/src/partial/objects/edge.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/fj-kernel/src/partial/objects/cycle.rs b/crates/fj-kernel/src/partial/objects/cycle.rs index 9b35789dd..3b3167b70 100644 --- a/crates/fj-kernel/src/partial/objects/cycle.rs +++ b/crates/fj-kernel/src/partial/objects/cycle.rs @@ -185,7 +185,7 @@ impl PartialCycle { half_edge .with_surface(Some(surface_for_edges.clone())) - .with_from_vertex(from) + .with_back_vertex(from) }) .into_full(objects); diff --git a/crates/fj-kernel/src/partial/objects/edge.rs b/crates/fj-kernel/src/partial/objects/edge.rs index ab8a77be2..d9a2f6707 100644 --- a/crates/fj-kernel/src/partial/objects/edge.rs +++ b/crates/fj-kernel/src/partial/objects/edge.rs @@ -61,7 +61,7 @@ impl PartialHalfEdge { } /// Update the partial half-edge with the given from vertex - pub fn with_from_vertex( + pub fn with_back_vertex( mut self, vertex: Option>>, ) -> Self { From be9a2f980955d7f1dc728b1e20830f651359eb3c Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 13 Oct 2022 16:58:56 +0200 Subject: [PATCH 3/3] Update function name to latest nomenclature --- crates/fj-kernel/src/partial/objects/edge.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/fj-kernel/src/partial/objects/edge.rs b/crates/fj-kernel/src/partial/objects/edge.rs index d9a2f6707..18f8416cd 100644 --- a/crates/fj-kernel/src/partial/objects/edge.rs +++ b/crates/fj-kernel/src/partial/objects/edge.rs @@ -73,7 +73,7 @@ impl PartialHalfEdge { } /// Update the partial half-edge with the given from vertex - pub fn with_to_vertex( + pub fn with_front_vertex( mut self, vertex: Option>>, ) -> Self {