We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Space Filling Algorithm
Page Index Toggle Pages: 1
Space Filling Algorithm (Read 2107 times)
Space Filling Algorithm
Jan 29th, 2009, 11:39am
 
Hi,

Hoping someone can help uncover the mystery that is space filling.

I find lots of examples on google of space filling apps, but no one seems to want to explain how to do it, or release sample code.

Any help would be much appreciated in getting to the bottom of how to do this.

Cheers,

Emile
Re: Space Filling Algorithm
Reply #1 - Jan 29th, 2009, 5:28pm
 
You are a bit too generic... I can easily fill the space of the sketch... for example with squares of equal size! Which is also a very primitive tiling method.
The algorithms behind space filling are non-trivial, although perhaps reachable in some cases for a medium level programmer like me.
But we (I) need a precise goal, like filling a circle with random sized circles, or filling a rectangle with a curve, etc.
Re: Space Filling Algorithm
Reply #2 - Jan 29th, 2009, 5:36pm
 
Hi

Sorry, you are absolutely correct...my question was probably a little vague!

If i could get the basic principals behind filling a square space with random size squares, then that would be a great kick start to get to where i need/want to get.

Thanks for your help....
Re: Space Filling Algorithm
Reply #3 - Jan 29th, 2009, 5:55pm
 
http://www.complexification.net/gallery/machines/boxFitting/

http://www.davebollinger.com/works/boxfit/
Re: Space Filling Algorithm
Reply #4 - Jan 29th, 2009, 6:53pm
 
"space filling" typically implies the field covering such things as Peano / Hilbert / Sierpinski / etal curves.  Another search word might be "tiling", if that's what you're after, implying such things as Penrose tiles, et al.  L-Systems come to mind as something you might want to look into.

Hard to suggest a solution without knowing the problem to be solved.  For instance, if you just want to divide up a square into other squares, a simple recursive method might go like:

divide a square into 4 equal quadrants
take one or more of those quadrants and repeat
(until some stop condition reached, like too small)

..now you have a square full of many smaller squares.  how you select which quadrants to further subdivide will affect the final pattern.
Re: Space Filling Algorithm
Reply #5 - Jan 29th, 2009, 8:14pm
 
Thanks for all the advice guys,

Will be looking up all those names tonight!

..and i'll follow up with my progress.

Thanks again

e

Re: Space Filling Algorithm
Reply #6 - Feb 13th, 2009, 3:04am
 
"Packing" is another way to think of space filling - so search for packing algorithms. I just made a (very simple) square packing process for a data visualisation: http://visiblearchive.blogspot.com/2009/01/packing-them-in.html

The algorithm is described in the blog post, and there's also some (no doubt ugly) code available on the sketch page. Cheers,

Mitchell
Page Index Toggle Pages: 1