The Snowflake Machine

by mathgrrl, published

The Snowflake Machine by mathgrrl Nov 27, 2015

Featured Thing!


The Snowflake Machine uses random numbers, mathematical algorithms, computer code, and SCIENCE to create well over a billion unique and beautiful snowflakes.

But all you have to do is click a button! Press "Open in Customizer" to get started.

If you 3D print a snowflake from this model, please take a photo of your print and then click the "I Made One" button to upload your picture, so we can all see it!

UPDATE: UrbanAtWork made a great video of the Snowflake Machine in action in OpenSCAD: https://www.youtube.com/watch?v=coWbcSe4t7M&feature=youtu.be

Don't have a printer, or want something fancy?
Custom snowflake earrings and ornaments made with the Snowflake Machine are now available at the geekhaus Shapeways store. Here are two examples:

iframe width="312" height="300" frameborder="0" allowfullscreen="allowfullscreen" src="//www.shapeways.com/fragments/product?spin=CMR527CAK"iframe width="312" height="300" frameborder="0" allowfullscreen="allowfullscreen" src="//www.shapeways.com/fragments/product?spin=HLKSFDSWH"


Twitter: twitter.com/mathgrrl
Hacktastic blog: www.mathgrrl.com/hacktastic
Shapeways geekhaus store: www.shapeways.com/shops/mathgrrl

This design and all associated pictures and files are licensed under the Creative Commons Attribution Non-Commercial Share Alike license. If you want to use designs, images, or files outside of the terms of this license, please email [email protected].

What can I make with the Snowflake Machine?

You can make snowflakes! Specifically, you can:

  • Quickly generate 3D-printable snowflakes using a random number seed
  • Use sliders to control the style and look of your snowflake in ten different ways
  • Create snowflake ornaments by selecting a hanging loop feature
  • Create giant snowflakes with lots of detailed design steps
  • Create micro-flakes, if you have an ultra-fine nozzle! (More on that soon...)

The demo snowflakes in the gallery are shown both alone and alongside books for size comparison. Each demo snowflake is available for download as an STL in the Downloads section, but it's more fun to make your own!

How to Operate the Snowflake Machine

Here's what to do:

  • Press "Open in Customizer"
  • Choose seed and style settings
  • Click "Create Thing"
  • Wait 2-3 minutes for the magic of creation to take place
  • Go to your list of Things and reload it until your new snowflake appears
  • Download, 3D print, enjoy, take a picture, post a Make
  • At this point there will still be over a billion more snowflakes to make, so keep going

How does the Snowflake Machine work?

The Snowflake Machine generates snowflakes with an algorithm that approximates the way that some kinds of snowflakes grow in real life.

Stellar plane crystal snowflakes start from a hexagonal prism seed and then grow outward with branches and plates whose size and positions are determined by the temperature and humidity of the atmosphere.

To mimic this process, the OpenSCAD code behind the Snowflake Machine generates sequences of random numbers based on a random seed that you select, and then grows a snowflake design by adding branches or plates in each step. The random number sequences and the style parameters whose values you select with the Customizer sliders act like the temperature and humidity of the air around the snowflake, making it more or less likely that different formations will be generated.

Tips and Tricks for Snowflake Design

Here is some advice for getting the most out of the Snowflake Machine:

  • Once you set a seed, you can change style sliders to alter the look and feel of the snowflake. Or you can change the seed again to generate more random snowflakes whose formation patterns are governed by your style slider settings.
  • If you like a particular seed, then write it down so you can come back to it later! Once you change the seed value your old seed will be lost forever, like a melted snowflake.
  • Mathematically perfect snowflakes (with "organic" set to zero) generate more quickly and also print faster. But snowflakes with a random/natural look (with larger "organic" parameter values) look more realistic and stylized.
  • Snowflakes with six steps and medium style settings will be approximately the size of the orange preview circle. You can go up to 11 steps, but the snowflakes usually look best when they have between 4 and 7 steps.
  • The best way to change the target size of your snowflake is to set the "target_diameter" parameter to your desired size. This will change the size of the orange target circle, and adjust lengths and widths accordingly in the algorithm.

