[Plugin] [CityGen] - Core [WIP] (0.1.3a) β 19 September 2009
-
This plugin is a work in progress. It's made public because it is a collaboration project.
This is in it's very early beginning, so lots of things will change, and lots of bugs are to be expected. Feel free to share your ideas or join in on this project. See this thread for the discussion of the overall project. This thread is an overview of the related modules and the development thread for the core files.CityGen - Core
Core and Installation Check
This is the main file that centralise information and load the other modules.
Modules are located inPlugins\CityGen\modules\.Please remove any old CityGen installations prior to installing.
Menu entry is located under the
Toolsmenu. Should this be underPluginsyou think?Modules
For Module Developers
Core and Installation Check
You can add this code to your module to check if the core is installed and that the module is installed in the correct location.### CORE & INSTALLATION CHECK ### ------------------------------------------------------------------ # Core check if not file_loaded?('city_gen.rb') if Sketchup.find_support_file('city_gen.rb', 'Plugins') == nil UI.messagebox('The CityGen\'s core files is missing. Install the required core files.') else UI.messagebox('The CityGen\'s core files is not loaded. Ensure you installed this plugin correctly.') end raise 'CityGen Core error.' end # Correct installation check if Sketchup.find_support_file('City_Gen/' + File.basename(__FILE__), 'Plugins') == nil UI.messagebox("This module (#{File.basename(__FILE__)}) has not been installed properly. It should be installed under Plugins\\City_Gen\\") raise 'CityGen Module path error.' end module City_Gen module Some_Module # stuff end end# CHANGELOG # 0.1.0a - 31.05.2009 (Thom) # * Initial build. # # 0.1.1a - 31.05.2009 (Thom) # * Change in the module error checking routine. # # 0.1.2a - 31.05.2009 (Thom) # * Added version constant. # # 0.1.3a - 31.05.2009 (Thom) # * Updated to the new file structure for use with Tortoise.
-
Hi Thomas,
great initiative! I have been following the development thread a bit and, although I didn't understand all the technical coding bits, this is really a good idea.A little suggestion: Architects often have 2D .DWG input plans of the street blocks and road lines surrounding their project.
We start cleaning up the DWG lines and try to recreate the existing buildings. Will the CityGen plugin also take into account DWG imports to start form? I can imagine that it could automate the process a little so we easily can generate the 'city' surroundings and then start finetuning the buildings to reality. It would be cool if street furniture (street lights, road textures with markings etc...) would be implemented as well in a later phase....but maybe that's dreaming
Good luck with the project to all who are working on it.

-
@kwistenbiebel said:
Will the CityGen plugin also take into account DWG imports to start form? I can imagine that it could automate the process a little so we easily can generate the 'city' surroundings and then start finetuning the buildings to reality. It would be cool if street furniture (street lights, road textures with markings etc...) would be implemented as well in a later phase....but maybe that's dreaming

That will depend on the module.
I'm currently working on the Street Generator. It takes the centre lines for the streets and generate faces given a width. DWG plans usually includes such a centre line, so there is a potential it can be used.
However, currently everything has to be planar. No 3D road maps. Also, it assumes a symmetrically placed centre line. It doesn't take into account the centre line in relationship to the edge road lines which you get in DWG files. Working out that is much more complex and would be something further down the line. Most likely a separate module to process DWG plans.As for building, I'd think that'd be possible, taking the footprint and extruding it. It's easy if the footprints are fully connected. I often find that lots of time the data I get from DWG plans have lines with gaps. Working out such a plan instantly makes it more complicated. Also, if you want something that can take the foot print and extrude it to the correct height, that's also something that will make it even more complicated.
I'm not sure how accurate you where thinking?
First and foremost this project will start out simple. Getting a simple way of quickly populating a city area. Illustration is the key word here, not simulation. But I work in an architectural office myself as a modelmaker and illustrator, so tools to generate geometry from DWG plans is something that is in my own interest. I certainly hope this can develop into something that could make good use of DWG data. This is after all a very open project with the intention that anyone can add their own module to build upon the existing work.My main concern about DWG data is that I find so much of it inaccurate. That you'd need to 'understand' the data it has and interpret it.
@kwistenbiebel said:
It would be cool if street furniture (street lights, road textures with markings etc...) would be implemented as well in a later phase
Entourage and Textures are two likely separate modules. Both which of interests me once we've got the basics going.
-
We should keep close in mind how the API for the communication between the modules should be. I think this is very important to get established as early as possible. But lets see how this thing evolves.
-
gingerly

