1 / 7
Parametric OpenSCAD Koch snowflake generator — image 1
1 / 7

Parametric OpenSCAD Koch snowflake generator

Order a print of this model

We calculate the final price from your selected file. You review and accept it before payment.

Saved on this device.

OpenSCAD code to generate any size and any iteration level of Koch snowflake you desire (actually only using OpenSCAD)

Rating
0 / 5
Likes
7
Downloads
91
Makes
0
Views
436
Reviews
0

Updated at source:

Model information

Category
Math
License
GNU General Public License v3.0

I wanted to print a model of a Koch Snowflake but (at the time of creating this) the only model on Printables that claimed to be an OpenSCAD file to generate a Koch snowflake was actually a list of coordinates for a snowflake that was generated using a python script. This was fine and good but it lead me to challenge myself and implement the entire snowflake generation only using openSCAD. So that's what I did.

The code currently comes with two modules and five examples using these modules 

Modules:

  1. Snowflake(Starting_triangle,Iiteration_depth,Height)
    Creates a 3D Koch snowflake of a given thickness from a given equilateral starting triangle.
  2. Stepped_Snowflake(Starting_triangle,Iiteration_depth,Start_height,Color_seed) 
    Creates a 3D Koch Snowflake where each iteration is extruded to a different height.

Examples:

  1. Simple extruded snowflake
  2. Stepped snowflake
  3. Embossed snowflake
  4. Tile the plane
  5. Embossed stepped snowflake

Be careful when setting the iteration depth as the number of sides that needs to be calculated for each iteration grows as 3*4^(n-1). Reference rendering times (for preview rendering) on my MacBook Pro 2022 with all 5 examples enabled are:

  • n = 0:  0:00:00.031
  • n = 1:   0:00:00.036
  • n = 2:  0:00:00.044
  • n = 3:  0:00:00.084
  • n = 4:  0:00:00.214
  • n = 5:  0:00:00.756
  • n = 6:  0:00:02.973
  • n = 7:   0:00:12.514

Im always open for suggestions and feature requests and would be happy about any constructive feedback

 

Tags