I know it doesn't look like much, but it's been a lot of work. While one could obviously generate three flat polygons much more easily, what's happening in the background here should lay the foundation for grander things to come.
So far I have only implemented a single rule. This rule generates a ground floor, a section for intermediate floors and a top floor. Rules can tell the system to add geometry, make extrusions, translate or rotate geometry, instantiate geometry etc. They must be hand-wired, so the more rules you add the more complexity you can get.
By randomizing all parameters and adding probabilities for the rules, you can generate all sorts of procedural buildings. At least that's the theory.
In the image you see the first generation of rewriting. Every building starts off with a 0. This particular rule turns the 0 into 1,2,3 and specifies a few parameters (mainly the height of these floors). A next rule could split the ground floor into a bunch of window segments and a door. Another rule might split the intermediate floor section into <<a cornice, an intermediate floor section and another cornice>>. Or not. It's all about rewriting. You take a shape and replace it by other shapes until you end up with shapes (terminals) that don't have rewriting rules. When that happens, everything gets translated into geometry.
