From the course: Grasshopper: Tips, Tricks, and Techniques
Unfolding from scratch, part 2
From the course: Grasshopper: Tips, Tricks, and Techniques
Unfolding from scratch, part 2
- [Narrator] I have my Exercise file open already. In the last video we started building out an unfolding tool that would take a poly-surface or mesh or just a set of points that represented an object and unfold them in a logical way based on the relationships between the faces. You can see here we're unfolding each of these faces but we have an example of one face, which needs multiple unfolds because the tree that connects this face back to the face that's staying flat, goes through face number three. This up here at the top is face number five, it's going through face number three so we need to apply the transformation to face number three, to face number five to get it to come all the way down to the origin. This is common unfolding and it's a really simple illustration of how every complex unfolding algorithm works where it builds a tree structure that links all of the faces within the shape back to whichever face is actually staying in its proper location, is at the plane that you're unfolding onto. So how do we do this? So we have, a rotation's happening right here and we have a list of transformations coming out. You can see in this Exercise file, I've added a couple things since the last video. First, a transformation index list and second, a twist that'll let us test out how this works if the geometry gets a little weird. So lets look at this transformation index. For each of these, there's just a single transformation. For face zero, we're just using transformation zero. For face one, we're using transformation one and only face five has multiple transformations. If this was more complex geometry, this transformation index list would be far more complicated. What we can do now, we'll go to sets, list item, we're going to plug in here and we're going to get the transformations and now we have our six transformation values. Actually we need to do one thing before we do this. Because these are now strings that have a comma in them, so we have multiple items per string, I need to go to sets, text, we need to break this text apart at that comma which will give us a data tree. This data tree, most of the branches will have one item but one of the branches, the branch for face number five will have two items. We can see that one item, then the first five branches and then on the sixth branch we have two items. Now we have two transformations for that last face. Now lets see what happens if I go to transform, transform geometry, and remember what I'm doing is I'm getting the transformations by index. I'll plug that in, I'm going to graph this so we can plug in, or before I do that I have to combine these so when we have multiple transformations I actually want to combine them into single transformations. I see I have an error, solution not set to an instance of an object. The reason is because I have a null value because one of the faces is not actually transforming at all. So there's my null, so how do we deal with this? This compound transformation component doesn't want to deal with a null so we don't want to pass the nulls in here either, basically what we want is a transformation that does nothing. We want this face to just sit here, it's not going to move. What we can do is replace this null value with a transformation, an identity transformation, meaning it's a transformation that does nothing it just preserves the identity of the object that it's operating on. So how do we create that? One easy way to do it is to go to transform, move and I'm going to set one vector, I'm going to set the vector to zero comma zero comma zero. This move component is not doing anything, it's not moving at all and here is the transformation that's coming out of it. So we're going to replace this null transformation with this transformation right here. If I go to sets, I want to first find that null component. So go to null item, this will give me a true value for null items and a false value for non-null items. Now I want to replace nulls, and actually I can simply skip this finding the null items and just replace them and now I have a list without any nulls. Now I have my rotations and then I have my move zero where I had the null value. I'm going to plug that in here, now I get one transformation for each item. That is a compound transformation and I'll plug that in here and I can actually flatten all of this so we get a cleaner list. I'm going to plug my faces in, now you see I'm unfolding the whole box all the way flat to the origin. It's a really simple logic. The key thing here is I have a poly surface with a list of faces, I'm looking at the index in the indices of each of those faces and it has a list of edges. I'm looking at the indices of each of those edges and then I'm building out lists of rotations. So an axis, a reference, and then this transformation indices that tells each face, okay here's how you unfold down to the origin. If I want to see this working with something that's a little more complicated, here I'm just twisting the original shape. You can see, it works the same so it's still just unfolding all of these things down based on that plane at the center at each of the faces. It doesn't care that the face is curvy or twisted which is another nice feature using this approach. Sometimes that's what you want, you don't want to unroll this thing completely flat. There is a limitation here, so if I were to replace this box with some other box that's generated another way. If I create a box by extruding cap it, so now I have a box but I created this box using a different sequence of steps. If I input this box, it's very likely that faces will not be in the same order. These indices listing the order of the faces and the order of the curves won't be the same in the logic breaks down. This process works great if you're creating the geometry programmatically and you know the order of the faces every single time. If you don't, then you need to actually figure out a way to build up that order in a logical way by checking the locations of faces against some reference point. That's the type of thing that a plug-in like Ivy does or it actually builds up that unfold tree for you using a bunch of different logical systems.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Leveraging NURBS: Sampling5m 20s
-
Leveraging NURBS: UVW space6m 13s
-
Leveraging NURBS: Reparameterization6m 23s
-
Leveraging NURBS: Solving on plane5m 41s
-
Leveraging NURBS: Curves as math functions5m 37s
-
Leveraging NURBS: One-degree surfaces5m
-
Leveraging NURBS: NURBS or meshes? Part 14m 41s
-
Leveraging NURBS: NURBS or meshes? Part 25m 21s
-
Leveraging NURBS: What is BREP?5m 15s
-
Leveraging NURBS: Alternatives to Boolean, part 18m 35s
-
Leveraging NURBS: Alternatives to Boolean, part 25m 57s
-
Leveraging NURBS: Alternatives to Boolean, Part 36m 33s
-
Leveraging NURBS: Extracting planes from curves6m 19s
-
Leveraging NURBS: Extracting planes from surfaces6m 39s
-
Understanding offset directionality6m 30s
-
Offsetting variable curves consistently5m 57s
-
Offsetting polygons7m 33s
-
Equal spacing along a curve for linkages7m 24s
-
Paneling tools and NURBS sampling5m 26s
-
Breaking down the paneling tools4m 3s
-
Buildable 3D paneling9m 11s
-
Understanding unrolling in Grasshopper3m 25s
-
Scripting your own unroller5m 27s
-
Unfolding from scratch, part 15m 8s
-
Unfolding from scratch, part 26m 31s
-
Why data trees?6m 20s
-
Intentional data trees8m 28s
-
Installing plugins5m 57s
-
Fabrication: Ivy fundamentals6m 49s
-
Fabrication: Ivy for a multiple parts4m 32s
-
Fabrication: Ivy for fabrication10m 13s
-
OpenNest6m 1s
-
Pancake4m 31s
-
Human: Setting data6m 54s
-
Human: Getting data7m 8s
-
Anemone: Basics4m 10s
-
Anemone: Convex hull4m 3s
-
Anenome: Custom convex6m 27s
-
Intralattice4m 9s
-
Metahopper5m 44s
-
Chromodoris6m 38s
-
Dealing with empty branches5m 14s
-
Data trees as lists4m 27s
-
Iteration instead of data trees4m 44s
-
Sorting inputs3m 52s
-
Sorted geometry to data tree7m 35s
-
Data trees and scripting6m 53s
-
Data trees as a master index and ID4m 21s
-
Vector intro6m 23s
-
Plane intro3m 59s
-
Vector math, part 15m 46s
-
Vector math, part 24m 16s
-
Operating in different cartesian systems5m 58s
-
Operating in twisted spaces, NURBS systems6m 44s
-
Installing Crow9m 21s
-
Setting up training data in Crow5m 43s
-
Prep the neural network in Crow5m 54s
-
Apply the network to classify face parts5m 57s
-
Using classification8m 22s
-
Installing Wallacei4m 15s
-
Setting up Wallacei4m 51s
-
Wallacei goals5m 48s
-
Wallacei goal tuning6m 31s
-
Wallacei output4m 37s
-
Weaverbird meshing5m 47s
-
Mesh+ and mesh editing4m 43s
-
NGon: Reciprocal4m 5s
-
NGon: Reciprocal 3D6m 35s
-
AXOLOTL: Conformal6m 1s
-
Opossum: Control5m 42s
-
AXOLOTL: Smooth branching6m 7s
-
FlexHopper: Particles4m 8s
-
FlexHopper: Particles clean6m 34s
-
FlexHopper: Particles agitate6m 34s
-
PhysX.GH: Stability4m 47s
-
PhysX.GH: Collision4m 3s
-
PhysX.GH: Catenary4m 35s
-
Heteroptera: Network tools4m 43s
-
Heteroptera landscape5m 24s
-
Why coding: C#5m 29s
-
Reading RhinoDoc3m 58s
-
Read object5m 40s
-
Write object6m 28s
-
Object types5m 44s
-
List inputs4m 53s
-
Data tree inputs5m 9s
-
Exporting geometry5m 18s
-
Reading CSV4m 28s
-
Reading settings5m 42s
-
Reading writing5m 23s
-
ScriptParasite4m 36s
-
Reduce mesh5m 38s
-
Unfolding/unrolling initial6m 23s
-
Unfolding/unrolling transform geometry4m 54s
-
Change surface degree6m 58s
-
Lowest possible degree (keep checking until it works)5m 10s
-
Fit surface4m 21s
-
Fit surface: Iterative to increase tolerance until it works4m 11s
-
Running a batch5m 48s
-
Advanced batch processing7m 1s
-
Understanding and reusing transformations5m 8s
-
Compounding and reversing transformations7m 20s
-
Zebra5m 11s
-
New in v7: Quad Remesh, part 16m 5s
-
New in v7: Quad Remesh, part 26m 1s
-
New in v7: Grasshopper Player, part 14m 50s
-
New in v7: Grasshopper Player, part 27m 5s
-
New in v7: Scripting, part 16m 46s
-
New in v7: Scripting, part 25m 25s
-
New in v7: SubD tools, part 17m 46s
-
New in v7: SubD tools, part 25m 19s
-
New in v7: SubD tools, part 34m 28s
-
New in v7: Drafting, part 15m 15s
-
New in v7: Drafting, part 26m 59s
-
New in v7: Drafting, part 38m 21s
-
New in v7: Drafting, part 44m 32s
-