#+OPTIONS: toc:nil * PQ Torus Knot ** About [[https://ferano.io/pqtk/][Live Link]] This is an implementation of the [[https://en.wikipedia.org/wiki/Torus_knot][PQ Torus Knot]] in the Elm programming language using WebGL. I worked on this project for a few weeks in 2019. However, it was just thrown into a git repo without much consideration, along with [[https://git.ferano.io/JosephFerano/fp-rendering-engine][this]] project. I felt this deserved a little bit more TLC, so I decided to spruce it up a little bit and move it to its own repository. Here's the [[https://github.com/JosephFerano/elm-graphics][original project]]. ** Showcase [[file:./media/red-p2q5.gif]] [[file:./media/blue-p3q5.gif]] [[file:./media/green-p2q9.gif]] [[file:./media/yellow-p8q9.gif]] ** Keybindings You can increment P or Q with the keyboard by pressing ~p~ or ~q~ and decrement with the neighboring letter ~o~ and ~w~ respectively. - Incr/Decr P: ~p/o~ - Incr/Decr Q: ~q/w~ ** Building with Elm 0.18.0 To install the binaries manually, follow this short guide; - [[https://sirfitz.medium.com/install-elm-0-18-0-in-2021-3f64ce298801][Install Binaries]] If you want to use =npm= instead; - =npm install -g elm@elm0.18.0= If you use =npm=, note that you will likely need an older version of Node.js, so it is recommended to use [[https://github.com/nvm-sh/nvm][nvm]] for that. I have not attempted this method personally, fyi. Once you have the Elm compiler, go ahead and run =elm make Torus.elm= And that should first pull in all the dependencies then generate an =index.html= file. Alternatively, you can use ~elm-reactor~, run the command and open up your browser to ~https://localhost:8000~ and then click on ~Torus.elm~ in the nice project webview provided. ** License This project is licensed under the terms of the MIT license. For more information, see the included LICENSE file.