Tuesday, December 3, 2013

Revit meets Procedural: Best of both Worlds

Often the buildings of new/re-developments are designed by architects which designs the buildings in a specialized software type. An example of this is the use of Autodesk's Revit software. Creating one detailed building can be a time-consuming process. Imagine modeling an entire neighborhood! This post looks at how CityEngine can streamline this process for an entire new development.

In the example developers created 4 individual housing building types (55 sqm ; 65 sqm; 85 sqm and 110 sqm) in Revit.

Revit models

The objective was to randomly place one of these 4 models at each residential lot of a new development area. In order to place these models on a lot using CityEngine's procedural rules, the models had to be exported to a .obj file format, which can be easily utilized by CityEngine.

The Revit models were however only created for the residential lots, while the generic buildings for the commercial lots had to be created procedurally. Therefor the first action that the rule does is test to see whether the Zone attribute of the feature is either Residential; Commercial or something else. As seen in the Lot Start Rule below:

Lot--> case Zone == "Residential": 
SplitErf
case Zone == "Commercial":
CommBuild
else: NIL

For residential buildings, a setback area of 6.5m were created and colored dark green, while the remainder was used to place the .obj models. The models were then Scaled, Centered, Colored and Placed...

SplitErf-->     setback(6.5){ all: t(0,-0.2, 0) DarkGreen| remainder: Building }
Building-->    s(10,5,10) i(BuildingModel)t(0,-1, 0)  center(xz) LightGrey

Residential areas














The commercial buildings had no Revit models and had to be generated procedurally. The first step (similar to the residential buildings) was to create a "Building footprint" from the existing feature using the setback tool. The outside area of the feature was colored Beige while the remainder was extruded to the randomly selected building height. The extruded buildings were then divided into a top part (Roof); a front side (entrance) and the remaining sides. The building block was then split vertically and horizontally to create building tiles. These building tiles each represented a window, which were made transparent.

Commercial Building

