Pattern Generation in Grasshopper
by s_paul in Workshop > 3D Printing
314 Views, 1 Favorites, 0 Comments
Pattern Generation in Grasshopper
The goal of this project is to create a grasshopper workflow for making a 3D-printable lattice design with holes at certain locations. This is for 3D printing on pre-stretched fabric to create wrinkles. I struggled to do this by calculating intersections with a generated grid, so I decided instead to draw 1 unit cell of my pattern, draw a cutting shape (circle), then use the array function to tile it. Then, I 3D printed one pattern.
Here is the grasshopper file I used in this example.
Supplies
Grasshopper/Rhino
Motivation
The motivation for this work is some previous work of mine. I 3D printed some cellular patterns onto pre-stretched jersey, which created these 3D forms when removed from the print-bed. The main drawback here is that I made these manually in Fusion360, which isn't always ideal and takes more processing time. I wanted to automate this process and make it more easy to modify quickly by writing a script in grasshopper. This is still in progress, and I've only done this with one pattern.
Draw Unit Cell
This step can be done outside of grasshopper, but my first pattern is a zigzag, so I programmed it in grasshopper so I could easily change the aspect ratio of my zigzag.
I will attach the entire script at the end, but here is the part of my code that generates one unit.
Cutting Holes
I used Rdif (region difference for this step). First, I generated the start and end points of each line segment using Endpoints (End) and used those points as the center of each circle. I selected the radius to be slightly larger than the offset distance so the shapes don't touch in the array.
Tiling for an Array and Extruding to Make a Solid Object
I used a rectangular array to start, and made a 10x10. Then, I capped it to make the object solid, and converted to a mesh. Then I Baked and exported the file into my slicer for a Print. Due to time constraints, I only Printed a 2x2 array, but pattern generation was the focus. You can also define an array along a curve, or a polar array.
Troubleshooting Notes
In the future, I would really like to make these holes using an intersection method. I'll post an update if I can get that working. I was able to calculate intersection points, but I wasn't able to trim the correct parts of the curve.
Here are some of the tutorials I tried (but did not get to work for my geometry):
- https://pedroazambujavarela.net/multiple-split-curves-or-shatter-all/
- https://www.youtube.com/watch?v=ICLLRissfLw&ab_channel=ParametricPhilosophy
- https://parametricbydesign.com/grasshopper/how-tos/split-curves/
Here are some of my in-progress scripts in GH.
Future Directions
I really want to translate some of my old patterns into this workflow, and use the intersection method to trim the holes. I tried doing this by calculating intersection points and using closed regions, but neither of these worked, even on only 1 unit. I know the best way is python, so I need to learn some python to continue this.