It's worth keeping in mind that sometimes things look good on the screen but don't come out exactly how you expect when they are actually printed. If you keep track of your seed values, then you can iterate your design and make it better. Below is a photo that illustrates such an iteration, with the initial design on the left and the updated design on the right. Based on the outcome of the initial design, I turned down the "organic" and "fat" parameters and increased the "fuzzy" and "sharp" values to get a cleaner and more detailed design.

It's a little bit difficult to see snowflake details in the small Customizer window within Thingiverse. If you'd rather work with a larger, faster preview then you can download a free copy of OpenSCAD, get the snowflakerator.scad file from the Downloads section of this Thing, and then generate random snowflakes directly in OpenSCAD. To do this, you modify the parameters in the editor on the left-hand side, and then press "F5" to see the result. It looks like this:

About the Demo Files

If you want snowflake designs that have already been test-printed, try the demo models in the Download section:

  • The "micro_flake" models are about 15mm in diameter and 1mm thick. These are designed for printing with a smaller-diameter nozzle such as the .25mm nozzle that comes with the Ultimaker Olsson block.
  • The "tiny_flake" models are about 25mm in diameter, 2mm thick, and have loops for hanging as ornaments.
  • The "small_flake" models are about 50mm in diameter, 2mm thick, and have loops for hanging as ornaments.
  • The "medium_flake" models are about 100mm in diameter and 1mm thick.
  • The "large_flake" models are about 220mm in diameter, 1mm thick, and really huge! You'll need a large build platform to print these flakes, which were designed to max out the large build area on an Ultimaker 2.

More from Interactive Art

view more

File Name



All Apps

Customizer is the easiest way to take great 3D printable designs and make them your own. Make your OpenSCAD designs infinitely more valuable by empowering the community to customize them.

App Info Launch App
Customizer Thing App

Auto-magically prepare your 3D models for 3D printing. A cloud based 3D models Preparing and Healing solution for 3D Printing, MakePrintable provides features for model repairing, wall thickness...

App Info Launch App

Kiri:Moto is an integrated cloud-based slicer and tool-path generator for 3D Printing, CAM / CNC and Laser cutting. *** 3D printing mode provides model slicing and GCode output using built-in...

App Info Launch App
KiriMoto Thing App

With 3D Slash, you can edit 3d models like a stonecutter. A unique interface: as fun as a building game! The perfect tool for non-designers and children to create in 3D.

App Info Launch App


What a wonderful idea, thank you for taking the time to make this! I am having trouble running the OpenScad program - it keeps repeating a 162:syntax error at me whenever I try and compile a snowflake. edit After updating to the latest version of OpenScad the problem has disappeared - now churning out brilliant snowflakes for my friends.

Thank you for this. We made over 100 of these for my wife's workgroup. We used their employee number as the seed so each one was unique and tied to that person. Huge hit.

What is the units for the nozzle number under advanced settings? I set it to 1.75 assuming it's in millimeters but the preview snowflake looked much worse, almost as if the units are much bigger than millimeters.

where do i get it from after im done with it in the customizer

update nevermind i didnt know it took so long 15 MIN to create it

Great snowflake generator!!!

Is there a possibility to script incrementing seed, rendering and exporting each snowflake with the stl named with the seed number for a range of seeds? If so, where would I look for information on how to script that?

Reason is, the manager down the hall boasted that she got a Cricut last Christmas and will decorate their department with precise paper cut intricate snowflakes. So the competitive side of me says, oh yeah, well, I got a 3D printer... you see where this is going. So yeah, just checking if there is a way to script making a bunch of unique snowflake stl's.

haha, well I don't know how to write such a script, but you could download my OpenSCAD code and run it locally on your machine to export snowflakes more quickly, or to possibly incorporate into some sort of automated script. Just keep rendering over and over to get random seeds, then when you find one that you like, type in that seed and compile into a 3D file. Also if you wanted to, you could export the snowflakes from OpenSCAD as 2D .svg files that the Cricut might be able to use.

