sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🚨 Skimp | 25% Off until March 30 Buy Now

    [CityGen] Standard Output

    Scheduled Pinned Locked Moved City Generator
    3 Posts 3 Posters 10.6k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      remus
      last edited by

      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 buildings

      I 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 πŸ˜›

      http://remusrendering.wordpress.com/

      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        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

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          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)
          
          

          Thomas Thomassen β€” SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0

          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 Login
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement