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

Blot1 #1026

Closed
wants to merge 5 commits into from
Closed

Blot1 #1026

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
Binary file added art/Blot1/Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions art/Blot1/project.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
const width = 125;
const height = 125;

// Set the document dimensions
setDocDimensions(width, height);

// Store the final lines
const finalLines = [];

// Parameters for the design
const layers = 5; // Number of concentric layers
const polygonsPerLayer = 8; // Number of polygons in each layer
const baseRadius = 10; // Base radius for the first layer
const radiusIncrement = 10; // Increase in radius for each subsequent layer
const rotationIncrement = 10; // Rotation angle increment per layer

// Center of the canvas
const centerX = width / 2;
const centerY = height / 2;

// Generate the mandala pattern
for (let layer = 0; layer < layers; layer++) {
const radius = baseRadius + layer * radiusIncrement;
const rotationAngle = layer * rotationIncrement;

for (let i = 0; i < polygonsPerLayer; i++) {
const angle = (i * 2 * Math.PI) / polygonsPerLayer;

// Generate a polygon at this position
const polygon = [];
const sides = 6; // Hexagons for this example
const polygonSize = radius / 4; // Size scales with the layer radius

for (let j = 0; j < sides; j++) {
const polygonAngle = (j * 2 * Math.PI) / sides;
const x = centerX + (radius + polygonSize * Math.cos(polygonAngle)) * Math.cos(angle);
const y = centerY + (radius + polygonSize * Math.cos(polygonAngle)) * Math.sin(angle);
polygon.push([x, y]);
}
// Close the polygon
polygon.push(polygon[0]);

// Rotate each polygon
bt.rotate([polygon], rotationAngle, [centerX, centerY]);
finalLines.push(polygon);
}
}

// Draw the mandala
drawLines(finalLines);
Binary file added art/Blot2/Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions art/Blot2/project.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const width = 125;
const height = 125;

// Set document dimensions
setDocDimensions(width, height);

// Store final lines
const finalLines = [];

// Parameters for fractal design
const baseRadius = 20; // Radius of the first circle
const recursionDepth = 3; // Number of recursive levels
const branches = 6; // Number of branches from each circle
const angleOffset = 30; // Rotation offset for the fractal branches

// Center of the canvas
const centerX = width / 2;
const centerY = height / 2;

/**
* Recursive function to generate fractal lines
* @param {number} x - X-coordinate of the center
* @param {number} y - Y-coordinate of the center
* @param {number} radius - Radius of the current circle
* @param {number} depth - Current recursion depth
*/
function drawFractal(x, y, radius, depth) {
if (depth === 0) return;

// Generate branches
for (let i = 0; i < branches; i++) {
const angle = (i * 2 * Math.PI) / branches;

// Calculate end of each branch
const endX = x + radius * Math.cos(angle);
const endY = y + radius * Math.sin(angle);

// Draw line for the branch
finalLines.push([[x, y], [endX, endY]]);

// Draw the next recursive layer
drawFractal(endX, endY, radius / 2, depth - 1);
}
}

// Start fractal from the center
drawFractal(centerX, centerY, baseRadius, recursionDepth);

// Apply rotation for aesthetic
bt.rotate(finalLines, angleOffset, [centerX, centerY]);

// Draw the fractal design
drawLines(finalLines);
Binary file added art/Blot3/Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions art/Blot3/project.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
const width = 125;
const height = 125;

// Set document dimensions
setDocDimensions(width, height);

// Store final lines
const finalLines = [];

// Parameters for the design
const tessellationDepth = 3; // Depth of recursion for tessellation
const baseHexSize = 20; // Size of the initial hexagon
const scaleFactor = 0.6; // Scale factor for recursive hexagons
const rotationIncrement = 15; // Rotation increment for each recursive layer

// Center of the canvas
const centerX = width / 2;
const centerY = height / 2;

/**
* Function to draw a hexagon
* @param {number} x - X-coordinate of the center
* @param {number} y - Y-coordinate of the center
* @param {number} size - Size of the hexagon
* @param {number} depth - Current depth of recursion
* @param {number} rotation - Current rotation angle
*/
function drawHexagon(x, y, size, depth, rotation) {
if (depth === 0) return;

// Generate vertices of the hexagon
const hexagon = [];
for (let i = 0; i < 6; i++) {
const angle = (i * 2 * Math.PI) / 6 + (rotation * Math.PI) / 180;
const vertexX = x + size * Math.cos(angle);
const vertexY = y + size * Math.sin(angle);
hexagon.push([vertexX, vertexY]);
}
// Close the hexagon
hexagon.push(hexagon[0]);

// Add the hexagon to the final lines
finalLines.push(hexagon);

// Recursively draw smaller hexagons at each vertex
for (let i = 0; i < 6; i++) {
const nextX = hexagon[i][0];
const nextY = hexagon[i][1];
drawHexagon(nextX, nextY, size * scaleFactor, depth - 1, rotation + rotationIncrement);
}
}

// Draw the tessellation starting from the center
drawHexagon(centerX, centerY, baseHexSize, tessellationDepth, 0);

// Rotate the entire pattern for added effect
bt.rotate(finalLines, 30, [centerX, centerY]);

// Draw the tessellation
drawLines(finalLines);
Binary file added art/Blot4/Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions art/Blot4/project.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
const width = 125;
const height = 125;

// Set document dimensions
setDocDimensions(width, height);

// Store final lines
const finalLines = [];

// Parameters for the spiral galaxy
const numArms = 5; // Number of spiral arms
const numSegments = 50; // Number of segments per arm
const centerX = width / 2;
const centerY = height / 2;
const maxRadius = 60; // Maximum radius of the spiral
const rotationIncrement = 5; // Degree rotation per segment
const arcLength = 15; // Length of each arc segment

