Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files via upload #1013

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions art/I'm An Ant - Carlos Ramírez/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
@title: I'm An Ant
@author: Carlos Ramírez
@snapshot: i'm_an_ant.png
*/

setDocDimensions(125, 125);


const numArms = 12;
const allLines = [];


function createSpiralArm(startAngle, scale) {
const turtle = new bt.Turtle();
turtle.down()
.jump([62.5, 62.5])
.setAngle(startAngle);


for (let i = 0; i < 50; i++) {
const step = 1 + (i * 0.15);
const angle = 10 + bt.noise(i * 0.1) * 5;

turtle.forward(step)
.right(angle);


if (bt.rand() < 0.1) {
const branchTurtle = turtle.copy();
branchTurtle.right(45)
.forward(step * 0.7)
.right(30)
.forward(step * 0.5);
allLines.push(...branchTurtle.lines());
}
}

return turtle.lines();
}


const centerTurtle = new bt.Turtle();
centerTurtle.down()
.jump([62.5, 62.5]);

for (let i = 0; i < 36; i++) {
centerTurtle.forward(3)
.right(10)
.forward(1)
.right(10);
}

allLines.push(...centerTurtle.lines());

for (let i = 0; i < numArms; i++) {
const angle = (360 / numArms) * i;
const spiralArm = createSpiralArm(angle, 1);
allLines.push(...spiralArm);


const mirroredArm = createSpiralArm(angle + (360 / numArms / 2), 0.7);
allLines.push(...mirroredArm);
}


const decorTurtle = new bt.Turtle();
for (let i = 0; i < 8; i++) {
const radius = 5 + i * 3;
const numPoints = 30 + i * 5;
decorTurtle.up()
.jump([62.5 + radius, 62.5])
.down();

for (let j = 0; j < numPoints; j++) {
const angle = (360 / numPoints);
decorTurtle.right(angle)
.forward(2 * Math.PI * radius / numPoints);
}
}

allLines.push(...decorTurtle.lines());


drawLines(allLines);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading