Skip to content

Commit

Permalink
Merge pull request #1998 from hannobraun/set
Browse files Browse the repository at this point in the history
Fix `InsertIntoSet` implementation of `HalfEdge`
  • Loading branch information
hannobraun authored Aug 18, 2023
2 parents 868718b + 5bb29ce commit e5151b1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/fj-core/src/objects/set.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -91,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);

Expand Down

0 comments on commit e5151b1

Please sign in to comment.