Parametric Snowflake Generator

by gringer, published

Parametric Snowflake Generator by gringer Dec 30, 2012

Thing Info

9522Views 6889Downloads Found in 2D Art
Report Thing


A computer model of a randomly-generated origami snowflake that should be similar to Wilson Bentley's observations.


Load up the OpenSCAD file (snowflake.scad), compile and render. If you don't like the look of the snowflake, recompile and try again. When you see something you like, look at the beginning of the compile output and it will have a seed number. Set this as the variable 'rs'.
Consider using openscad to generate files, rather than the pre-generated STL files, because it will make your snowflakes a bit more unique:
openscad snowflake.scad -o random_flake.stl
Snowflakes will be randomly generated based on a few customisable parameters. For a less dense snowflake (more skeletal), reduce the number of crystals (nc). For a more dense snowflake (more like a hexagon), increase the number of crystals. For more variation in crystals, increase the crystal max thickness (cmt). Other parameters are present, see the top of the file for more details.
I have tried to keep the placement of crystal seed start points fairly uniform across the flake (square root function to account for variable area across a triangle), and crystal angles are limited to 60 degrees (as seems to be the case from Wilson Bentley's pictures).
Additional notes:

More from 2D Art

view more

Thing Info

9522Views 6889Downloads Found in 2D Art
Report Thing

Liked By

View All

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag. Print Thing Tag

File Name



I've changed the models because too many people were making exactly the same snowflakes. These are meant to be unique, people!

I've updated the generating script to make random snowflakes by default and print out the seed value. You can do the usual openscad

openscad snowflake.scad -o random_flake.stl

or set rs for a specific flake:

openscad snowflake.scad -D rs=5984 -o flake_5984.stl

Of course, the generator can also be wrapped in a loop on a Linux command line to create multiple flakes:

for i in $(seq 1 200); do openscad snowflake.scad -D rs=${x} -o flake_${x}.stl; done


Very neat and timely utility. I'm going to play with this a bit and see if I can find some nice dxf's that will cut well on my laser for acrylic and wood ornaments.

Your Linux script is slightly off in that you use an 'i' to iterate over a range of numbers, but an 'x' for the file name iterator.

Using the below line, I was generating around 33 dxf files per minute on my stock i5-3570K computer running OpenSCAD 2013.02.28 on Ubuntu 12.04.

for i in $(seq 1 200); do openscad snowflake.scad -D rs=${i} -o flake_${i}.dxf; done

Thanks, I recall that I noticed this when testing it out, but forgot to update my comments (now done).

Sounds awesome. I've got a very dead PC at the moment but I'll try it out when I get back up and running. You expect a big speed increase? With the code I used yesterday, generating 1 flake took 1m32, 2 flakes took 3m (so linear)... but 8 flakes took 54m!

Timing depends on the flake that is generated, but you should see something like a 10x speed increase. OpenSCAD has trouble merging the shapes in 3D, but seems to manage fine in 2D.