Gimly / DoublyConnectedEdgeList

Implements a doubly connected edge list (DCEL) in C#
MIT License
6 stars 3 forks source link

Fix distinct issue #3

Closed Gimly closed 3 years ago

Gimly commented 3 years ago

We have an issue if two points are considered equal by the equality comparer but don't have the same hashcode, the Distinct fails and doesn't correctly consider the points equal, which result in the two close points being regrouped. This is especially important when the user wants to consider points that are "close" within a certain tolerance.

To fix the issue, we have changed the algorithm to create the same vertex for points that the user would consider equal (using the Equals method.