Growing streets along static shapes

444
1
10-26-2017 01:11 AM
JafarNajafli
New Contributor III

Hi,

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
ThomasFuchs
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()
    
    subdsettings.setCornerAlignment("STREET_WIDTH")
    # Sets CornerAlignment field.
    # @param enumValue: the new value ["STREET_LENGTH", "STREET_WIDTH"]. [str]
    
    subdsettings.setCornerAngleMax(120)
    # Sets CornerAngleMax field. Corner angle threshold. If corner angle is below this value, "soft" corners are inserted.
    
    subdsettings.setCornerWidth(0)
    # Sets CornerWidth field. Corner width. Inserted "soft" corners have this width.
    
    subdsettings.setForceStreetAccess(0)
    # Sets ForceStreetAccess field. Factor to guarantee street access. A large value gives preference to splits that result in lots with street access.
    
    subdsettings.setIrregularity(0.3)
    # Sets Irregularity field. Split line irregularity. Larger values result in split positions more distant from middle point.
    
    subdsettings.setLotAreaMax(1500)
    # Sets LotAreaMax field. Maximum lot area. If the lot area is less than this value, subdivision stops.
    
    subdsettings.setLotAreaMin(500)
    # Sets LotAreaMin field. Minimum lot area. If the lot area is greater than this value, subdivision continues.
    
    subdsettings.setLotElevation("UNEVEN")
    # Sets LotElevation field. Flat or uneven lots.
    # @param enumValue: the new value ["UNEVEN", "EVEN_MIN", "EVEN_MAX", "EVEN_AVG"]. [str]
    
    subdsettings.setLotMinWidth(10)
    # Sets LotMinWidth field. Minimal lot side length. If violated, the split position is sampled again.
    
    subdsettings.setLotSubdivisionMethod("SKELETON")
    # 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]
    
    subdsettings.setOffsetWidth(25)
    # Sets OffsetWidth field. Offset width. When block inwards offset is used to compute subdivision, this is the default depth of the generated lots.
    
    subdsettings.setSeed(-528362)
    # Sets Seed field. Seed.
    
    subdsettings.setShallowLotFrac(1.5)
    # Sets ShallowLotFrac field. 
    
    subdsettings.setSimplify(0)
    # Sets Simplify field. Amount of simplification that occurs. A high value creates irregular lots with fewer vertices.
    
    subdsettings.setSubdivisionRecursive(True)
    # Sets SubdivisionRecursive field. Use recursive algorithm for subdivision.    
    
    return ce.subdivideShapes(shapes, subdsettings)
    

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