Shan Huang

23 Jan 2014

Carnegie Castles by @yemount. CMU buildings just stopped being boring.


Out of a hundred awesome things about Game of Thrones TV series’ epic opening, I am the most impressed by the beautiful castle models made for Westeros’ cities. When searching for inspirations for the parametric object project, I came across this Winterfell model by damm301 and I instantly knew I wanted to build parametric medieval cities.

I’ve had the idea of reading building information from map engine APIs for a while, so I thought it would be fun if I could build castles off existing maps. In particular I was interested in transforming CMU buildings into something cooler and less predictable than their current circumstances. I attempted to use both Google Map Javascript API and Google Map Engine API but either of them allowed me to fetch raw map data like building/street geometries. After some painful search I finally arrived at OpenStreetMap, an awesome project that maintains editable maps of the world. There’s less guarantee on the quality of the maps as they are collaborative edited by the crowd, but I found it satisfactory enough, at least for neighborhoods of CMU.


I queried the CMU region and parsed the returned map data. Buildings and streets were exported to a file as polygons and vertices in openSCAD syntax. I had to copy and paste lots of stuff into my openSCAD file every time I regenerated my buildings, and as a result my openSCAD code looked shitty. But it got stuff done, so whatever…



Top-down view of my generated Carnegie castles. Hopefully you can identify some familiar buildings like Morewood and UC.


Castles in construction.




I’ve come to realize that openSCAD does not have a runtime environment and therefore does not have real variables. As a result, I had to paste raw data into the openSCAD file to make the thing compile, which makes the code lengthy and ugly. I don’t want to damage your eyes with my supper inelegant code, so I’ll provide the github link here instead of pasting code.