From 6ddc78e06358a1ea9496f3648a6e65699c382071 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 30 Jun 2022 15:49:23 +0200 Subject: [PATCH] Fix face equality --- crates/fj-kernel/src/objects/face.rs | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/crates/fj-kernel/src/objects/face.rs b/crates/fj-kernel/src/objects/face.rs index ca8899f45..ddb5aff8e 100644 --- a/crates/fj-kernel/src/objects/face.rs +++ b/crates/fj-kernel/src/objects/face.rs @@ -1,5 +1,3 @@ -use std::hash::{Hash, Hasher}; - use fj_interop::mesh::Color; use fj_math::Triangle; @@ -103,7 +101,7 @@ impl Face { /// This type exists to ease the handling of faces that use boundary /// representation. It will eventually be merged into `Face`, once /// `Face::Triangles` can finally be removed. -#[derive(Clone, Debug, Eq, Ord, PartialOrd)] +#[derive(Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)] pub struct FaceBRep { /// The surface that defines this face pub surface: Surface, @@ -167,23 +165,6 @@ impl FaceBRep { } } -impl PartialEq for FaceBRep { - fn eq(&self, other: &Self) -> bool { - self.surface() == other.surface() - && self.exteriors().eq(other.exteriors()) - && self.interiors().eq(other.interiors()) - } -} - -impl Hash for FaceBRep { - fn hash(&self, state: &mut H) { - self.surface().hash(state); - for cycle in self.all_cycles() { - cycle.hash(state); - } - } -} - /// A list of cycles, as they are stored in `Face` #[derive(Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)] pub struct CyclesInFace(Vec, Cycle<3>>>);