#162: Python in Building and Architecture Transcript
00:00 Michael Kennedy: You often hear about architecture in software. This could be things like microservices, 3 tier apps or even the dreaded client server mainframe app, but in this episode we're turning this on its head. It's software in architecture in real world construction projects with Mark Menendez. This is Talk Python to Me, Episode 162, recorded April 23, 2018. Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the ecosystem and the personalities. This is your host Michael Kennedy. Follow me on Twitter where I'm @MKennedy. Keep up with the show and listen to past episodes at talkpython.fm and follow the show on Twitter via @talkpython. This episode is brought to you by Linode and ActiveState. Check out what they're offering during their segment. It really helps support the show. Mark, welcome to Talk Python.
01:02 Mark Mendez: Thanks Michael. Thanks for having me.
01:04 Michael Kennedy: Yeah, it's really great to have you here. I'm super excited to have this conversation with you and explore an area that I really haven't spent a lot of time in certainly in a software perspective anyway and the whole architecture and construction building area. Should be fun, right?
01:18 Mark Mendez: Yeah, definitely. Looking forward to it.
01:20 Michael Kennedy: Yeah, it'll be great. Of course, before we get to that though, let's start with your story. How did you get into programming in Python?
01:26 Mark Mendez: I have background of physics from Colorado School of Mines here in Golden, Colorado and I just had an intro computer science course where I was taught by the venerable professor there of introductions and he heavily pushed Python right off the bat to everybody and it was kind of from there that I took a few more computer science courses and things like that and followed down the path to doing a lot of programming.
01:52 Michael Kennedy: Yeah, that's really cool and the fact that you got to do it in Python is super nice. When I went to school it was, I had to plead to do stuff in C++. It was either you had to learn Fortran, it's the most important language you're ever going to learn or we think you should learn the foundations in a language that nobody knows, so it's confusing to everybody equally which was Lisp, and neither of those were really amazing choices. I never went on to use too much of them I guess. But I think C++ and Python would have been a lot better choice.
02:25 Mark Mendez: Yeah, definitely. So I had courses in both of those, so got a bit of statically typed things and got a bit of dynamically typed things, so it was good background.
02:35 Michael Kennedy: Yeah, yeah, really nice. So what are you up to now? What do you do day to day?
02:38 Mark Mendez: Yeah, so now I'm just supporting a lot of firms in architecture engineering and construction and that consists of a lot of authoring requests for proposals and things like that and trying to make sure that clients are otherwise provided for with respect to automation of workflows, more cutting edge solutions in the A&C industry as it relates to building buildings and how we can program to help that be done more efficiently.
03:09 Michael Kennedy: The company that you work for is basically a software consultancy for architecture building industry?
03:15 Mark Mendez: Yeah that's right. So I guess I should provide some context in that a bit. So I work for a firm called EvolveLAB. It's a building information management consulting firm. So anywhere where there's building information that's kind of what we're consulting about. Whether that's how people procure their building documents or how they draw buildings in three dimensional space, how do they manage all the data that's tied to all those elements and that will be general context in anything we consult in and that can also relate to things outside of the building such as like sight and so we'll do stuff with GIS and things like that and also related to efficacy or solar analysis, so which direction's the building facing in, things like that. It's kind of driven by two main things, which are like the building design and then kind of like the life cycle of the building. So it's like how do you manage all that data while building the building in electronic space to how do you design the best building possible such that you're not wasting a ton of energy after it's starting to operate in the field.
04:23 Michael Kennedy: I see, this is really cool. So working on like the LEED certified type buildings and stuff like that.
04:29 Mark Mendez: Yeah, definitely all through that life cycle.
04:31 Michael Kennedy: LEED I believe maybe is a U.S. thing? I don't know. Maybe tell everybody, this is people from other countries might have no idea what LEED is. Can you tell people what that is?
04:38 Mark Mendez: LEED might be international and I'm sure it's internationally known, but it's something where you can get an accreditation stamp onto your building on how energy efficient it is. So they have all these ranks of gold, highest is platinum, LEED platinum. There's all these certifications behind it to making sure everyone knows what is required to get these accreditations and things like that. So yeah to provide the context again, as a consultancy you're kind of saying the firm will come to you and say this is what they want to accomplish because this is what they would like if they were searching for the LEED accreditation of something in particular and then we would go about helping them get to that point without wasting too much manual hours just tweaking their building design and stuff to get that stuff figured out, it can all come up a lot more organically.
05:28 Michael Kennedy: That's cool. So you have to have maybe certain levels of efficiency for various energy retention or insulation or whatever. Do you run simulations to say here's how much we think how much energy this building's going to use, how much sun energy it's going to capture and how hot that will get or how warm it will keep it in the winter, things like that?
05:46 Mark Mendez: Yeah definitely. So there's like a whole bunch of different softwares and a lot of them will be like proprietary softwares that will allow you to Find all these metrics through this process of just taking the building information model that you created and passing it over into the software and having it analysis it. Then kind of what's new in the industry and where everything's going and the reason why we started talking about doing this show is that there's very much a push towards things called generative design or artificial intelligence in building information management where things can be possible now where you say let's make all these certain degrees of freedom. We'll say this building can gain five levels or it can rotate on this site, and this is what the site is. And then it's like how do you take those certain degrees of freedom and not only move them through all those degrees of freedom, but also start to analyze every single metric that can come from all of those different options. To tie it back to LEED, for one thing for instance is you'll have for LEED accreditation there could be something or you're this far away from like a light rail or something like that, and so then say your site has a bit more emphasis on it, but the main entry point of the building has to be so close to this light rail that if it's rotated and the main entrance is opposite where the light rail is, it'll be too far, then if you move it the other way, it'll be closer. That will be one of the weighting metrics where as it rotates you see, look at this we just lost a point or two on our accreditation, but maybe you gain it somewhere else. For somebody to go through and rotate their building or to manually draw things is just totally impossible so the industry is going through this now where we're starting to manipulate models on this more abstracted level and saying how do we generatively design these things such that a lot of these things are just taken out of the box, just based on whatever you want.
07:40 Michael Kennedy: That makes perfect sense, but I had never thought of machine learning and AI being applied to buildings, certainly not into building of buildings. I guess it makes a lot of sense though. There's so many things you're trying to optimize, there's so many different factors and, of course, it makes sense to just apply some kind of algorithm that can smartly answer what's the best way to arrange all these things, right?
08:06 Mark Mendez: To be very specific about this, it's like one thing that you can apply AI or machine learning to in building. So machine learning and AI, so machine learning we're going to have way bigger data sets in that this stuff which I think is going to be in the second part of what we're talking about here. So for artificial intelligence if you take something even something as simple as a star algorithm, it's like how can you use that? Like pathfinding algorithms and things like that. So you look above your head anywhere you are in a building there's ducts and there's all these supplies and stuff. There's air coming out of the ceiling. It's like the building is breathing, but there's also water in all this stuff being supplied to sinks and things. So it's like all these pipes and all these ducts and stuff are going through the ceiling. They're all flying around all over the place. So if you have a pathfinding algorithm and you have all of your ducts modeled already and you want to say hey I want to model this pipe and I want to start it here and I want it to end over here, well you can manually go through and you can rotate your model 50 times and look at say I got to go up a little bit over here and to get over this duct, because if it's clashing through it... To take a step back even, it's like buildings are being built before they're actually built in the real world now. Almost fully. That's every big general contractor is on it. The whole building to a T to within inches is completely modeled out on the computer before you're even in the field at all. So this is called clash detection. Anytime there's a pipe that clashing with a duct it alerts you and you said, okay well we have to move this pipe up or down so that it's not going to be in the way of the duct. So before you get out into the field you know that you have to order these extra pieces of pipe because you're elevating over this certain duct. So to bring AI back into it, you can have more like AI routines that are modeling out your pipe and making sure you can get most efficiently from one point to the next while avoiding all these certain obstacles.
10:02 Michael Kennedy: Right maybe like going down an entirely different wall and completely doing something different down at the bottom that like actually opens up something in the rest of the building that makes it way more efficient or something, right?
10:12 Mark Mendez: Yeah, and for humans to do it it's like so difficult. To model all of it it's just so time consuming.
10:19 Michael Kennedy: That's really fascinating. I can totally see how it all applies now. When I think of buildings being built I think of I do think of CAD software and stuff, but I just imagine draftsmen sort of sitting there just doing it, right? Nope, we got to move this here and draw that line there. Yeah, quite fascinating. So it's probably a good time to start talking about some of the Python code that you guys use. So maybe give us a quick flyover the type of software you're using for this.
10:48 Mark Mendez: There is a certain amount of it that's now being done on the web development side, so this is going to entail I don't know just some framework, like Flask or Django or something where we can quickly and easily set up databases and dashboards. Because as you start to develop all these models there's a lot of things where, say like for even one wall for instance, you have all of this insulation, you have the paint that's going to be applied, all this data and so all this data wants to be saved now back to a database. Originally it was just kind of dumped. At the end of every project you just save it, it's gone and then you move to your next project and really there's hysteresis about it all. There's no learning at all.
11:30 Michael Kennedy: People just come, they build a building, and if the owner approves and the city approves, who needs to keep track of what paint was used or what material was used here. Other than for the main structural bits, right?
11:42 Mark Mendez: Yeah, more or less. It's just like that.
11:44 Michael Kennedy: But now if it's in software you can just save it. It's easy.
11:47 Mark Mendez: Yes, and so it's about moving to the cloud now. It's doing all of these things that the software development industry has been doing, but now A&C is now catching up. So it's about building dashboards, building just ways of analyzing your data in the cloud to harness the power of cloud computing essentially and things like this. So the biggest firms we've sent out personally, like proposals and things or things such as building out big frameworks and making decisions on if you want to use Azure or something, or if you want to just have all of your own hardware, but essentially just providing value through building out a Flask app or mostly like somethings that's going to be more minimal that you'll be able to keep using and on one side, that's what the Python looks like. It's very much just web development kind of stuff, setting up all your database, doing all this stuff. Then on the other side, is more related to in process information management. So as you're building the building you have to do certain things. You have to create views in certain angles and things like that where people want to see, like all the people who are the building inspectors and whoever's giving you your permits. They want to see and make sure that you're doing all of your requirements for making sure, maybe you have like a handicapped stall in the bathroom or something. They want to make sure you have all this stuff. So on this side of it, the Python begins to look very different and in some ways it's very script like and then other ways it can be more like whole program. I think this is a good spot to kind of say like that recently there's been these things in the A&C industry that have led to the ability to grow and to gain computational designers or computational specialists, where they'll be using things like Python all the time. So there's visual programing languages and stuff where you can kind of drop nodes on the canvas, connect them together and do all this stuff. That's all well and good right off the bat, but you'll very quickly need to move to textual programming because they can't wrap everything for you for use in visual programming, you really got to harness that API yourself. So the Python there is in a couple different avenues and it's related to managing your building information. So it's going to be like rename all of these walls something or automatically tell me all of the room dimensions of all of the rooms that are in this whole entire building and print it out to a report. All these kinds of things, they'll give you very small... You'll develop these very small Python scripts where you'll be able to run them and they'll be able to do this stuff.
14:19 Michael Kennedy: That's cool. Like what is the surface area of all the interior walls or something like that possibly, right?
14:25 Mark Mendez: Yeah, yeah.
14:26 Michael Kennedy: Like how much paint do I need, right? Well, how many walls do you have?
14:29 Mark Mendez: Totally, they're called take offs. It's called a take off. It's just like the GCs going to get a model from the architect because the architect designs it and then he passes it over to the guys who are going to build it. Those guys who are going to build it are are like this is very real cost to us. If we can switch from to the next and save thousands of dollars and it barely changes anything, we want to know that. In order to find all of those surface areas of all those interior walls you can't go clicking on every single wall and see what the material is and the area and then write it down. People do that and that's the scary thing, is that people do manual take offs. That's what we're here for. We are like going to support that.
15:11 Michael Kennedy: Yeah, it reminds me of a company I worked for a long time ago that had a bunch of scientists working there. PhD, Masters type folks. They had a lot of these grad students that would come and do a bunch of manual things, really quite manual, and over time we would take some major thing that they were doing and we'd reimplement that in software and go, I know it took you a day, now you push the button and it's like 10 minutes or one minute, something like that, and you have your answer. They always said, if you do this again, you may be like programming us out of a job. But they just got more interesting jobs every single time. It was just like these sort of super tedious manual things you'll find a better use for your time if you don't have to do them, right?
15:55 Mark Mendez: Oh yeah.
15:56 Michael Kennedy: It kind of blows my mind that people will suffer through it though. They'll be like I can't really script Excel, so I'm just going to count these up, all 2,000 of them.
16:06 Mark Mendez: Yeah.
16:07 Michael Kennedy: Pretty interesting. All right so one of my first questions that I want to ask is how many gigabytes, suppose I have a 30 story building, standard office sort of thing, how many gigabytes is that? In like all of this data you're collecting and all the different things that's going on. Is it pretty huge?
16:24 Mark Mendez: Sometimes you have things like that where you have a 30 story building, and somethings the 30 story buildings are able to be compressed a lot better. So your file size isn't really that big. But you can almost have like I don't know, it's such a crazy question because there's like all of this data that you never really see in the background that if you actually harvest it--
16:44 Michael Kennedy: Like all this stuff that you really kind of could put together about it.
16:47 Mark Mendez: You could go into terabytes definitely. Because if someone models... Because one project we're working on, for instance, is a like a themepark in China so there's these crazy slides and mountains and stuff, and it's like if you store all that data, you're storing every vertex of the mountain, you're storing like everything. It can easily, but then, even like the interior wall example that we had earlier, you're storing the paint, but whatever. The paint is one small fraction of what is that wall. You're not even doing half of it. It can stretch from very, very small shops like one person firms can have a database of say 50 megabytes or something like that. Then you can have these big, big, big shops that are doing massive projects and there can be like campuses and things like that. So they'll have six or seven different buildings and they all linked together in a model and things like that and that can easily stretch to a terabyte or more. It just all depends on how much data you really want from it too. If it something where it's just geometry, it'll be like much less than that, but if you want all of the info it can be more.
17:56 Michael Kennedy: Pretty interesting. You talked about Azure and the cloud a little bit. So where are you storing this data? How do you store it? Is it in a relational database? Is it flat files, and blob storage, some combination?
18:09 Mark Mendez: Definitely a combination. Because with the blob storage you're going to definitely need it. Because a lot of times there's all sort of documentation that's held about the building outside of a single file or something like that. And this could be information related to warranty information for equipment that the building owners going to want like 10 years down the road or something like that. But then there could also be information that can be easily stored in a database, like if you're tracking... So if an architecture firm came to us and said we want to see what our users are clicking and picking when they're using the software. 'Cause if you have everyone using and all of their charts show that they're using all of the same keyboard shortcuts and stuff, and then you have one person who's always using some random one that no one else is ever using, then it's very easy to say well this guy's probably spending a lot of time fiddling around just being confused. So you can be like let's get him someone to go in there and train him. So there's data like that where it's very much can be tied to Postgres or something and you can just set up your user and some SQL database and it says user and there's these functions that you want to track and it just updates that database a bunch. So a bunch of everything, like you can do SQL databases and obviously there's a lot in terms of blob storage that you can need down the road.
19:33 Michael Kennedy: I can imagine. So that's some of it. The other part is the actual creation of the building. Like you talked about the computational stuff. People helping actually the design of the building right? Like these ML models and stuff. What's the story with that?
19:49 Mark Mendez: It is awfully related to this whole degrees of freedom that I was talking about earlier. How you can have just a couple of things that have just like a couple degrees of freedom and that quickly just compounds to something exponentially difficult for you to do manually at all. For instance, there is we did a project where it was a stadium kind of design and there's just like this facade or just exterior of the building that had all of these panels on them that had apertures. So if the aperture was greater, like a camera, it would let more sun in and if it was less, it would let less sun in. So you take like just this surface of the building and you can map like a heat map across it where the sun is in some part of the day. Then you know how all of those apertures need to be opened and closed such that you can still achieve this certain sunlight percentage that you want. So you can kind of visualize in your mind as the sun crosses the sky all of these apertures are going to shift. Some of them are going to open, some are going to close and it's going to happen across the building over the entire course of the day. So that's something where it's like the combinations are endless. You can never do it manually. But to talk directly more about the machine learning aspect of it, things have been done where you can take everything from this abstracted sense or if you think of like an electrical system of a building you have these big transformers outside of the building that really they receive all of the power and then they'll send the power to the building. So they get it straight from the utility plant and then that goes straight to the building. So you can think of everything just in terms of these trees or these hierarchies where it's like the first part of the tree is just the transformer and then that breaks off into these and that breaks of into this, and that breaks off in this. So every building has a tree behind it. Just some hierarchy of electrical systems. So now you can start to analyze these trees.
21:42 Michael Kennedy: Probably has that for water, it has that for ducts, it has that for all sorts of stuff, right?
21:47 Mark Mendez: Totally for everything. In architecture even there's stuff where it's like there is a level and then within that level, there are departments, and then within that department there are rooms, and then within those rooms there is something else, maybe like cubicles or something like that. So there's trees for everything. Trees are very well studied for mathematicians and stuff like that and computer scientists. We think that's really the gateway to harnessing fully machine learning or something, is how do you start to just develop these trees, study these trees and get useful results from them through a machine learning model.
22:23 Michael Kennedy: What machine learning frameworks you guys have in play?
22:26 Mark Mendez: As for ourselves we just mess around with scikit-learn quite a bit. But other than that, we're not really doing that much with it. But we have friendly competitors and things like that that are taking that research to the next level for sure.
22:38 Michael Kennedy: It sounds really fascinating. So I'm sure that in 10 years we'll see this in an entirely different place. This portion of Talk Python To Me is brought to you by Linode. Are you looking for bulletproof hosting that's fast, simple and incredibly affordable? Look passed that bookstore and check out Linode at talkpython.fm/linode. That's L-I-N-O-D-E. Plans start at just $5 a month for a dedicated server with a gig of RAM. We have 10 data centers across the globe, so no matter where you are, there's a data center near you. Whether you want to run your Python web app, host a private git server or file server, you'll get native SSD on all the machines, a newly upgraded 200 gigabyte network, 24/7 friendly support, even on holidays and a seven day month back guarantee. Do you need a little help with your infrastructure? They even offer professional services to help you get started with architecture, migrations and more. Get a dedicated server for free for the next four months. Just visit talkpython.fm/linode. One of the things that I want to touch on is maybe digging in to specifically some of the Python packages and stuff that you're using. But before I do, one of the questions I kind of wanted more broadly touch on is in certainly the other sort of data analysis, creational spaces, Python has been really moving on it in the last five years since 2010, 2012 and so on. Is that sort of the same in the industry here? Is Python kind of a relative newcomer or has it been around from almost the beginning of Python?
24:12 Mark Mendez: So originally AutoCAD, all this 2-D drafting where you're just drawing lines and stuff, a lot of the routines of where in Lisp. So everything was like done in Lisp. Very few people did it and things like that. As it transitioned to a new software and had new API calls and everything like that it was mainly C# then and so all of the C# was done like that and then lastly all of these C# API calls were just abstracted to Iron Python. So everyone was able to then just use Python instead of having to use C#. They don't have to worry about compiling, they don't have to worry about any of that. They can just write out these little scripts and quickly, quickly test then over and over again and make sure they were good.
24:56 Michael Kennedy: That's pretty interesting. So the primary extension API or whatever for the Autodesk tooling was in .NET and C#?
25:03 Mark Mendez: That's right.
25:04 Michael Kennedy: Then either Autodesk or someone outside it somehow integrated Iron Python into this mix and now that just sort of cracked it open for the Python space, huh?
25:14 Mark Mendez: Yeah, definitely and it's called, I mean the Autodesk software is called Revit, just in case anyone wants to know. And it's free for students, and there's the Revit Python shell. That's kind of like the first thing where you can get this little terminal and you can start to do little shell based things with Python.
25:32 Michael Kennedy: That's cool. Do you have like a GUI window up and as you type in it it is interacting with it? That type of thing?
25:37 Mark Mendez: Oh yeah, for sure. It's got all the cool stuff. Like autocomplete and all these things, and syntax highlighting and stuff like that. So now where it kind of is, is I use Visual Studio Code and I can just have that up and then I'll have Revit on the other side and I can edit my code and I just save it and I can run it. And I can just keep doing that over and over again in that kind of iterative way.
26:00 Michael Kennedy: Yeah that's pretty fascinating. I haven't seen a ton of uses of Iron Python, mostly 'cause I think a lot of the folks I talk to are doing web development stuff and at that level you're just kind of like, you're not really adapting some other massive application that's got an API, you're just writing from scratch or whatever. But that's cool. How do you find it works? Does it work pretty seamless for you?
26:19 Mark Mendez: Yeah, definitely. There's a couple things you wish were better supported, but it's kind of Iron Python stuff. So if you want to use NumPy, either it's really difficult or it's just not supported at all and things like that. You got to make sure you're working within the Iron Python ecosystem which is obviously a lot different than the Python ecosystem in some ways, especially how it integrates into these certain API calls.
26:45 Michael Kennedy: It sounds pretty interesting though. Have you looked at Python.net, which is a newer project that's sort of trying to achieve the same goals, but I think possible reverses the situation where Python is controlling .NET rather than Python embedded into .NET.
27:00 Mark Mendez: I haven't no. Thanks for the recommendation though. It sounds interesting.
27:03 Michael Kennedy: Yeah, I don't know if it works in terms of the integration, but it certainly is a pretty, it looks like a pretty interesting thing and I think it's sort of not a competitor, but sort of inspired by Iron Python not getting as much love as it could have. So that's pretty cool. All right so what are some of the other pieces of software there, that you're working with in terms of the Python ones. You have something, what was it called? pythonOCC. What does pythonOCC stand for? pythonOCC.
27:31 Mark Mendez: pythonOCC is a wrapper on top of geometry library. That's, I think, the easiest way to say it. So essentially within the building space you need lots of different ways of generating geometric objects. 'Cause at the end of the day, that's what buildings are. Just a whole bunch of geometric objects. So with pythonOCC, there is a good initiative set there for taking a lot of these open source building formats and so that will be things like... So that it's called like IFC, Interchanging File Format, something like that. Essentially pythonOCC what the initiative was was allowing people to easily take these traditionally proprietary models and to bring them into an open source space and pythonOCC gives you the ability to, a lot like 3JS or something, where you're going to be able to generate geometry objects within certain high level abstracted calls. pythonOCC is one and then Shapely is the other. These are kind of both packages where they're really bent on not only giving you the geometry primitives, but also giving you more high level access to selecting things and storing information onto them and things like that through different attribute API calls and stuff like that. So one thing with pythonOCC that was recently done, not by EvolveLab, but another firm, was a tower generator tool. So you were able to quickly generate all of these towers through a web dashboard. Kind of like what we were talking about earlier, but on a very, very basic level. So this stuff is all done through pythonOCC. If people want to get into the A&C space in a very Python driven way, this could be a very good entry point because it does already have some initiative in it that allows you to start working with building information models and to start harnessing that data through the Python ecosystem.
29:32 Michael Kennedy: Yeah, it's really cool. So you can create these 3-D meshes or 2-D splines or whatever, depending on Shapely or pythonOCC. One thing that's pretty interesting about pythonOCC is it'll look at what GUI platform is available and adapt to it. So it says if you use the GUI part, the library automatically detects whether QT via pyQT or wxPython or Python XLib are installed and it'll just render to the right one, which is pretty wild. That'd be written against three GUI platforms and just work.
30:09 Mark Mendez: It probably attributes a lot to like people that will really harness 3-D CAD from they're really not that strong of a technical background. Things like that, they probably had a big obstacle themselves when developing pythonOCC that required them to try to push something out to handle that for people.
30:26 Michael Kennedy: That's pretty cool. It's just a neat example of well you don't have to have this anymore because we already have that one. So another thing you talked about is this visual programming story. There's something called Grasshopper. What's the story with Grasshopper? What is that used for? What is it first?
30:41 Mark Mendez: Yes, so Grasshopper is a visual programming language. So similar to things like LabVIEW. You drop all these little nodes on the canvas and then you can tie them together with little strings and you say this is the way that the data flows. It always typically flows from left to right or something like that. So you can take this list and you can send it across and you can add to it, all these other things. All you do is you put down a list generator node and a plus node and it gives you that option. You don't need to know textural programming to do it. So for Grasshopper, Grasshopper is written on top of a 3-D modeling program called Rhino. What's cool about these programs is they're free for students and Rhino has a very generous trial thing to it. So everyone can kind of dig into it a little bit. But it's a visual programming environment that's very bent on computational design. So this is kind of a big thing now. It's like how do you start to computationally design these buildings. Where before like we said everything was a lot more manual, now it's a lot more driven by computation.
31:43 Michael Kennedy: Is that for like the surface of the building? I want it rounded like this or whatever. Or what kind of part would you be computing that you're talking about?
31:51 Mark Mendez: Definitely. So this is again, what I'm talking about where it says like computational design versus computational information management. So the design part is going to be like the exterior of the building, how it's all shaped and how it looks and all of this stuff. To achieve all these cool things, it's hard to rotate your camera in the modeling program to a certain angle and then like draw this line in this certain way and then everything's all like really weirdly bent, and so through computation you can kind of just drag a couple nodes on the canvas and say this is my start point, this is my end point, draw a spline through it or these are all the weighted points in the middle and draw a spline through it as best you can. And then now you have just these slider bars that you can just shift left and right and it moves your points back and forth and now your spline's kind of adapting in these cool ways to make a cool building design. Right.
32:41 Michael Kennedy: So that doesn't sound like there's any Python involved or any other textural program language, but they seem to have the Grasshopper Python enhancement. So what's the tie-in with Python to this.
32:52 Mark Mendez: They do have some textual programming. 'Cause again, these things are going to be really limited. They're not really limited, but essentially anytime you just want to drag and drop a node, there has to be someone making that node for you. There has to be someone that takes that API call or whatever it happens to be, and abstracting it for you. So that's where APIs is yourself. Some of it's with visual Basic actually and then some of it's with Python. So you can go ahead a drop a node on the canvas and this is your Python node, and you double-click it, or you otherwise open it and then now you just have this embedded editor, or IDE.
33:29 Michael Kennedy: I see, you just plug in a function somewhere visually and call this function a little block won't do it, huh?
33:35 Mark Mendez: Yeah at the end of the day it's still a little block, but if you double-click this block it can be like this massive program within it that gets a bunch of data and spits a bunch of data out. So that's going to be the Python plugin, or the Python enhancement.
33:48 Michael Kennedy: I see. So that's pretty interesting in that it can really empower people who are not really programmers, but maybe need just a little bit of logic, a little bit of something that is a little more than the app provides and you can do that in Python.
34:00 Mark Mendez: Yes, definitely.
34:01 Michael Kennedy: That's pretty cool. One of the things that I've been thinking about as you're going through this, you talked about energy so, how much does things like renewable energy, solar or wind energy, things like that factor in? Do you guys do modeling of that type of stuff as well?
34:16 Mark Mendez: We had a big project with a general contractor called Mortenson who's like number one solar in the world, or U.S. So they build these massive solar farms and they're like ridiculous. They can give power to the city of San Diego and things like that. They have just huge, huge solar farms and so this thing is so much different from say like solar panels on a roof. So the problem of how do you most efficiently fit solar panels on some certain roof is quite solved. It's already there. There's probably a website if you just goggle it. You can do it for your own house or something.
34:52 Michael Kennedy: Right, Google even has Project Sunroof, I think it's called, where you can put in your address and it will light up your house and show you how much efficiency you would get based on their own model.
35:02 Mark Mendez: Oh yeah. So definitely. So there's not a whole lot of Python going on in that space. There's not a whole lot of programming anymore, it's all kind of done. Obviously like I worked for a professor that did a lot in solar research and by no means is that whole field done at all. It's so nascent in a lot of ways. But for these massive, massive solar farms you can kind of think if you take just a small, small subsystem of it, a very small fraction and you just shift all of the solar panels one inch away from each other well all the wires that are connecting all those solar panels just got one inch further apart. So now it's like spread across this whole entire thing is you just put a thousand feet of wire added to your project because you shifted these one solar panels in this very small fraction, like a fraction of an inch. So something like that is like back to generative design and things like that where you need a computational way of solving this problem. You need to know how close should they be. There's just some ratio that's involved in stuff like that. So you can just shift them slightly and things like that. What you can do is there's something called SAM, the System Advisor Model. This is done by NREL. They just came out with a new release of it too which is pretty cool. They have a Python wrapper so you can essentially make all the SAM API calls which you give it the solar system, all the panels, however much panels you're using, all that stuff and latitude, longitude all that stuff, and SAM will give you back how much annual energy will be generated from that system. So now you're not only building out a framework for building all of these farms of solar and kind of shifting their metrics and figuring out how everything happens, but you're also tying it in to something that was developed by NREL, that's very, very systematic and will give you true results on solar analysis. To answer your question now, it's like yes, it's very much even beyond the building space into things like solar, into things like wind and stuff like that where you're pushing stuff out and if it's done computationally you can see so much more.
37:15 Michael Kennedy: That's cool. So almost like in the architecture of industrial things and plants and solar farms and what-not.
37:22 Mark Mendez: Yes, definitely.
37:23 Michael Kennedy: You talked about changing the wires. Do you know whether that would actually change the efficiency because the electricity goes through more wires and loses more energy? Or is more of a construction cost sort of thing?
37:34 Mark Mendez: Probably a bit of both. So definitely construction costs without a doubt. That was the metric that we kind of tuned to was like there was a certain amount of cost per foot, linear foot cost and stuff like that of the wire. That's directly tied to manual labor of setting that wire up and even purchasing the wire because you can buy the wire one day and copper costs you this much and you can buy the wire the next day and when you're buying so much of it, that small increase in the stock market or whatever of how much the copper costs for that wire is going to increase dramatically. You want to be able to type in a number of how much the wire costs today and that will also feed back into your system of what's the best things to do today and how that investment will look.
38:23 Michael Kennedy: Maybe in the future we'll have some sort of AIs predicting the price of the various construction materials over time and then suggesting the order in which we build it so you can like delay buying something for three weeks so it costs less, who knows.
38:39 Mark Mendez: Just do it dude. If you do it, we'll just tell everyone in the A&C industry. That'll be amazing.
38:46 Michael Kennedy: Sounds like a cool science project. People could do something fun with it if they really wanted. This portion of Talk Python To Me is brought to you by ActiveState. ActiveState gives you a faster way to build and secure opensource runtimes from your first line of code to production. Every second you spend building your Python distros or trying to secure your Python programs is less time spent doing the work you love. You've got better things to do than trying to resolve dependencies or making sure that you tick off all security boxes when you shift to production. Standardize on your Python bills so you have less friction in the development cycle and you can build our apps faster. You can also get a unique server side way to verify your Python applications at runtime. Baked security right into your code without impacting performance. Go faster, spend more time doing the work you love and comply with your enterprise security needs. Try ActiveState and see why it was chosen by IBM, Microsoft, NSA, Siemens, PepsiCo and more. Join millions of developers who trust ActiveState to build their open source language distros. Visit talkpython.fm/activestate for a special offer. That's talkpython.fm/activestate. So one thing that really seems like it could fit in to this space is not exactly what you guys are doing but you have some visibility into it I'm sure, is the Internet of things and smart devices and smart homes, smart buildings, are definitely sort of catching on in a lot of ways, but not entirely. I feel like in these larger construction projects there has to be awesome opportunities for Raspberry Pi and other fun little devices that people can build with. What do you think?
40:26 Mark Mendez: Oh yeah. Without a doubt. Internet of things is huge in the building space. It's just continuously growing. I feel like anyone who's interested in some Internet of thing space, like Raspberry Pi or Onion Omega or something, they should definitely contact us. Because you're right, it's not moving as fast as it could, but things like that and things like drones are huge for this space. If you're doing historical renovation or something like that you want to scan the whole building to make sure you have everything exactly the way it is in your model on the computer when you go to start your renovation drawings and things like that. It's huge definitely. Through drones, through micro controllers. All of it.
41:13 Michael Kennedy: Yeah, the little tiny $5 microchip things with Micro Python on it. Oh man, you can do some great stuff.
41:20 Mark Mendez: Yeah, definitely.
41:22 Michael Kennedy: I have lots of ideas for lots of different projects and stuff in lots of spaces. But I'm really fascinated with Internet of things, but I just cannot think of something that's not just a trinket toy thing for my house or for some other thing. They look really fun to build, but I don't know. It seems like there should be something really amazing, but I just can't think of something great to build that doesn't kind of already exist.
41:45 Mark Mendez: Yeah, well that last piece there is the hard one. What doesn't already exist. Everything exists a little bit, but not a lot of things exist through an enterprise level and through something that they're going to warranty this for an owner for 15 years or something. But if you can do something where you're just handling occupancy of a room, if you can smart turn off your lights right when you need to and smart turn them on right when you need to, you're going to save a ton of energy. I just googled Earth Day yesterday I think and if you go to that Google link, it's just going to tell you all about how much energy everybody's wasting. In your zip code is what they said. So it's very much something where even that you can handle that, but it goes even further. Even in a residential sense here's something that can be very useful for people. I was hesitating if I'm privy to share it, but I'm sure I am. So it's something where everyone in a lot of houses only have a single zone. So if you have a two story house, it's going to get a lot hotter upstairs during the winter than it is downstairs. The opposite will happen during the summer with the cold so it's very expensive to add another zone to your house. To say like okay well I want to be able to shut these off separately. So you can take like a micro controller and you can rotate your register, your diffuser and it can turn it off and that can be done so much more cheap. So if someone is able to do it on an enterprise level with a certain amount of warranty and certain amount of installation expertise and stuff like that then they'll very easily be able to move into every single home and save a ton of energy by doing this. Because right now if you want to multi zone your house it's going to be thousands of dollars. If you can do it with a micro controller very easily then you're going to save people like their money back for sure within the first year or something.
43:43 Michael Kennedy: That's cool. One of the things that I've seen that's sort of in that same scope is new vent covers that you can buy. So your heating vent or cooling vent in your house every one of those they basically have a little sensor on them. What's the temperature and then they can partially open and close to sort of even out the temperature of your house. So you talked about the upstairs being hotter or colder. It would dramatically shut the vents upstairs just automatically. You can say I want the whole house to be 72 or this room I want it colder, this one I want warmer. It can make that happen.
44:14 Mark Mendez: Oh man. That's exactly what I was talking about. Obviously like you said, it already exists.
44:19 Michael Kennedy: I know I feel like a lot of these are big clunky solutions and we're down to $5 pieces of hardware, free software you could do amazing things in 2018, compared to what people did five years ago. I don't know. I feel like there must, on the building scale, there must be even more connected devices going on there.
44:42 Mark Mendez: There are, for sure. It's something where this is why the reason why people from the development space are moving in to the A&C industry is because it is still pretty new.
44:55 Michael Kennedy: Do you think there's a lot of opportunity for really good software developers to come in and go here's 10 unsolved problems. I'm going to pick these two and go after them or something like that.
45:04 Mark Mendez: Definitely. 100% that is the case. Some of the problems I'd say, or things to solve, could be prototyped out like at a hackathon or something. Some of them are very large scale projects that require huge teams and stuff. For instance, a lot of the software is either proprietary or opensource and it's like this combating things. So that's one huge thing, it's called interoperability. It's like how do I take my model from this program to this program. Because right now, they'll just dump it. They call it the model drop chasm. For instance, this is one space if you come in and you're a very good software developer, you can just solve all these little micro problems and it can lead to this really huge solution. But there's plenty of other things as well revolving around big data, artificial intelligence and machine learning where people who are much, much smarter than me could come in and can see the possibilities if shown how everything is hierarchical or how it can be abstacted a bit for them, maybe they can transfer it over to a similar problem they had and solve that problem in a good way.
46:22 Michael Kennedy: Nice. All right so maybe the final thing we will have time to touch on is the future of the industry. So we've already touched quite a bit on machine learning and IoT type of stuff. Another area in at least standard factories is robotics. But I haven't seen too many robotics built in actually building. Maybe I just haven't paid attention. But is that also coming there?
46:45 Mark Mendez: For sure. You said it with the factories and stuff like that. Automotive industry is always what everybody points to and in our industry now is look what they did, look what we're doing. One thing in particular that's very much catching on and spreading fire right now is called modular construction. So it's just how do you pre-fab a building and you just push out all of these wall panels and when you get in the build, you just put them all up. I've some really good friend thats at University of Stuttgart Institute of Computational Design and he's showing me some of his research projects and they're just amazing. One of the things that he showed me was that there's like these robots that can climb and cross the walls and work together and they create these strands and stuff. We could put a link in the show notes. You can create these really wicked computational pieces in your building and things like that. But they also have robots that are like bricklaying robots. You can google that. They just throw a ton of bricks into the top and then out the bottom is just sheets of bricks being thrown down paving this road. If you can take one that just grabs that piece of wall that you pre-fabbed and it just picks it up and it just places it where it's supposed to go and then it goes to the next one and it places it where it's supposed to go. Everything is coming together--
48:02 Michael Kennedy: Or like glass. Like glass in an office building.
48:04 Mark Mendez: And it all takes off of this like quality control, quality assurance stuff. If you get a robot that just does it over and over you don't need to invest in the coffee that's going to keep everyone alert enough to catching everything. Robotics is coming. Robotics is very, very huge and the automotive industry paved the way. It's just on the doorstep of construction.
48:26 Michael Kennedy: I definitely see that. That's pretty awesome. I don't know it takes so long to build buildings and other construction projects now. It seems like they could get knocked out really quick. At least certain parts of what's happening to them.
48:39 Mark Mendez: Definitely. Like disruption.
48:42 Michael Kennedy: Yeah, something more or less. I'm thinking of, there's this creek that's not too far from my house that had to have a new bridge put over it. It was a two-lane bridge. You could probably jump across the creek if you got a good run at it. It's not a big creek. It took six to eight months to build it. I'm like does it really take eight months to build a building across like a 30 foot gap? Or a bridge across a 30 foot gap? When it's only like 10 feet down. It can't be that hard, really? Anyway, maybe robots will build a bridge. All right, final though maybe. We've definitely seen the migration of people from an agrarian society of farms and stuff into cities. I think at least in the U.S. like 2% of the population does farm work whereas it used to be way more. People are just packing tighter and tighter into cities. We need more interesting buildings to solve that problem don't we?
49:34 Mark Mendez: Definitely.
49:34 Michael Kennedy: I think there's got to be a lot of opportunity to build not just more buildings, but to build them better in a way that makes these larger more compact cities.
49:44 Mark Mendez: Yeah, I definitely agree. I spent some time in Hong Kong, and Hong Kong's thing is they just keep building higher and higher and higher and it's just how could that be better achieved. Who knows? Cities of the future. They have maybe different little pathways and stuff between buildings or something. You can harness the space above your head in a better way.
50:07 Michael Kennedy: You almost create like three dimensional sidewalks and instead of just walking the ground level you have these different layers which you can exist in, but sort of connect to the buildings.
50:17 Mark Mendez: Yeah, yeah, because now it's all wasted space above your head between the buildings. There's nothing going on there. Nobody flies there. It's all just wasted space right about you.
50:26 Michael Kennedy: Yeah, if we had flying cars it would be a different story. But we don't have flying cars so let's use that space for walking I guess, or biking. Nice. All right. Well that's a really interesting look instead the architectural building space. Thanks for that Mark. So let me hit you with the final two questions before we get out of here. If you're going to write some code, you already said VS Code is where you like to live?
50:50 Mark Mendez: Yeah, I love it there.
50:51 Michael Kennedy: And you use, of course, the Python plugin Microsoft now put out? Used to be by Don, but he started working for Microsoft.
50:59 Mark Mendez: I listened to an interview about him, all about it because it was really interesting. And I also use Coderunner which is an extension. It's an amazing extension.
51:07 Michael Kennedy: I don't know Coderunner, what's that?
51:09 Mark Mendez: Yeah, so it's called Coderunner, you should check it out. It just lets you run your script. It's with lots of different languages. I know it's for Ruby, Python, probably JavaScript, stuff like that too. You don't have to put the little shebang on the top of the script or anything like that. It's just all like intellisensed in a way. Then you can just easily run your code in. So you don't need to go to a terminal and type any like ./ or anything like that. It's just all Control + Alt N or something like that. So it just gets you off and running right away. So that's an extension I'd say to go a bit further to VS Code of what I'd recommend. And a linter..
51:49 Michael Kennedy: Pretty cool. Any then notable PyPI package?
51:52 Mark Mendez: I'd say pythonOCC for that one. Like I said earlier, it's the wrapper of a C++ package and it gives you the ability to start to harness geometry in certain spaces and so you can build little cubes and circles and pyramids and you can take that much further into splines and all different types of objects which is very important in the building industry to be able to 3-D model and to generatively 3-D model.
52:19 Michael Kennedy: Very, very cool. All right, so it sounds like there's a lot of opportunity for people who might listen to this show who are programmers who are at least technically minded to sort of break into the A&C space and do some pretty cool things on the ML space, IoT space, lots of different things huh?
52:36 Mark Mendez: I highly recommend it.
52:36 Michael Kennedy: Awesome. All right, thank you so much for being here. Everyone who's listening, if they're interested in this kind of stuff where do they get started do you think?
52:44 Mark Mendez: They're happy to reach out to us, but they can also go to Autodesk's website and there'll be tons of information there with respect to different software to choose from, if they're interested in doing all kinds of different things or tutorials, training videos, everything like that.
53:01 Michael Kennedy: All right, awesome. Well thanks for being on the show. It's good to chat with you.
53:03 Mark Mendez: Thanks Michael.
53:04 Michael Kennedy: Bye. This has been another episode of Talk Python To Me. Our guest has been Mark Menendez and this episode has been brought to you by Linode and ActiveState. Linode is bulletproof hosting for whatever you're building with Python. Get four months free at talkpython.fm/linode. That's L-I-N-O-D-E. ActiveState gives you a faster way to build and secure opensource runtimes. From your first line of code through to production. Check it out at talkpython.fm/activestate. Want to level up your Python? If you're just getting started, try my Python Jumpstart by Building 10 Apps, or our brand new 100 dDys of Code in Python. If you're interested in more than one course, be sure to check out the everything bundle. It's like a subscription that never expires. Be sure to subscribe to the show. Open your favorite podcatcher and search for Python. We should be right at the top. You can also find iTunes feed at /itunes, Google Play feed at /play, and direct RSS feed at /rss on talkpython.fm. This is your host Michael Kennedy. Thanks so much for listening. I really appreciate it. Now get out there and write some Python code.