Skip to content

Commit

Permalink
Fix face equality
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Jun 30, 2022
1 parent 77f360b commit 6ddc78e
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions crates/fj-kernel/src/objects/face.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::hash::{Hash, Hasher};

use fj_interop::mesh::Color;
use fj_math::Triangle;

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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<H: Hasher>(&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<LocalForm<Cycle<2>, Cycle<3>>>);
Expand Down

0 comments on commit 6ddc78e

Please sign in to comment.