mdally / Voronoi

C++ implementation of Fortune's Algorithm for computing bounded Voronoi diagrams
MIT License
25 stars 14 forks source link

Cell::getNeighbors() fuktion returns his own site #6

Closed KoraktorXV closed 6 years ago

KoraktorXV commented 6 years ago

hey there when i try to get the Neighbors of my Cell and my Vector only returns the cells.at(i), but the rigth amound of cells. like this:

std::vector<Cell*> cellptr_vec_neighbors = diagram->cells.at(i)->getNeighbors();

Cellptr_vec_neighbors { size=3 } std::vector<Cell ,std::allocator<Cell > > [0] 0x005a84e8
{site={p={x=148.00000000000000 y=4.0000000000000000 } cell=0x005a84e8
{site={p={x=148.00000000000000 ...} ...} ...} } ...} Cell [1] 0x005a84e8
{site={p={x=148.00000000000000 y=4.0000000000000000 } cell=0x005a84e8 {site={p={x=148.00000000000000 ...} ...} ...} } ...} Cell
[2] 0x005a84e8
{site={p={x=148.00000000000000 y=4.0000000000000000 } cell=0x005a84e8
{site={p={x=148.00000000000000 ...} ...} ...} } ...} Cell *

when i look at your code i don´t realy konw how to fix it... how ever, i like yur work and i hope you can improve this ^^ Thanks for your hard work - very much appreciated!

pkonecki commented 6 years ago

I just made a PR that fixes this https://github.com/mdally/Voronoi/pull/7

KoraktorXV commented 6 years ago

thanks for fixing it ^^

mdally commented 6 years ago

Merged pkonecki's fix