Add test suite for approximation code, fix edge cases #138
Labels
topic: core
Issues relating to core geometry, operations, algorithms
type: bug
Something isn't working
type: development
Work to ease development or maintenance, without direct effect on features or bugs
Milestone
The approximation code queries the geometry for approximate points, then processes and aggregates these points, depending on the type of edges.
I've cleaned this up recently, but I suspect there's at least one unaddressed edge case in there. We should have a comprehensive test suite for this code, possibly move it to a dedicated module, and make sure we cover edge cases as best as possible.
Here's the unaddressed edge case that I suspect needs addressing.
Point de-duplication depends on consistent edge direction
When approximating an edge, the approximation will include the two points that bound the edge. When approximating a whole cycle of connected edges, this will lead to duplicated points that need to be filtered out.
Currently, the points are in a
Vec
andVec::dedup
is called to filter out duplicates. However, this won't work if the direction of edges is inconsistent. For example, if you have the straight edgesa
->b
,b
->c
, then the duplicateb
will be correctly filtered. If the edges area
->b
,c
->b
, on the other hand, then one of theb
s must still be filtered, but that won't happen.The text was updated successfully, but these errors were encountered: