Skip to main content
  1. Posts/

Interactive Koch Snowflake

·263 words·2 mins· 0 · 0 · ·
zelda
python geometry
Author
Zelda
Game Developer & Artifical Intelligence Engineer
Table of Contents
COSC326 - This article is part of a series.
Part 3: This Article

Description

This is a project for Etude 03 - Koch Snowflake Interactive at the University of Otago COSC 326. I have implemented an application that can draw a Koch snowflake with any given order.

You can scale the snowflake, drag it around, and change the order of the snowflake.

How to run

# clone project
git clone https://altitude.otago.ac.nz/rqian/cosc326-interactive-koch-snowflake.git
cd cosc326-koch-snowflake-interactive

Run after Installation

Run the program by installing the package and running the snowflake command.

# install
pip install .  
# you can also use 'pip install -e .' to install in development mode

Now you can run the program by typing snowflake in the terminal.

snowflake
Get CommandNotFoundException? see Python Scripts path for help.

Feel free to uninstall the package after you are done.

pip uninstall ruiyi-koch-snowflake

Run without Installation

You can also run the program without installing the package.

# make sure you are in the project directory
python main.py          # or python main.py --latest
python main.py --dev-0  # this will run the development version
python main.py --dev-1  # this will run the development version

How to use

  1. Left click and drag to move the snowflake

  2. Right click and drag to scale the snowflake

    • drag right to scale up
    • drag left to scale down

  3. Use the + and - button to change the order of the snowflake

  4. Use the Reset Button to reset the snowflake

  5. Drag the slider to change the resolution of the snowflake

  6. Use the Online Render checkbox to render the snowflake online

Reference



COSC326 - This article is part of a series.
Part 3: This Article