Thom could you please explain how the plugin decides the radius of join between 2 roads. It would be good to have some sort of control over it so it can be used in real situations rather than purely for visual/game stuff. I have not install it yet so I might be shooting blanks here.

-
Close, but still not 100% the correct thread. This is the Core thread. Not the Street Generator.

(I had a feeling making all there threads would be confusing. But how would you avoid confusion of the discussion on all the modules where in one thread?
Someone got a suggestion to how we can do this?)(I'll post the answer in the Street Generator thread sepo.
) -
Small update: Added version constant to the core module so it can be identified by the modules.
-
@thomthom said:
Close, but still not 100% the correct thread. This is the Core thread. Not the Street Generator.

(I had a feeling making all there threads would be confusing. But how would you avoid confusion of the discussion on all the modules where in one thread?
Someone got a suggestion to how we can do this?)(I'll post the answer in the Street Generator thread sepo.
)I am affraid that forum is not the best option to collaborate on project like this... at least not in the long run. I do not want to turn you away from SketchUcation forum, which is great to discuss things, yet it does not provide (nor does any other forum) things like version control, task tracking, ... which you will definitely want. Maybe you shuould consider something like GitHub, which seems to be very popular choice for OS projects these days? It can make collaboration on project like CityGen much more manageable and easy...
-
I think that is a good suggestion. I don't want to take the conversation away from here (where the creative juices freeloy flow), but at the same time, I"m afraid that realisticly, the logistics of working colaboratively on this will get tricky quickly - until Google Wave gets implemented in the near future!
But for now, perhaps a code hosting place might be necessary. What about Google Code?
I've created a test account. I'll add both Remus and Thoms as project owners so you can log in and test it out if you'd like. PM your emails addresses.Chris
-
OK, I got Remus signed up, but I need a gmail account from you Thom (or youll have to create it first before you can sign in and use the project admin).
This is just a test. To see if its something we want to try to use. It only offers opensource licenses. So PM me your gmail address and I'll add you.
Chris
-
Yea... I was thinking that some version management (and possible project management) would help us here. But I've never done such a collaboration project, so I wasn't sure what I was looking for.
-
I see SourceForge often used, anyone had any experience with that? http://sourceforge.net/
-
I download from there, but I've never used it before. I've never used any before really. So I'm open to pretty much anything, especially free

Chris
-
I don't know about coding at all, and I appreciate this ruby very much. I am
"into" urban design and wonder if there is a way to select different streets for different widths- for example main streets and alleys will have different widths... ?
Thanks for this collaborative effort! -
I suggest http://www.github.com or http://www.bitbucket.org - both have distributed version control (github - git and bitbucket - mercurial) and issues management
or we can use http://code.google.com/p/support/wiki/GettingStarted (it has support for mercurial as well)
-
I know nothing about how the different distribution tools work. I've heard of subversion before, but never the onther ones. Do you prefer mercurial TBD?
Chris
-
yeah, Mercurial is my main version control (all my projects are in mercurial), but I also use git from time to time.
Mercurial on Windows is smaller and faster on small sized projects that git. I also like the commands more

http://hgbook.red-bean.com/read/ - the book about mercurial with examples
-
We use Mercurial for Modelur development, too. It's great and provides GUI for windows - TortoiseHg.
-
Are any of these free services?
-
@troyhome said:
I don't know about coding at all, and I appreciate this ruby very much. I am
"into" urban design and wonder if there is a way to select different streets for different widths- for example main streets and alleys will have different widths... ?
Thanks for this collaborative effort!Yes. I'm working on that.

Advertisement