Skip to content

Commit

Permalink
Merge pull request #129 from hannobraun/workaround
Browse files Browse the repository at this point in the history
Remove workaround
  • Loading branch information
hannobraun authored Feb 4, 2022
2 parents 9d1d735 + 02130b7 commit 034da34
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions src/kernel/topology/edges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,25 +133,7 @@ impl Cycle {

// As this is a cycle, the last vertex of an edge could be identical to
// the first vertex of the next. Let's remove those duplicates.
out.dedup_by(|a, b| {
// We can't just compare those vertices directly, because vertices
// that are supposed to be the same could be slightly different due
// to floating point accuracy.
//
// So what we're doing here is to choose a somewhat arbitrary
// epsilon value that is some orders of magnitude larger than the
// inaccuracies I've been seeing, while still being smaller than
// any value we might reasonably see in a CAD model.
//
// This is hack-ish and might come back to bite us at some point.
// I'm fine with it for now, as I'm planning major changes to the
// architecture of the whole CAD kernel that will prevent these
// kinds of problems outright.
//
// - @hannobraun
let epsilon = 1e-12;
(*a - *b).magnitude() < epsilon
});
out.dedup();
}

/// Compute segments to approximate the edges of this cycle
Expand Down

0 comments on commit 034da34

Please sign in to comment.