 On the Internet, I'm Sailor H.G., and I recently made a switch from being a full-time developer to focusing on computer science education. I care a lot about the ways computer science is related to other subjects, and specifically the intersection of technology and art, and that's why today I'm going to talk to you about the mathematics of origami. In particular, the mathematics behind one of my favorite origami theorems. So a little bit of background. When I was in college studying CS, I had to take a class that fulfilled an advanced algorithm's requirement, and instead of taking the class called advanced algorithms, I opted to take a class called paper folding algorithms, which fulfilled the same requirement. And that meant we spent every day in the classroom proving and talking about different theorems about origami, and this one was my favorite. So it's called the fold and cut theorem, and it states that you can generate any polygonal shape from a single piece of paper with just one cut. Any polygonal shape and just one cut, and that's a really big claim, but it was proved by the professor who taught the class, along with Martin DeMaine of MIT, and professor Anna Lovive of the University of Waterloo. And now I'm going to demonstrate this on a piece of paper. So I'll show you the unfolded piece of paper is a swan. And if you fold it along these lines, you'll be able to cut out the swan with just a single cut. So this is actually a pretty old puzzle. The first reference to it is in a Japanese puzzle book in 1721, and it challenges the reader, can you cut out a shime, a lightning shape said to guard against evil spirits, from a single piece of paper with just one cut? And to iterate, to reiterate this theorem again in cartoon form, you can generate any polygonal shape from a piece of paper with a single cut. You might just need to fold the paper a lot of times before you make the cut. So then the question becomes, assuming that this is true, how and where do we fold the paper before we make the single cut to make this possible? And there are a couple ways of thinking about this conceptually. So we can think of it as we want to fold a piece of paper so that everything that's part of this cat is above a line and everything that's not cat is below the line. And then we cut at that line. Another way of thinking about it, we want to fold the piece of paper so that the outline of the cat, which is exactly what we want to cut, is all aligned on the same line. And this will turn out to be the way of thinking about it that will be helpful for coming up with an algorithm that will tell us the folds necessary before the one cut. So let's think of simple examples of how we can get lines to align up with each other on a piece of paper. For example, if you want the top and the side of a piece of paper to be aligned, you would fold at the 45-degree angle between them, and then you'd have the top and the side aligned. If you had two lines randomly drawn on a piece of paper and you wanted to align them, you'd fold somewhere in between them to line them up. And if you extended those lines until they met somewhere off of the piece of paper, you would see that specifically we're folding along the angle bisector of those two lines. Folding along the angle bisector is how we get lines to line up. So how do we generalize this for getting all the edges of a polygon to line up? For example, what happens if we have a complicated polygon and some of the angle bisectors intersect with one another? So we would calculate what mathematicians call a straight skeleton. And it is called a straight skeleton because when you calculate it, it ends up looking like it could be the actual skeletal support structure for that object. So how do you calculate it? You shrink the original shape while maintaining constant perpendicular distance from the original edges, and the path of the vertices as the shape shrinks is the straight skeleton. And you'll see so far that this path is consistent with our idea that the angle bisectors of a shape are an important component of calculating how to align the sides. And as you're shrinking the shape, you might encounter three types of edge cases. As you shrink a shape, it might get so small that it becomes a point. If this happens, you stop because once the shape is a point, it can't shrink anymore. And the simple skeleton is a path from the original vertices to that single point. And it's indicated in this figure in bold. Here's another edge case you might run into. Two edges might merge into a single edge, just like the top and bottom of this rectangle do. And what does this mean for calculating the straight skeleton? So you include that merged edge in the straight skeleton along with the path of the vertices to that merged edge. And again, it's shown in the bold lines here. Lastly, as you shrink a shape, you might find that it separates into two disjoint shapes, and that's totally fine. You just apply the algorithm to both shapes recursively. So after reading a lot of research papers, I found that most robust implementations of a simple skeleton solver were the subject of PhD theses. The kinds of things that people documented that they found difficult were input polygons with extreme concave sections, polygons with a spiral shape, and also floating point numbers. And while I didn't have time to write a PhD thesis for this talk, I did write a solver that can handle simpler input polygons like this ruby. So I used Shoes, a graphical ruby app kit, and the ruby geometry gem, which contained a lot of super helpful geometry functions. And I'll demo the Shoes app right now. But, see, I think this is draw shape. Okay. So we draw the ruby, and then when we push this button, it's going to shrink the ruby until it becomes a point and then draw the straight skeleton. Awesome. How do I get this off the screen? I can't see my mouth. So now that we have a skeleton, can we fold along it to cut out the ruby with a single cut? Almost. So it turns out the straight skeleton is most of, but not the full set of folds that we need to make to create a shape with a single cut. And why do we need more folds? Well, we need to get a little deeper into computational folding theory to answer this question. So here is a simple example of why the straight skeleton isn't fully sufficient for our purposes. This is a straight skeleton for a rectangle. What happens when we try to fold along the skeleton lines? If we tried to fold along those lines, we would see that they just don't fold into a flat shape, and we need the piece of paper to be flat before we can make our single cut. And I'll demonstrate with a piece of paper right now to show how you just can't fold this flat. Okay. So here's a piece of paper. You just like, when you try to fold along these lines, it won't fold flat. So the problem is not all sets of edges fold flat, and foldability is a whole other area in the field of computational origami, formalizing which sets of edges will fold flat, which can't fold flat, and which might be even impossible to fold. So a set of edges that we're looking for, ones that can be folded flat, are called flat foldable. For this particular shape, we would be able to fold it flat if we added perpendicular helper folder lines that extend from the inner skeleton to the edges of the rectangle. And I'll demonstrate how if we have these two additional lines, we can flat fold the rectangle. So now that we have these two lines, we can fold it flat. So how do we generalize? How do we add a few folds for the general case in order to make any straight skeleton flat foldable? First of all, we can establish that any helper folds must meet the shape edge at 90 degrees because then they're guaranteed not to interfere with a way that the edges of the shape are already lined up in a single line. So we draw perpendiculars from every vertex of the straight skeleton to the edges of the shape, and it turns out that we won't need all of them, but none of them will hurt foldability or affect one cut ability. So here's what we get if we draw perpendiculars from every straight skeleton vertex in the ruby that we generated earlier. So now for a live demo of cutting the ruby. So here is the ruby. We fold it on the simple skeleton lines and some of the perpendicular helper lines. So this project is super exciting to me because there are still plenty of ways to take it further. For example, I'd love to add in a perpendicular... I'd love to add in the perpendiculars to the ruby shoes app and on top of that to assign mountain valley foldability. Yet another part of foldability theory is you can systematically figure out whether folds go in, valley folds, or whether folds go outward, mountain folds. And also to read more feces so I can implement a program that handles more edge case shapes. So thank you so much for listening. Come find me during the break if you'd like to talk about origami or the intersection of coding and art or computer science education or if you just want some stickers. So the question is whether the shoes app is online or not. So I want to clean it up a little bit more before I put it online, but I do want to get it up. It is definitely possible. People who are super serious about origami start using thinner and thinner paper. Sorry, do I need to repeat the question? So the question was because paper has a thickness, you eventually need to fold the paper so many times that it's impossible to fold anymore. Like is it possible to generate a folding that will be physically impossible? And the answer is yes. And a lot of people who do serious complex origami even use thinner paper than just like printer paper in order to be able to make their models physically possible. So I guess one approach to that would just be using thinner and thinner paper and then eventually you wouldn't be able to. So the question is whether these algorithms are applicable to other fields. So some examples that the professor gave us, so I think that the professor mostly gave this class because he really loves origami, but he also had to justify being like, well, you can use these in real life too. So some examples that he gave us are like in satellites or space exploration robots. This can be a way that you can get the solar panels to fold up really small. You can unfold them. Well, that's like for an application of paper folding theory in general, not the one cut theorem specifically. Okay. Thanks, everyone. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you.