@mathgrrl This is very cool!

On the subject of scripting to generate a lot of snowflakes, I wrote something like this (https://www.thingiverse.com/thing:37525) which has a simple script that runs OpenSCAD passing in a new seed each time, so you can generate a pile of snowflakes programmatically, by passing in command line parameters. If you look at the 'blizzard' shell script, I think it'd be easy to adapt to run your snowflake script instead of mine. It's interesting comparing the algorithms! Your code is much cleaner! :-)

Blizzard of Unique Snowflakes
by laird

hey @laird that is the first time someone said my code was clean, haha. yours definitely gets the job done in fewer lines! it's interesting to compare the methods/algorithm. your shell script is interesting, i've never tried anything like that

Thank you. Yes I have been rendering them from OpenSCAD. Was just wondering about the scripting since everything looks programmatic. I'm 100% certain your snowflakes will outshine the other manager's paper cut snowflakes. Thanks again.

if you want a bunch of random ones just go to a diffrent seed export and go to another seed and export and so on

These are so good! Thank you for sharing

PS: Asimov is the best :D

What is the best print settings for a snowflake with a target size of 75. What about infill pattern?

This is brilliant. And now... Timely again! ;)

How about a snowflake cookie-cutter generator?
Maybe I'll try to edit the scad file to do that but I'm a pretty noob in openscad :)

hey matschi - i loved your cookie cutter idea and i just posted a customizer for making snowflake cookie cutters at http://www.thingiverse.com/thing:1912027. thank you for the idea!

Customizable Snowflake Cookie Cutters

Hey :) nice!!!
Definitely will print and bake some :) I've got pretty good experience with gingerbread-dough for detailed cookies(See my poop-emoji-cookies). Though dark snowflakes aren't very common I think I'll try them anyway.

I'll post a made one next time we make cookies. ;)

OK I am a total novice at this stuff. I was able to change the seeds in OpenScad. I keep getting a error statement when i want to export the file as an STL : "WARNING: Nothing to export! Try building first (press F6)". Can anyone tell me what I am doing wrong. I was hoping to have my students try this out for the coming school year, but if I can not get it to work they are out of luck.

Sure, I can help with this. When you press F5 in OpenSCAD you're just making a preview render, not a 3D object. When you're ready to export you first need to press F6 to build the 3D object. Then go to File/Export as STL to create and save a triangulated STL file that you can use in a 3D printer.

Laura (Mathgrrl),

I showed your post to my 10 year old daughter, who subsequently seeded, tweaked and printed 21 unique snowflakes to hang from the ceiling to decorate her 5th grade class for their Christmas party. It looked so cool. And then each of her classmates took home their own unique 3D printed snowflake. We had this cool talk about how you created an algorithm based on the science and math behind natural snowflakes which she shared with her teacher and her friends at school. Which then turned into investigation of all sorts of snowflakey things (who knew that some estimate 6.6x10^27 snowflakes fall on the planet each year according to http://www.cool-science.ca/article/3713 or that this guy grows his own in a lab at Caltech http://www.snowcrystals.com/)!!

So, thanks for the open door into all sorts of cool science and math for a curious 10 year old girl and some of her classmates.

You are awesome!

WOW, best use of Snowflake Machine ever!! Thank you! :) :)

I had the same problem over the last 2 days. I ended up downloading the scad file (at the bottom of her list) and using OpenSCAD to generate the stl file. Then I just printed the stl file. Works like a champ. I did one for each of my kids based on their birthdays. matchgrrl has it working great in OpenScad!.

Is it only me, or is the customizer broken ?
I can design and view the result, but when I click on create it takes 3-5 minutes in my queue and produces an error saying
"#<JSON::ParserError: A JSON text must at least contain two octets!>"

Comments deleted.

I woke up today wanting something like this and there it was in my email.

So rad, thank you!

These are really awesome makes a fun Christmas project for kids to paint and make ornaments.

Ok, I came, I customized, I printed one, I shared my make... now I have a feature request. :)

How about an option to add a tiny ring at the top of one of the branches? (For a piece of string or an ornament hook)