/**
* Function to generate an arc
* @param {number} cx - X-coordinate of the center
* @param {number} cy - Y-coordinate of the center
* @param {number} startAngle - Starting angle of the arc
* @param {number} radius - Radius of the arc
* @param {number} length - Length of the arc in degrees
*/
function createArc(cx, cy, startAngle, radius, length) {
const arc = [];
const steps = 10; // Number of points to define the arc
const angleStep = (length * Math.PI) / (180 * steps);

for (let i = 0; i <= steps; i++) {
const angle = (startAngle * Math.PI) / 180 + i * angleStep;
const x = cx + radius * Math.cos(angle);
const y = cy + radius * Math.sin(angle);
arc.push([x, y]);
}

return arc;
}

// Generate spiral arms
for (let arm = 0; arm < numArms; arm++) {
let rotation = (arm * 360) / numArms;

for (let segment = 0; segment < numSegments; segment++) {
const radius = (segment / numSegments) * maxRadius;
const arc = createArc(centerX, centerY, rotation, radius, arcLength);
finalLines.push(arc);
rotation += rotationIncrement; // Increment the angle for the next segment
}
}

// Add a slight rotation to the entire design
bt.rotate(finalLines, 30, [centerX, centerY]);

// Draw the spiral galaxy
drawLines(finalLines);
Binary file added art/Blot5/Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
103 changes: 103 additions & 0 deletions art/Blot5/project.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
const width = 125;
const height = 125;

setDocDimensions(width, height);

// Store final lines here
const finalLines = [];

// Cat's head (circle-like shape)
const headCenter = [62, 62];
const headRadius = 40;
const head = [];
const segments = 20;
for (let i = 0; i <= segments; i++) {
const angle = (Math.PI * 2 * i) / segments;
const x = headCenter[0] + Math.cos(angle) * headRadius;
const y = headCenter[1] + Math.sin(angle) * headRadius;
head.push([x, y]);
}
finalLines.push(head);

// Cat's ears (triangles)
const earHeight = 20;
const earWidth = 15;
// Left ear
finalLines.push([
[headCenter[0] - 30, headCenter[1] - 30], // Bottom left
[headCenter[0] - 45, headCenter[1] - 50], // Tip
[headCenter[0] - 15, headCenter[1] - 50], // Bottom right
[headCenter[0] - 30, headCenter[1] - 30] // Back to start
]);
// Right ear
finalLines.push([
[headCenter[0] + 30, headCenter[1] - 30], // Bottom right
[headCenter[0] + 45, headCenter[1] - 50], // Tip
[headCenter[0] + 15, headCenter[1] - 50], // Bottom left
[headCenter[0] + 30, headCenter[1] - 30] // Back to start
]);

// Cat's eyes (circles)
const eyeRadius = 5;
const eyeOffsetX = 20;
const eyeOffsetY = 10;
const leftEye = [];
const rightEye = [];
for (let i = 0; i <= segments; i++) {
const angle = (Math.PI * 2 * i) / segments;
const lx = headCenter[0] - eyeOffsetX + Math.cos(angle) * eyeRadius;
const ly = headCenter[1] - eyeOffsetY + Math.sin(angle) * eyeRadius;
const rx = headCenter[0] + eyeOffsetX + Math.cos(angle) * eyeRadius;
const ry = headCenter[1] - eyeOffsetY + Math.sin(angle) * eyeRadius;
leftEye.push([lx, ly]);
rightEye.push([rx, ry]);
}
finalLines.push(leftEye, rightEye);

// Cat's nose (small triangle)
finalLines.push([
[headCenter[0] - 5, headCenter[1] + 10], // Left corner
[headCenter[0] + 5, headCenter[1] + 10], // Right corner
[headCenter[0], headCenter[1] + 15], // Bottom tip
[headCenter[0] - 5, headCenter[1] + 10] // Back to start
]);

// Cat's mouth (small curves)
const mouth = [];
const mouthSegments = 10;
// Left side of the mouth
for (let i = 0; i <= mouthSegments; i++) {
const angle = (Math.PI * i) / mouthSegments; // Half-circle
const x = headCenter[0] - 5 + Math.cos(angle) * 10;
const y = headCenter[1] + 15 + Math.sin(angle) * 5;
mouth.push([x, y]);
}
// Right side of the mouth
for (let i = 0; i <= mouthSegments; i++) {
const angle = (Math.PI * i) / mouthSegments; // Half-circle
const x = headCenter[0] + 5 - Math.cos(angle) * 10;
const y = headCenter[1] + 15 + Math.sin(angle) * 5;
mouth.push([x, y]);
}
finalLines.push(mouth);

// Cat's whiskers
const whiskerLength = 20;
// Left whiskers
finalLines.push(
[[headCenter[0] - 15, headCenter[1] + 10], [headCenter[0] - 35, headCenter[1] + 5]],
[[headCenter[0] - 15, headCenter[1] + 15], [headCenter[0] - 35, headCenter[1] + 15]],
[[headCenter[0] - 15, headCenter[1] + 20], [headCenter[0] - 35, headCenter[1] + 25]]
);
// Right whiskers
finalLines.push(
[[headCenter[0] + 15, headCenter[1] + 10], [headCenter[0] + 35, headCenter[1] + 5]],
[[headCenter[0] + 15, headCenter[1] + 15], [headCenter[0] + 35, headCenter[1] + 15]],
[[headCenter[0] + 15, headCenter[1] + 20], [headCenter[0] + 35, headCenter[1] + 25]]
);

// Rotate all lines by 180 degrees
bt.rotate(finalLines, 180);

// Draw the final lines
drawLines(finalLines);
Loading