I just made the Street Generator pick out the area's between the streets, blocks, and generate a set of faces for them. Which can then be used by another module to generate pavements, and lots to generate housed from.
It's currently an option set during when you create the streets.
Should I fork it into a separate module? Block Finder. And have the street generator rely on that module?
Also, I'm marking all the generated geometry with and attribute dictionary. The dictionary name indicate what type of data the group contains.
'CG_Streets' -> The street geometry generated from the centre lines.
'CG_Block' -> Geometry of the space between the streets - blocks. (Should probably be 'CG_Blocks'?)
Propose that modules that generate centre lines tags it 'CG_Street_Map'.
Each dictionary contains a 'Generator' attribute. It indicate which module and version generated the geometry. (In case we need to determine this.)
The Generator ID is built up of two parts; module ID and version number.
Example, the Street Generator has a Generator ID that looks like this: 'Street_Gen-0.4.0'
The string is split by a hyphen.
Extract of the code:
module City_Gen
module Street_Gen
### CONSTANTS ### --------------------------------------------------------------------------
unless file_loaded?('street_gen.rb')
VERSION = '0.4.0'
MODULE_ID = 'Street_Gen'
GENERATOR_ID = MODULE_ID + '-' VERSION
end
...
# Group containing generated geometry.
g = model.entities.add_group
g.set_attribute('CG_Streets', 'Generator', self;;GENERATOR_ID)