From a4a9c234be1186f5a547e2d67fdf1156d1e30b46 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 18 Aug 2023 11:17:33 +0200 Subject: [PATCH 1/2] Implement `InsertIntoSet` for `Curve` --- crates/fj-core/src/objects/set.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/fj-core/src/objects/set.rs b/crates/fj-core/src/objects/set.rs index 791ff1d0b..39b45c6e9 100644 --- a/crates/fj-core/src/objects/set.rs +++ b/crates/fj-core/src/objects/set.rs @@ -1,7 +1,8 @@ use std::collections::{btree_set, BTreeSet}; use super::{ - BehindHandle, Cycle, Face, GlobalEdge, HalfEdge, Object, Surface, Vertex, + BehindHandle, Curve, Cycle, Face, GlobalEdge, HalfEdge, Object, Surface, + Vertex, }; /// A graph of objects and their relationships @@ -57,6 +58,10 @@ trait InsertIntoSet { fn insert_into_set(&self, objects: &mut ObjectSet); } +impl InsertIntoSet for Curve { + fn insert_into_set(&self, _: &mut ObjectSet) {} +} + impl InsertIntoSet for Cycle { fn insert_into_set(&self, objects: &mut ObjectSet) { for half_edge in self.half_edges() { From 5bb29cedb7bac1af06fb1a89d6720e80c8599bc2 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 18 Aug 2023 11:17:49 +0200 Subject: [PATCH 2/2] Fix `InsertIntoSet` implementation of `HalfEdge` --- crates/fj-core/src/objects/set.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/fj-core/src/objects/set.rs b/crates/fj-core/src/objects/set.rs index 39b45c6e9..54957b3d9 100644 --- a/crates/fj-core/src/objects/set.rs +++ b/crates/fj-core/src/objects/set.rs @@ -96,6 +96,9 @@ impl InsertIntoSet for GlobalEdge { impl InsertIntoSet for HalfEdge { fn insert_into_set(&self, objects: &mut ObjectSet) { + objects.inner.insert(self.curve().clone().into()); + self.curve().insert_into_set(objects); + objects.inner.insert(self.start_vertex().clone().into()); self.start_vertex().insert_into_set(objects);