algorithm - Break a rectangle into randomly shaped polygons -


just title says, need break rectangle randomly shaped polygons.

example, 7 polygons:

+--------+--------+ |\       |   2    | | \  1   |''--..__| |  ------|  5     | | 3  /   \________| |   /    /\   6   | |__/ 4  /  \______| |      /  7       | +-----+-----------+ 

i don't know if there's algorithm out there this, can't seem head around this.

i don't particularly care language answer in, i'll implementing in java/swing.

you may drop bunch of random points on rectangle, , calculate voronoi diagram.

here java/swing implementation.

i did samples (but using mathematica, not above implementation)

alt text

alt text

alt text

hth!


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -