File Exchange

image thumbnail

N-level 3D Koch snowflake

version 3.2 (112 KB) by Nicolas Douillet
A function to compute and display the -triangular based- 3D Koch snowflake at level N.


Updated 12 Feb 2020

View License

Please check the examples tab (doc) here on the right for a complete description.

Once downloaded, typewrite 'doc Koch_snowflake_3D' or 'help Koch_snowflake_3D' in Matlab console for support.

Cite As

Nicolas Douillet (2020). N-level 3D Koch snowflake (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Tip : from nb_iterations = 4, and if using write_ply.m you struggle with displaying the set out of Matlab [...] try to replace in the file header "uchar ushort" by "uint8 uint32" this should help ;-)

Koch_snowflake_3D is a function to compute a triangular based 3D Koch snowflake (fractal object) with some options (nb_iterations, display_option). Giving the resulting sets of vertices and triangles, it is almost 3D printing ready. You just need to write them in a .ply file for instance.

It is available for printing in my Sculpteo online shop :

- At iteration #3 :
- At iteration #4 :
- At iteration #5 :

You may also have a look at some additional images in my Flikr gallery :

A cubic based version is also available here :

/_!_\ Since the number of triangles increases very rapidly from an iteration of the fractal to the following, and unless your computer has very powerful computation abilities, memory, and a very strong graphic card, you should not set nb_iterations parameter value greater than ~ 5 if you want to display the result (main part of the CPU time of this algorithm : nb triangles loops on fill3 function)... or else, use your favourite mesh laboratory to display it ;-) /_!_\



Improved remove duplicated vertices function, updated description


New cover img ; decriptions comments... in comments


Remove duplicated vertices and triangles, + display tip in description, + new cover img


All in one file only, updated description.


Fixed Y rotation matrix bug, improved input parsing, updates help, doc, description.

MATLAB Release Compatibility
Created with R2019b
Compatible with any release
Platform Compatibility
Windows macOS Linux