osresearch/plotter-vision

duplicate removal leaves some dupes

osresearch opened this issue · 5 comments

Plotting with axidraw reveals that there are quite a few duplicate vectors left.

image

Three duplicates in this output, separated to show the overlap:

<svg xmlns='http://www.w3.org/2000/svg' version='1.2' baseProfile='tiny' width='1566px' height='1215px'>
<desc>plotter.vision</desc><path d='

M 403.9645,557.2681
L 192.7151,645.5610
L 346.5155,479.1583
L 156.8052,539.7043
L 324.2868,405.4131
L 160.9200,444.3291
L 332.1257,340.5518
L 195.9726,363.1320
L 160.8927,443.7731
L 196.1667,362.6238

M 346.5155,479.1583
L 403.9645,557.2681
L 275.4387,754.9597
L 404.7998,857.2168
L 274.5305,754.4333
L 192.1211,644.9800

M 275.4387,754.9597
L 405.9901,857.6252
L 497.9468,633.1514
L 403.9645,557.2681
' style='stroke:#ff0000;stroke-width:1;fill:none'/></svg>

image

zooming way in shows that they are almost dupes. the current precision is "within four decimal places", but these are within ~0.5. Perhaps the exactness should be relaxed.

Ideally the distances would be compared with some sort of metric; the problem is that a hash table is used to identify matches, so only "exact" is possible.

image

that fix didn't do it... need to do a full n^2 search when adding. it's not too bad since the paths have been reduced so much

looks better with the n^2 hacks