CityEngine Scripting

From TOI-Pedia


Working with CityEngine

Generated 3D Environment

The Interface

To start working with CityEngine, we will familiarize ourselves with its interface, seen below.

CityEngine 2015 Interface
  • 1. Menu Bar : for accessing all the functions in CityEngine
  • 2. Navigator windows : to manage and preview files in the workspace
  • 3. Viewport : for viewing and navigating in your 3D environment
  • 4. Scene editor : for scene, layer, and object management
  • 5. Inspector : for a detailed view and editing of selected objects

Visit this URL for more information.


Example.cej
  1. Download the project files.
  2. Open CityEngine and close the Welcome Wizard for now so you can see the interface.
  3. To import our project RMB in the Navigator window and chooseImport.... The Import window opens. Select Existing Projects into Workspace and click Next.
  4. In the Import window Select archive file and browse to the location of the downloaded file and open it.
  5. Navigate to the scenes folder and double-click to open the Example.cej file. .cej files are like .mxd files in ArcMap. (if you get a pop-up, asking whether you want to regenerate models, click on NO. Re-generating your whole scene can be demanding on your computer performance, especially with large projects.)
  6. If all goes well, you should see a similar image as the one to the right.


Even though you clicked not to re-generate the models, you still see 3D buildings in your viewport. The reason is that these models are Multipatches imported into CityEngine. They are basically static textured 3D models, but CityEngine calls them Shapes instead. Rules can still be applied to these models.

Enable Compass and the Axes
  1. Left-Click on one of the models to select it and on the right side in the Inspector window, you will see information like, which rule is applied to that shape, reports of that shape and attributes (if it has any). These attributes are also the attributes you find in the attribute table in ArcMap.
  2. Use ALT+LMB(Left Mouse Button) to rotate, ALT+MMB(Middle Mouse Button) to pan and ALT+RMB(Right Mouse Button) to zoom, or you can also use the scroll wheel.
  3. Select one of the southern empty plot... but do you know where south is?
  4. On the upper right corner of the Viewport window, click on the dropdown menu of the Gear icon and enable Compass and Axes. You will then see at the lower right corner of the Viewport a compass and three axes.
Shadows and Ambient Occlusion is better left turned off for faster and better performance.



Reports and Attributes of one shape
  1. When you select one of the ground planes, in the Inspector window, you will see that the shape has a rule assigned to it and under it, there are a bunch of parameters. Keep an eye on the Report section, which is still empty.
  2. Now, lets generate our geometry. With the empty plot selected, press Ctrl+G or click on the Generate button at the top of the Viewport. Now you will see some information in the Report Section.
  3. Take a closer look at the names of parameters under Building Parameters and notice how the names corresponds to the names under the Object Attributes. The parameters with (Object) behind it means that the parameters are derived from the Object Attributes table and these are called Geo-data.
  4. Now, press Ctrl+A to select everything and generate everything with Ctrl-G. Your scene should look similar to the image below.
If your computer hangs or crashes during the generate operation, try generating in small portions.
All Models generated. Explanation of types of models and different shapefiles


Random Mode changes the model every time we update the seed
  1. Select one of the modern flats and notice that in Rules none of its parameters are derived from the Object Attributes table.
  2. Notice the Variation_Mode under the Building Height parameters is set to Random. Press Ctrl+Shift+G or click on the Update Seed button (next to Generate button). The building will change form every time you update the model.
  3. Try experimenting with different values and also for the other flats.


Basic CGA

The CGA shape grammar of the CityEngine is a unique programming language specified to generate architectural 3D content. The term CGA stands for Computer Generated Architecture. The idea of grammar-based modeling is to define rules that iteratively refine a design by creating more and more detail. These rules operate on shapes which consist of a geometry in a locally oriented bounding-box (so-called scope). The following rule derivation illustrates the process: on the left side the initial shape is shown and on the right side the resulting generated model is displayed.


©ESRI. Iteratively refine a design by creating more and more detail


To create such detailed model as the Temple will require some time and a firm understanding of CGA language. We will start with the basics to get ourselves familiarized with CGA language. In order to do this, we will aim to create a basic building.

