Reuleaux effects 🌀

Inspired by @Jeffb3's MINES at plotterfiles.com/%40je…87-b23d-b8422e0c964a which looks like Reuleaux effects 🌀 (variation)

(the plotterfiles.com link does not work as TurtleToy replaces the @ with %40 which breaks the site)

Log in to post a comment.

// You can find the Turtle API reference here: https://turtletoy.net/syntax
Canvas.setpenopacity(.7);

const loops = 320;         // min=0 max=800 step=1
const switches = 3;         // min=0 max=10 step=1
const resolution = 670;         // min=100 max=1000 step=10
const offsetX = -10;            // min=-100 max=100 step=1
const offsetY = 0;            // min=-100 max=100 step=1

// Global code will be evaluated once.
const turtle = new Turtle();
turtle.jump(offsetX, offsetY);
turtle.radians();

// The walk function will be called until it returns false.
function walk(i) {
    let spin = (Math.floor(i / (loops / (switches + 1))) % 2 == 1? -1: 1) * Math.PI / resolution;
    turtle.circle(i/2, Math.PI/(i == loops? (switches % 2 == 1? 50: 3.02): 3));
    turtle.right((Math.PI / 3) + spin);
    return i < loops;
}