Just a thought.

Thanks for sharing your work.

Done! Now you can add a hook (and change its size in Advanced Settings, if you want to). Thanks for the suggestion (and the Make)!

You're so Rock Star. Thanks and thanks!

Comments deleted.

Very Nice - absolutely love it!!
However, a small suggestion for your openscad code. The thickness of the seed number text is not modified as you increase the thickness variable... so if in the .scad file I set the thickness to 2mm the seed number is obscured. Alternatively you could just translate the preview text up by (thickness - 1)
It's more of an issue when using openscad.

Also echo(labelString) would be better than echo(seed) - openscad will round a seed number i.e. 2.16296E6 but echoing the string gives "2162958"

Otherwise great job, having quite a bit of fun printing these out!

Picture of the issue

I see what you mean; thanks for catching that, shadow651. It should be fixed now, with seed number preview sized according to thickness so it is never obscured.

Thank you for sharing this with us!

This is so cool! Thanks for sharing

​Congratulations, your model iss one of the best 3D Printed Ornaments this year! Search "Top Free 3d Printed Ornaments Printing Ninja" in google to see (sorry thingiverse bans url addresses)

Thanks, Tysun27!

Thingiverse must be getting hammered with people trying this! ... it won't open in customizer for me, using Chrome and IE.

Comments deleted.

Awesome!!! Certainly a must print for the holiday.

Absolutely LOVE this!

I'm not much for customizers, but this is a beautiful example of a well planned, thought out, scad designer.
I'm will definitely post a few when I get the time in a few days!
Nice work!!

I see what you guys mean about tab layout vs scrolling, but I was commenting on the formulas to generate the effects. It's a cool idea. Most customezers create a name, or a screw pitch. I really like the customizer here, for it's use to create millions of abstract designs.

The multitude of variables really can produce so many varieties. Somehow I wish the random seed generator had a more obviouse transition effect. Like the first 100 billion seeds kinda made a more core heavy design, the next 200 billion seeds produced a mid ring heavy effect, the next 100 billion seeds created an outer ring heavy effect...

I can see how this is impossible, because of the randomizing effect would no longer be random! But it would hold consistent with the other variables in showing the change as you increase or decrease the seed number.

Ultimately this is by far the coolest customizer I've seen on thingiverse, for it's use of so numerous variables to create understandable abstract art.

Thanks Zeek_911 :)

Funny thing, I started with the randomizer kind of working in chunks that way, and with multiple random numbers, but then there were so many variables which I wanted to intertwine that I ended up reworking the code entirely.

Here's how it works: Starting from one random number, a sequence of random numbers is generated. The even-index entries in the sequence are modified to form a new sequence that is used to determine if each step is a branch or a plate, and the odd-index entries get scaled to make another sequence that is used to determine the lengths of the steps.

Everything else is set by the user in sliders to produce values that act as multipliers or threshold tests for those random values; so for example if the 3rd step is a branch that is 8mm long and the user pushes up the "long" slider then the 8mm will be multiplied by a little bit. And if the user pushes up the "branchy" slider then at each step the threshold for choosing branch over plate from the even-index sequence entries is a little more lenient - meaning that some plate steps could switch to branch steps. So random, but weighted. Finally, the original sequence of random numbers is used again to create a "wiggle" sequence for which the "organic" slider acts as a multiplier, and then those wiggles are sprinkled throughout the code to bump around the vertex positions and make things look more natural/wonky.

Ha, reading over that it sounds so easy now -- but it took me many iterations to figure out how to use just one random number to make a design with so much complexity while at the same time allowing the user to influence the style and form of the snowflake. Anyway thanks and happy snowflake making!

I think there is more to tweak there than you think. The new Customizer design sometimes makes it hard to see that you have to scroll down for more options. (This might not be the case for you but I know this is true on Macs running the latest OS that hides scroll bars when not actively scrolling.)


Yeah I really miss the tabs of the old Customizer design.

Awesome Thank you!!

(and I enjoyed the glimpses of your library)

99999999999999 is an option