CityEngine mainly uses three operators to generate a 3D building from a flat surface.

  • extrude(axis, height) : This function will take the selected surface and extrude it along the defined axis (x,y or z) with a given height. The end result is a mass volume.
  • split(axis) {length_1:name | length_2:name_2} : This function will split a volume along a defined axis (x,y or z) with a desired amount of splits and each with a desired length. If this is difficult to understand, don’t worry. You will understand it when we use it later.
  • comp(f,e,v) {selector:name} : This function will decompose a volume so we can select either its Faces, Edges or Vertices. For now, we will only use faces. So the function will be mainly comp(f){selector:name}. As for the Selectors, you can choose one of the following: top, bottom, right, left, front, back, side (all sides, except top and bottom) or all (all sides).


Rule Editor window and the Rule Editing Layout
First Edge circled

Now let’s start writing our own first CGA rule for our building.

  1. Navigate to the rules folder and RMB on the Rules folder » New » CGA Rule File.
  2. The CGA rule wizard appears. The container is the file location and the name field is where we name our new rule. I call mine BasicBuilding.cga, you can name yours whatever you like. Click Finish.
  3. Now we see a new window appear where our scene was. This is the Rule Editor window.
  4. It’s always handy to check what our rule is doing while we’re writing it. For this, we will make a test surface. Click on the Rectangular Shape Creation tool or Shift+S and drag a rectangle along a road.
    Create rect tool-01.png
  5. Our Rule editor window is way too small for us to write our codes, so let’s make it bigger. You can drag the edges and expand it, but instead we will use one of the Layout presets. Go to Window » Layout » Rule Editing Compact. Now we have a much bigger and cleaner space to write our rules.
  6. Select our new surface,RMB » Assign Rule File... » BasicBuidling.cga » Open. You will get a window saying that there is no Start Rule found in “BasicBuilding.cga”. The Start Rule indicates where to start generating of a model.
  7. If you look very closely, you will see an orange edge somewhere on your surface. This is the so-called First Edge. This edge indicates where the Front is. As you can see, our front is facing the wrong direction. We can correct this by manually selecting the edge we want as front and go to Shapes » Set First Edge. However, this process becomes tedious when we have hundreds of shapes. Instead, we will use CityEngine’s built in function to find the First Edges for us.
  8. Select the surface, got to Shapes » Compute First/Street Edges. CityEngine will find the edge that is facing a street and make it the First Edge.


  9. First part of our Rule.cga
  10. Now let’s start writing our rule. We want our surface to extrude up by 5 meter. Start by defining the StartRule so CityEngine knows where to begin executing the code and then use the extrude function (extrude(axis, height). Like so:
    @StartRule
    Lot-->
    extrude(world.y, 5)Mass
  11. Mass is the name of our newly extruded block, we will use this name further down in our code. The Yellow warning sign or the yellow underline under Mass only means that this block is not used anywhere...yet. If it were a red warning sign or red underline, then it means something is wrong with the code.
  12. Save our script with CTRL+S and test our script with our surface.
  13. Select our surface and RMB » Generate(CTRL+G).
  14. If you don’t see the surface extruding, then try re-assigning the rule to the surface.


    Our new Variable Parameter in the Inspector
  15. Now we’ve given our building a height of 5 meter, but the beauty of CityEngine is that we can make it into a variable parameter and adjust it. Let’s make the height into a parameter we can adjust. Add the following code right under version “2015.0”.
    attr Height =5
    With that, we created our first parameter. You can name it whatever you want, but keep in mind that it must NOT HAVE SPACES IN THE NAME.
  16. Link this newly created parameter in our extrude function. Change the 5 into Height.
  17. The names we use for our parameters are CASE-SENSITIVE!
  18. Save our changes and regenerate. Notice that our Height Parameter now appears in the Inspector window with the value we first defined. We can adjust it by manually typing a value or using the slider bar.

  19. Selecting separate facade faces and color them
  20. Next, we will decompose our mass into 5 surfaces: top, front, left, back and right. We will use the comp(f) {selector:name} function. Add the following lines to our code.
    Mass-->
    comp(f) {front:frontFacade}
    frontFacade-->
    color(1,0,0)
    Save our changes and generate the model. Notice how only the front is colored red. Here we used the color operation. You can use either RGB or HEX values to color geometries. If using RGB, then the function is color(float, float, float), where float is a number range from 0 to 1. If using HEX values, then the function is color(“#hexhex”), where hexhex is the value with a hashtag (#) and enclosed in quotation marks(““).

  21. Our colored Mass generated by our CGA rule

  22. Now let’s add the back facade too.
    comp(f) {front:frontFacade|back:backFacade}
    backFacade-->
    color(1,1,0)
    Save and generate. Instead of creating a new comp(f), we simply expanded the first one with a vertical bar ( | ), found mostly next to the Enter key on your keyboard. Now do the same for the left, right, and top and color them green, blue and purple respectively. Save and generate to see the updated model. Your script should look similar to what I have now.

  23. We will now add some floors to our building using the split Operation. Just like ArcMap, CityEngine also has an extensive Help menu which explains the usage of all the functions and operations with examples (very handy!). You can access this by going to Help » Help Contents or by pressing F1. It is recommended to consult the help menu if you get stuck or if you want to know how a particular operation works.

    Our Rule now adapts to Building height changes!

  24. Look up Split Operation in the Help menu to see how it works. We will use it to divide our building into a ground floor, middle floors and a top floor. We will use two normal splits for the top and bottom and a repeated split for the middle floors.
  25. Make a parameter for the floor height and set its initial value to 2.5m. Remove everything under the line ”Mass-->” and type in the following :
    split(y){floorHeight:groundFloor|{floorHeight:middleFloors}*|floorHeight:topFloor}
    The asterik (*) indicates the repeat, so whatever is between {...}* will be repeated as long as there is enough space to do so. You should see our building divided into two halves. Try changing the Height slider and see what happens.
  26. Now let’s give our new facades some colors. Give the ground floor, all middle floors, top floor and the top face the colors, green, yellow, blue and red respectively. Your code should look pretty similar to the image on the right.

  27. Adding a roof to our Mass Building

  28. Next we will add a roof to our building. There are four types of roofs we can choose from in CityEngine, namely: roofPyramid, roofShed, roofGable and roofHip.
  29. Look in the Help menu to learn more about the roofs operations. We will be using a gable roof for our building, so we will use the operations, roofGable. Create parameters for the following and set the value accordingly.
    • angle = 45
    • overhangX = 0.1
    • overhangY = 0.1
    • Index = 1
    We will also name our Roof....”Roof” (not very creative, but it works). In our code, use the roof--> and delete its color. Our new code should look like the image to the right. Consult the Help Menu to find out why we used a Boolean value true in our roofGable operation. The roof index is used to give some types of roofs a direction. Try changing the parameters and see.

  30. Code for choosing roof type and color

  31. Now let’s add the option to choose different types of roofs by adding a Roof Type parameter using Conditional Rule. Add the following line to our code, right under attr roofIndex = 1.
    @range(“Gable”,“Pyramid”,“Shed”,“Hip”,“Flat”)
    attr roofType = “Gable“
    The “@Range(...)” can be used to store both strings(words) and values(numbers/Boolean).
    The Range must be placed before the parameter that will use them.
  32. Remove everything after “roof-->” and add the following conditional rule to our code:
    case roofType == “Gable”:roofGable(roofAngle, overhangX, overhangY, true, roofIndex)Roof
    case roofType == “Flat”:extrude(world.y, 0.5)Roof
    else:NIL
    Note the double equal signs (==). One equal sign means assigning a value, double equal signs means a comparison between two values and check whether it’s true or false. Basically, our code says, if the roofType “Gable” is selected then execute the line of code for that roof type. This is the same as the famous If else statement known in programming.
    Now expand the code to encompass the rest of the roof types!.
  33. Add a parameter to color our roof. Use a HEX value!

  34. Organized the Inspector with grouping and order.

  35. As you can see in our Inspector, our parameter list is rather chaotic and it will become even worse when we make more complex scripts. So let’s take this time to organize things a bit, add annotations and group relevant parameters together.
  36. We will make two groups: Walls and Roof. The order each parameter should be in is as follow:
    • Walls : 1.Height | 2.floorHeight
    • Roof : 1.roofType | 2.roofColor | 3.roofAngle | 4.roofIndex
    We will also make the overhang parameters invisible or hidden. The functions we use for organizing are: @Group, @Order and @Hidden. Your code and your Inspector should look similar to what I have.

  37. Import and Use GIS-Data

    Now we will see how we can import various types of GIS-data into one scene. Next we will use rules to generate our models based on the information from the Attribute table of shapefiles. We will also have a look at using raster images as input information for our rules.

      Select the heightmap and the texture files for import
    1. Reset the layout back to the default if you haven't already. Window » Layout » Default. Create a new scene, Navigate to the scenes folder and RMB » New » CityEngine Scene. I will call the scene “Cocksdorp.cej” (Cocksdorp is a small town in North Holland).
    2. First, we must load in the terrain of our little town. We will use an aerial photograph to generate a DEM model (DEM = Digital Elevation Model).
    3. Navigate to the folder data » Rasters and drag the file “Texel_Noord_IDW+50.tif” to our Viewport. You will be prompted to choose a coordinate system, because we have not specified this when we created our new scene. Just select RD New and click OK.
    4. In the next window, we will choose a Heightmap file and a texture file. The Heightmap file will be the raster file where we will extract its information to generate our terrain in 3D. This 3D terrain will get its texture from the specified Texture file.
    5. Select the file “Texel_Noord_Luchtfoto.tif” in data » Rasters as the texture file and click Finish.

    6. You may wonder what that “+50” is at the end of our Heightmap file. This means that the height data is increased by 50m so as to compensate for a bug in CityEngine, where elevations below zero will be counted as “No Data” values while importing. To correct this 50m increase, we will offset our elevation with -50m. We can do this in the Command Window under the Inspector window of our terrain.


      Choose the right field to enter the offset value
    7. Inspector » Layer scroll down and add “-50” at the end of the line, behind “elevationDelta”. DO NOT use the “Elevation Offset” found at the top of the Inspector window, because this will only offset the terrain and will cause issues when we align shapes to our terrain.
    8. Now lets add more information to our scene, starting with the building plot footprints. Navigate to data » Features » BAG and drag the file “BAG_Plot.shp” to our Viewport.
    9. You can turn the layers in the Scene window on and off by toggling the check-boxes. As you can see most of our shapefiles are under the terrain. This is due to the fact that our shapefiles do not have a height/elavation value yet. They’re flat on one plane like an AutoCAD drawing.
    10. To align the shapefiles with the 3D terrain. Select all the shapefiles by Right-clicking on the layer in the scene window and Select Objects.

    11. Aligning shapes to the Terrain
    12. Go to the Shapes » Align Shapes to Terrain.... In the option window, select the align function “Translate to Average”, choose our Terrain Texel_Noord_IDW+50 as the Heightmap and then give an offset of “-0.05”, so our plots sits just slightly under the terrain (used later when generating 3D models).

    13. Aligning Roads to the Terrain
    14. Next let’s add the streets and roads to our scene. Navigate to data » Features » Roads and drag the file “NWB_Texel_Noord.shp” to the Viewport. Do the same alignment for our Roads network. With our Graph Network layer selected in the Scene window, go to the Graph » Align graph to Terrain. Select our heightmap and then set the offset to 0.1. This will raise the roads slightly higher than our terrain, like any asphalt roads.

    15. Aligning Terrain to Shapes
    16. Now we will make the terrain bulge up to our roads, so our roads wont appear as if it is floating 0.1m above ground. Select all the shapefiles of our roads by RMB on the Graph Network » Select Objects, then go to the Layer » Align Terrain to Shapes. Set 1 for the “Maximal raise distance" and 2 for the “Maximal lower distance”, click Apply then Close.

    17. Automatically fixing the Widths of Roads
    18. As you can see in the scene, all of our roads have the same width and some even overlap with our building plots. Ideally, we would use the attribute of the roads shapefiles make a more accurate model. Since we do not have that option, we’ll use CityEngine’s tool: Fit Width to Shapes. Select all our roads again, then go to Graph » Fit Widths to Shapes.... Enter the values as shown in the image to the right, click Apply then close. Notice how our roads which was overlapping now becomes more narrow to accommodate for the buildings plot.

    19. Automatically fixing the Widths of Roads
    20. Now let’s clean our roads shapes a little bit to optimize the vertices count and in turn, efficiency for our whole model. Select all roads shapes again, go to Graph » Cleanup Graph.... Enter the settings as shown in the image and click Finish.
    21. Next, we will assign a rule to our roads. ESRI has added a library of rules, textures, and other assets like plants since CityEngine 2014.0. At the time of writing this, there is no rules for Dutch roads, because it is a rather complex task. Instead we will use one of ESRI’s rules for roads.
      Select our roads, RMB in the viewport » Assign Rule File... then navigate to ESRI.lib » rules » Streets » Street_Modern_Simple.cga » Open.
    22. Generate the models for our roads and change the NbrOfRightLanes to “0” and the Centerline to “White”.
    23. Now it’s time to populate our scene with some 3D buildings. We will have a look at different LODs (Level of Development), but first we’ll start with the most simplest and basic one, a block volume. Create a folder Buildings in our Rules folder and create a new rule, I will name it “LOD1.cga”.

    24. Create a new Mapping layer
    25. We will not use the height attributes of our shapefiles, but instead use data from AHN2 to demonstrate how we can use raster file to give our building heights. (AHN = Height data of the Netherlands)
    26. Start by mapping out the height data from the raster file: go to Layer » New Layer Map » Mapping and give the layer a name, e.g.: BuildingHeight, click Next.

    27. Mapping Brightness to Height
    28. For the Mapping file, browse to data » Rasters and select the file “Texel_Noord_Ruw.tif”. RMB on the blank space under “Attribute” and click “Add Row”. Fill in the attribute like the image to the right and click Finish.

    29. Linking the Mapped data to the Height attr
    30. Turn off every layer except, the Shapes BAG and the new BuildingHeight layer. Open our LOD.cga rule file and add the following line to the script “attr Height = 0”. Have the rule extrude our buildings upwards with Height as the value.
    31. Select all the buildings shapes and assign our rule. Now we would like to have the link the Height of our building to the Height data we just mapped from the AHN2 raster file. Do this by going to the Inspector window and click on the Arrow icon. Select the Layer attribute and choose the BuildingHeight layer as the data we would like to use as our Height attribute.
    32. Select a BAG shape and generate. Try moving (W) the shape around and see what happens. The shape will change heights depending on the underlying raster map. Remember to undo (CTRL+Z) to set the shape back to its original place.

    33. Applying conditional statements to fix certain buildings
    34. If you view it from the top view, you will notice our mapping layer is not really positioned correctly under our BAG shapes. Select the BuildingHeight map layer and enter the following offset values in the Inspector:
      • X-Offset : 119676.026
      • Z-Offset : -576215.443
      Now, select all BAG Shapes and generate! You will notice some buildings with height values are not generated, select them and generate again. You may also notice some tall but small buildings. These are most likely storage sheds, unless it’s the tower of a church or something similar.
    35. We will modify our rule to correct these anomalies. We will give any building with a height lower than 2.5m a standard height of 3m and any building with a plot size of 25m2 or less will also get that standard height. We will make use of the area size of our BAG shapes attributes. Your rule should look similar to the image to the right. Remember to link attr Area to the Shapes Attribute: OPPERVLAK our of BAG Shape layer. I colored the blocks red that are affected by our case statement. This is purely for visualizing.
    36. Navigate to data » Features » Trees and drag “TreePoints.shp” into our scene. Assign the rule “TreesBOR.cga” to the tree points and generate. Set the type to Analytical. Now we have our buildings in simple LOD1 form and our trees in LOD2.
    37. Final Model with LOD1 buildings and LOD2 trees


      Buildings in LOD2

      We have seen how we can generate simple 3D blocks. With LOD2 we will also generate roofs for our blocks. We will use the GIS-data in the attribute table from our BAG Shapes. These attributes “Daktype” and “Dakhoek” will give us the Roof type and the Roof Angle respectively.

      • Roof Type = 0 --> Flat
      • Roof Type = 1 --> Gable
      • Roof Type = 2 --> Hip
      • Roof Type = 3 --> Mansard
      • Roof Type = 4 --> Pyramid

      Open the file “LOD2.cga” in the folder rules » Buildings. This rule already has Rooftype, Roof angle, Area and number of floors (excluding the roof ) set as attributes from the attribute table. Now use the knowledge gained earlier and modify the rule so we can generate various types of roofs. Make sure that the gables on the Gable roofs are on the shortest edges of the object (Hint: use the roof index).

      LOD2 with different types of roofs


      Buildings in LOD3

      We’re going to select a few terraced houses and bring the LOD to the next tier, LOD3. First we’ll add realistic textures to the roof and the facades, then we’ll include windows, number of floors and doors.


      For the purpose of this course, we’ve added a python script which will select the Terraced Houses by its Attributes ID. This enables you to follow along more easily. Selecting objects by IDs is not a standard feature of CityEngine, but made possible with the use of python scripts to manipulate CityEngine. Scripting offers a broad range of possibilities. The use of python scripts within CityEngine will be discussed more thoroughly in other courses.

      1. Navigate to the scripts folder and open the python script “SelectByAttribute_TerracedHouses.py“ by double clicking on it. Press F9 to run the script or go to Python » Run Script.
      2. Activate the viewport by clicking on it and press F to focus on the terraced houses and press I to isolate the selection.
      3. Browse to the rules » Buildings folder and open LOD3.cga. This rule is incomplete! Assign it to the objects and generate. Try to understand what the rule does.
      4. Complete the rule by fixing the middle floors and the top floor. Make sure that the textures for the windows and doors appear realistic. (hint: remember about the first edge?)
      5. To test whether you fixed the rule or not, try changing the abs_verdie in the Inspector and see if the rule adapts properly. (Hint: Remember to consult the Help Content if you get stuck).
      6. LOD3 with fixed scaling in height


        Rules within Rules and Importing external 3D Models

        As you may have noticed earlier, the LOD3 rule used external rules to generate the windows and doors.

        • import RaamRule: “rules/SubRulesHuizen/Raam.cga”
        • import DeurRule: “rules/SubRulesHuizen/Deur.cga”



        In the LOD3.cga rule, the rule for making windows “Raam.cga” is given a name (RaamRule) during the import process. Whenever RaamRule is called, the rule will link back to the StartRule of “Raam.cga” and execute that rule as you can see in the LOD3.cga.

        Raam-->
        RaamRule.Raam


        Now open the Deur.cga rule in rules » SubRulesHuizen folder. Notice the several types of doors in the case statements. These doors are imported 3D models in the .obj format. CityEngine supports importing and exporting a wide variety of formats. Seek the Help Contents for more information about the Insert function (i Operation).

        ©ESRI, Overview of all supported formats with export/import



        Imported OBJ object into the rule
        Corrected Church
        1. Run the script “selectByAttribute_Church.py“ then Frame and Isolate it.
        2. Make a new rule (Church.cga) in the rules folder and open it.
        3. Navigate to the assets » 3D Models folder and drag the “Kerk.obj” file to our rule editor.
        4. Write the @StartRule and apply the inserted 3D model onto our plot.
        5. As you can see, our church model is imported and fits nicely onto our plot area, but it’s orientation is not correct and therefor messed up the proportions. Add the following scale operation before the i operation:
          S(0,0,0)
          What that line does is simply saying, do not scale the model. If you generate again, you’ll see that we have returned the church to its original proportion, but its orientation is still not correct.
        6. We will rotate it by 90degress. Add a rotate line after the i operation:
          R(xAngle, yAngle, zAngle)
          Experiment with the rotate values until the front of the church is facing the street.
        7. Now lastly, we will position the church back to the plot area by centering it. Add a center operation along the XZ plane (groundplane), then generate.

        8. center(xz)


          Before we continue with the import and export of 3D models, let's review what we’ve learnt till now. Use the same python script to select our Terraced houses, assign the rule “RijtjesHuis.cga” and generate. Update the “Seed” by CTRL+SHIFT+G or clicking on the update icon. If you inspect the rule file, you’ll notice that there are several randomization applied. These are the different randomization operations used in the rule:

          • rand(...) Gives a random flat number between a given domain.
          • p() Gives a TRUE boolean value within the given chance for true between 0 and 1.
          • listRandom() Returns one of the string values from a specified list randomly.
          • fileRandom() Randomly picks a file from a speficied folder e.g.:fileRandom(“assets/&.obj”).
          • 20%: is a case statement where we can specify the chances for something to be chosen.
            else:


          Inspecting a model

          Select one of the Terraced house and click on the Inspect Mode Icon at the top.

          Inspect mode.jpg

          Click on a part of the building and open up the Hierarchy View window (Window » Show Model Hierarchy). When you select a part of the building while in Inspect Model mode, a node in the Hierarchy window will highlight in blue. Double click on it and you will see which section in the rule file is linked to that particular part. Inspect the model, tie it back to what you have learnt and see if you understand it.

          CityEngine Geodesign

          Simple example: Wind turbines

          Placement of Wind turbines within the Geodesign process using CityEngine

          With this example, we will see use geodesign to place wind turbines in a designated zone with all the factors and influences involved.

          1. Navigate to data » Features and drag the “Texelsuitable_map.shp” file onto our scene and assign the rule PlaceWindTurbine.cga to the shape, then generate.
          2. Look at our Report tab to see how many turbines are placed. Use the “Rotater” to maximize the amount of turbines that can be placed.
          3. The area behind the dike is home to some rare species of birds. Wind Turbines makes noise and this can have negative effect on the birds, so the sound levels in the area must not be exceed 30dB. In the Inspector, turn on “showSphere” by setting it to true and set the ReceiverdB to 30. Now try sliding the “Rotater” so the effect on the bird area is minimal.

          Not only noise is an issue for the birds, but also the shadow flicker effect of the rotor blades is problematic. To do more in depth analysis on this issue, we can model it in ArcScene. To save you time, we’ve already went ahead and perform a simple shadow analysis and the results are in the file “Windmolen_Shadows.shp”. The date on which the analysis is perform is the 21st of June when the birds will have their young. Drag the file onto your scene, assign the rule “Shadow.cga” to the shapes. Set the rotator to 85 degrees to match the analysis.

          GeoDesign is Communication

          One of the most important aspect of geodesign process is the communication between different parties (Engineers, governmental bodies and the people). It is therefor extremely important that everyone is able to communicate with each on an easily accessible platform and where everyone understands each other. ESRI offers this platform in the form of a webscene by exporting your geometries. This webscene is a snapshot of your 3D scene, viewable in a web browser. This allows everyone (with or without CityEngine) to participate in the geodesign process in order to give their feedback and critiques for the proposed plans. Exporting a webscene can be quite intensive for your computer, so we have a example webscene exported and viewable here , you can also comment on it: Cocksdorp, Texel Webscene

          Running a Webscene is demanding and can slow down the performance of your system drastically.

          ESRI has more information regarding webscene in the following link: Tutorial 15: Publishing Web Scenes

          ESRI has released the SDK (Software Development Kit) for CityEngine since 2014 and this will allow for better integration of CityEngine techniques with other softwares. For more info visit the link below: http://video.esri.com/watch/3303/developing-with-the-cityengine-sdk


          Acknowledgement: The scripting course was originally developed by Geodan and VU University Amsterdam and transferred to TU Delft in Autumn 2014.

          Translated by @Hok in Summer 2015.
Personal tools
Actions
Navigation
Tools