[CityGen] Standard Output
-
I was thinking some tasks might could be greatly simplified from a coding point of view if each module had a standard output. For example:
centreline generating module -> set of generated centrelines
street generating module -> set of all street faces
block subdividing module -> Set of faces, each face being a plot
building generating module -> Set of generated buildingsI think the main advantage of this would be that when writing a module you know what you've got to work with and you know what your module needs to produce, rather than each module author trying to sieve through the model trying to find all the stuff they need.
Just another thing to add to the growing list of stuff to think about

-
I agree, and I think thats a good opening to this conversation. This is how I see the whole being able to be modular - is that each person knows what the standard input is for their module. So if someone wants to write their own "block subdivider", they know that they will be given a series of "city block" faces, and then know that they should subdivide them however they want and that they need to supply a series of "parcel" faces as their output.
So I think we keep building on this as we keep developing the modular functionality. And how modular do we want to go?
Chris
-
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)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement