osresearch / plotter-vision

Hidden Wireframe removal demo in p5.js
GNU General Public License v2.0
83 stars 17 forks source link

duplicate removal leaves some dupes #27

Closed osresearch closed 1 year ago

osresearch commented 1 year ago

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

osresearch commented 1 year ago

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>
osresearch commented 1 year ago

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.

osresearch commented 1 year ago

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.

osresearch commented 1 year ago

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

osresearch commented 1 year ago

looks better with the n^2 hacks