For the front side of the building an entrance roof overhang was created (the ground floor of the entrance was also colored differently than the other sides.

Because the Commercial buildings weren't the focus point of the scene, a generic "Commercial-appearance" rule could be applied to all the features. It only needed to indicate where commercial areas were located (not a lot of detail necessary).

Additional features were added such as Static Buildings ( for example Religious buildings, a Hospital, Clinics; a School; and Sport Stadium) as well as the surrounding area elevation and imagery which contributes to a better understanding of the area.

Hospital


Stadium and Clinic

The CGA rule file that was created, generated Residential and Commercial buildings in completely different ways. 3D building geometries were generated  using existing Revit models for multiple features at the same time or (in the case where there were no existing models) used the procedural CGA functionality to create new buildings. The end result is a 3D scene that moves uninterrupted between different software types.

School (SketchUp)





Wednesday, November 6, 2013

Bubbles and Towers

This week I played around with the idea of using CityEngine to view the coverage areas produced by cellphone towers in 3D. This is just a quick example to see what it would look like.

As always, getting your hands on data was quite an exercise. I eventually found a spreadsheet with the locations and types of towers points in the study area. Unfortunately the towers point data didn't have any ranges associated with them. After consulting a reliable source (Wikepedia) I very carefully estimated (guessed) the range of each tower. This is the point where I probably have to mention that this example was done purely for research purposes and that none of the ranges are correct....as far as I know.

The points were plotted from an Excel spreadsheet in ArcMap and converted to a point feature class. The feature class points were interpolated to accept the z-value of an elevation raster of the area. Next I added a Range field to specify the maximum range of each tower according to its type. The ranges varied between 100 - 800 meters.

Range Bubbles


I used the ranges as the buffer field for the 3D Buffer tool in ArcScene to create multipatch bubbles of the maximum ranges for each tower. The range bubbles were imported into CityEngine and a rule file was used to set their colors and transparencies.



Towers

The points were converted to the different tower models according to type in CityEngine. The tower models were downloaded from Trimble 3D Warehouse.

Tower 1
Tower 2


Tower 3




Tower 4
A CGA rule was created to generate the models and exaggerate the size for better visibility. The rule uses the i (geometry) asset tool to plot the appropriate tower model and then re-scales it using the s(x,y,z) tool.

The Code:

attr Structure_Type = "Rooftop"


Lot--> case Structure_Type == "Rooftop":
Antenna
case Structure_Type == "Camouflage":
Camouflage 
case Structure_Type == "Monopole":
Monopole
case Structure_Type == "Lattice":
Lattice
else: Camouflage


Antenna--> s(6,6,6) i("models/3DWAREHOUSE/Antenna.dae")

Camouflage --> s(20, 200, 20)i("models/3DWAREHOUSE/CellTower.dae")

Monopole --> s(50, 100, 50)i("models/3DWAREHOUSE/Monopole.dae")

Lattice --> s(30, 200, 30)i("models/3DWAREHOUSE/Tower3.dae")


The rooftop type towers are located above the ground on top of buildings. Some building footprints were added to show this. CGA rules were also created to set the color and transparency of the buildings and range "bubbles" as well as extrude the building to their correct heights.




Areas with a lack of coverage were identified. Additional towers were added and their coverage were calculated. These additional coverage areas are displayed in the web scene as yellow bubbles. Finally IFRAME attributes were created for all towers, displaying a picture when a tower is identified.

Final web scene


View the web scene here (Note: It is about 48MB)



Monday, October 28, 2013

Serving a large 3D City Basemap

Urban data normally arrive from different sources. The challenge is to put them together in order to create an accurate representation of the city.

In the case study that I have been working on the challenge was to share a 3D representation of an entire city among users.

I have done a number of projects with CityEngine and considered using the 3D webscenes for this, however I found a couple of limitations:
  • CityEngine uses Python scripting to import cities with a diameter of about 13km. The city in this case study has a diameter of more than 40km.
  • The final compressed webscene (.3ws) has to be downloaded before being viewed. Best practice limits this file to 30 MB
I eventually (after a lot of research and blog reading) decided to try and host my 3D Basemap on ArcGIS Server as a Globe Service

The Workflow:

The data consisted of 3 types of building features:

  1. Photo-realistic multipatch features of buildings

  2. Digitized 2D building footprints

  3. 2D cadastral properties

Step 1: Converting the .3ds building files to multipatches is a whole blog post on its own. I will explain this in a bit more detail later. (Hint: The Import 3D files tool + Blood Sweat and Tears). As the focus of this blog is hosting a city on ArcGIS for Server, just know that the textured buildings were finally converted to multipatch features. It is also importatnt to know that the Buildings were set to their correct z-values during the conversion process. 

Step 2: The 2D Building footprints were provided with the correct z-values through the Interpolate Shape tool. The footprints were then extruded to their height attributes in ArcScene and converted to multipatches by using the  Layer 3D to Feature Class tool. 

Step3: At this point the remaining areas of the city had still had to be represented by building footprints. Due to the lack of data, generic "fictional" footprints had to be generated in order to flood the rest of the urban area.

To generate these footprints I used CityEngine. The 2D cadastral data first had to be divided into 7 regions (due to the fact that the total area of the city is too large for CE).

The properties contained attributes describing its zoning characteristics as well as restrictions. Using these attributes as  guide lines for building shapes (L-shape, O-shape and U-shape) and heights, buildings could be generated procedurally in CityEngine. The procedural rule was based (and borrowed from) on the rules found in Tutorial 8: Mass Modeling at the CityEngine Resource Center.

The result was 7 regions of procedurally generated  (fictional) buildings ( +800 000). 




The buildings were then combined before merging with the "real" digitized building footprints.

Green = Digitized footprints      Red = Procedural footprints    Pink = Photo-Realistic buildings
Step 4:  The final step was to add each of the multipatches (textured as well as extruded footprints) to ArcGlobe. I decided to create 2 globe service. The first one would show the Textured buildings and the second one would be the footprints.

Publishing a globe service was much easier than I anticipated. Once the multipatches are added to ArcGlobe simply remove all elevation and image layers (the standard ArcGlobe layers); click on File > Share As... > Service... Next fill in the relevant information in the Service Editor > Analyze and Publish your globe service.

Once the Service Publishing Result has popped up, you can open a new ArcGlobe and access the data straight from your ArcGIS Server.




The final result is two Globe services which is hosted locally and can be shared to other users, thereby creating a online 3D Basemap of the City.

City globe services

Monday, October 14, 2013

Welcome to Cape Town

I went to Cape Town last week to do some CityEngine demonstrations. So I decided that the best way to show the abilities of CityEngine is to create a quick WebScene of Table Mountain and its surroundings...

I started by importing (dragging and dropping really) a TIFF image for the Cape Town CBD area into the scene. I used a standard JPEG aerial image as the Layer texture.

  
To start with, I had some building footprint data, but not a lot. Luckily I had the entire set op parcel properties for the area. I decided to use the real building footprints where possible and fill in the rest by creating procedural buildings from the properties layer.

The building footprints did not have a height attribute, instead it had a Floor Level (FLR_LVL) attribute. I proceeded to create a procedural rule which assigns a Height attribute based on the Floor Level attribute. If a feature had 0 as a value for floor level, the rule assigns a random value between 2.1 meters and 2.4 meters to Height. If the feature has a valid floor level value, the floor level is multiplied by a random value between 2.1 and 2,4 meters and assigned to Height.

Finally the rule extrudes the feature according to Height and colors the building light grey.



The next phase was to flood the existing open spaces with  procedural buildings.
The first step of this phase was to create an offset distance for the each building from the street. The offset was set to between 5% and 25% of the property's longest side.


Two additional attributes are defined, namely Minimum_Height (5) and Maximum_Height (50). The maximum height had to be reduced from 130 meters to 50 meters after my love of skyscrapers created a city skyline resembling a pincushion... 

The property features are then divided equally and assigned a shape and finally extruded to a random value between the minimum and maximum heights.
25 % of the features generated a U - Shaped building;
25% generated O-Shaped buildings
25% generated L-Shaped buildings
and the remaining 25% kept the original feature's
shape.



 The second to last step was to add the additional city-features such as Parks, Rivers, Railway and the Ocean. The water features were given the '__water' suffix to create realistic water textures when exported to a web scene.

The final part of the scene was to add a Sketch Up model of Cape Town stadium.



The outcome was a simple representation of the city without spending too much time on building generation. By coloring the buildings grey (instead of detailed textures), the differences between built-up areas and vegetation in the city becomes clear.



 

      

Wednesday, September 18, 2013

Where to start...

After following 3D blogs such as GeoPlanit and Synthicity for a while and knowing how much it has helped me, I decided to try and put my own 3D thoughts to paper...sort of.   

So that brings me to the title of this post: Where to start?

After some consideration, I decided that the best place to start is at my latest 3D adventure in CityEngine. I've been playing around a lot with ESRI's CityEngine software for a while now. In terms of projects, the opportunities to use CityEngine has been limited so far at work. But I am a firm believer that 3D is the way to go in terms of understanding and displaying data in the future! I also believe that the best way to learn about something is to play around with it and experiment for yourself...

My latest adventure with CityEngine consisted of creating a web scene that displays world landmarks with rich attributes.

This was one of very few CityEngine projects I've worked on where Procedural rules were not used at all! The model consisted entirely of Trimble 3D models. I downloaded famous world landmarks such as the London Eye, the Eiffel Tower and the Statue of Liberty. I also downloaded a model of the Earth, which served as a "3D-Basemap".

Paris
New York
London

Open each model with SketchUp and export it to a Collada (.dae) file somewhere in the CityEngine project (preferably the Asset folder). In CityEngine simply drag the Collada file into the scene. Then use the "Move Tool" to correctly align the models.

The landmarks also included The Great Pyramid of Giza; the Bruj KhalifaChrist the Redeemer statue; Tokyo Tower; and the Sydney Harbour. Lastly I included two South African landmarks (probably due to some patriotic bias) namely the Green Point stadium in Cape Town and the Hillbrow Tower in Johannesburg.

The initial idea was to create an image attribute for each of the landmarks; thereby displaying a picture when clicked in the final web scene. This can be achieved quite easily.
While a feature is selected, open the Inspector window to view its attributes. Right-click on one of the attributes and choose Add Object Attribute to create a new attribute.


 When the "Create Attribute" window appears, choose a name and make sure that the Type is set to string (STR). After the attribute has been created, populate it with an i-frame. For example:

<iframe height="405" width= "600" src="http://i.telegraph.co.uk/multimedia/archive/02423/london_2423609b.jpg" ></iframe>

This example below displays the iframe above:

I created image attributes for each landmark.

I was surprised at how easy it was to add iframe attributes, and not being from a programming background I started to wonder what else I could stuff into an iframe...

I then started adding still webcam images for Cape Town, Johannesburg and Paris. So when you click on one of these landmarks, a live webcam image will be displayed. Such as the example below (note the date stamp):


As it goes with these type of  "experiments", after you succeed with one thing; you keep on trying to add more and more. So it came to be that my mind started to wonder towards live video streaming. After a quick web search I found two sites (LIVESTREAM and USTREAM) that actually provide embedded URLs for live video streaming.

Using these sites, I created additional iframes for London, New York, Rio, Tokyo and Sydney. When one of these landmarks is selected in the web scene, a live video of that city appears in the attributes tab.


You can view the full web scene here.