Spoiler
Does anyone know what this diagram is called? It's a way of partitioning space in a way similar to a voronoi diagram except that it only uses rectangles. I want to do some research but I don't know what to search...
Also if anyone has tried implementing one it would be even more fantastic if you could give me some hints, but a name will suffice :D
Cheers in advance GMC
EDIT: MY tutor thought I was talking about quadtrees, similar but no.
EDIT2:
I've had an idea for the algorithm that I also want to run by people. This is what it consists of
with obj_particles // With all the dots
{
build_rectangle(x-d,y-d,x+d,y+d); // build a square around the particle
resolve_any_particles_close(d); // d defines 'close together'
}
with obj_corners // With all the corners of these squares
{
i = find_shortest_distance_to_intersection();
build_line(x,y, i.x,i.y);
}
I think that would solve it but I'm wondering how to make the find_shortest_distance_to_intersection fast?
I might build two lists that contain all the lines from both left to right and top to bottom. That way the algorithm can just work its way up/down the list.
What do you guys think? Is there something that isn't clear (it feels like a lot of this is just me ranting), can you think of a scenario that would break the algorithm? (It feels really naive) Any help is appreciated.
Edited by Rani_sputnik, 01 November 2011 - 07:53 AM.













