Growing streets along static shapes

10-26-2017 01:11 AM
New Contributor III


I have a project where I need model the possible building and lot subdivisions for the proposal plan blocks. I imported the blocks as static shapes and need to make them dynamic in order to control the lot subdivisions and etc.

I'd like to know if there is any way that I can make Cityengine automatically grow streets along the defined blocks?

0 Kudos
1 Reply
Esri Regular Contributor

Hello Jafar

Thank you for your question. Depending on the Block shape, it can be quite complicated to grow streets around them. There is certainly no easy to command to accomplish this task.

But for your use case, there is a simple solution. You can use the Python command ce.subdivideShapes to subdivide lots in the same way as dynamic shapes.

Please use the following script:

@author: Esri R&D Center Zurich
from scripting import *

# get a CityEngine instance
ce = CE()

def subdivideShapes(shapes):
    subdsettings = SubdivideShapesSettings()
    # Sets CornerAlignment field.
    # @param enumValue: the new value ["STREET_LENGTH", "STREET_WIDTH"]. [str]
    # Sets CornerAngleMax field. Corner angle threshold. If corner angle is below this value, "soft" corners are inserted.
    # Sets CornerWidth field. Corner width. Inserted "soft" corners have this width.
    # Sets ForceStreetAccess field. Factor to guarantee street access. A large value gives preference to splits that result in lots with street access.
    # Sets Irregularity field. Split line irregularity. Larger values result in split positions more distant from middle point.
    # Sets LotAreaMax field. Maximum lot area. If the lot area is less than this value, subdivision stops.
    # Sets LotAreaMin field. Minimum lot area. If the lot area is greater than this value, subdivision continues.
    # Sets LotElevation field. Flat or uneven lots.
    # @param enumValue: the new value ["UNEVEN", "EVEN_MIN", "EVEN_MAX", "EVEN_AVG"]. [str]
    # Sets LotMinWidth field. Minimal lot side length. If violated, the split position is sampled again.
    # Sets LotSubdivisionMethod field. The subdivision algorithm used. The recursive method is creates regular blocks, while the straight skeleton guarantees street access.
    # @param enumValue: the new value ["RECURSIVE", "OFFSET", "SKELETON", "NONE"]. [str]
    # Sets OffsetWidth field. Offset width. When block inwards offset is used to compute subdivision, this is the default depth of the generated lots.
    # Sets Seed field. Seed.
    # Sets ShallowLotFrac field. 
    # Sets Simplify field. Amount of simplification that occurs. A high value creates irregular lots with fewer vertices.
    # Sets SubdivisionRecursive field. Use recursive algorithm for subdivision.    
    return ce.subdivideShapes(shapes, subdsettings)

if __name__ == '__main__':
    print subdivideShapes(ce.selection())