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

Baseballfield-Ventengo #830

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
5e72e0e
Add files via upload
Ventengo1 Aug 15, 2024
8f6488e
Update index.js.js
Ventengo1 Aug 21, 2024
5a90614
Update index.js.js
Ventengo1 Aug 22, 2024
ff29b8b
Update index.js.js
Ventengo1 Aug 23, 2024
5259143
Update index.js.js
Ventengo1 Aug 23, 2024
4f8754d
Update index.js.js
Ventengo1 Aug 23, 2024
13fd3ac
Update index.js.js
Ventengo1 Aug 23, 2024
54f8fc4
Delete art/Baseballfield-Ventengo/screenshots directory
Ventengo1 Aug 23, 2024
d596794
Add files via upload
Ventengo1 Aug 23, 2024
1222c60
Update index.js.js
Ventengo1 Aug 26, 2024
66fafb7
Update index.js.js
Ventengo1 Sep 7, 2024
c3922e5
Delete art/Baseballfield-Ventengo/screenshots/pic1.png
Ventengo1 Sep 7, 2024
b62487b
Add files via upload
Ventengo1 Sep 7, 2024
96285a5
Rename image (2).png to pic1.png
Ventengo1 Sep 7, 2024
185da5c
Delete art/Baseballfield-Ventengo/screenshots/pic2.png
Ventengo1 Sep 7, 2024
d43a9e8
pic2 new
Ventengo1 Sep 7, 2024
e040510
Rename image (3).png to pic2.png
Ventengo1 Sep 7, 2024
8bed98e
Delete art/Baseballfield-Ventengo/screenshots/pic3.png
Ventengo1 Sep 7, 2024
d107620
Add files via upload
Ventengo1 Sep 7, 2024
c4ad59b
Rename image (4).png to pic3.png
Ventengo1 Sep 7, 2024
725875c
Delete art/Baseballfield-Ventengo/screenshots/pic1.png
Ventengo1 Sep 7, 2024
71e248e
Delete art/Baseballfield-Ventengo/screenshots/pic2.png
Ventengo1 Sep 7, 2024
ab5659d
Delete art/Baseballfield-Ventengo/screenshots/pic3.png
Ventengo1 Sep 7, 2024
6c09ce8
Add files via upload
Ventengo1 Sep 7, 2024
b573472
Rename pic1.png.png to pic1.png
Ventengo1 Sep 7, 2024
a408053
Rename pic2.png.png to pic2.png
Ventengo1 Sep 7, 2024
d79af97
Rename pic3.png.png to pic3.png
Ventengo1 Sep 7, 2024
4d7fe2d
Delete art/Baseballfield-Ventengo/screenshots/pic3.png
Ventengo1 Sep 7, 2024
afc049c
Add files via upload
Ventengo1 Sep 7, 2024
cc4b52f
Rename pic3.png.png to pic3.png
Ventengo1 Sep 7, 2024
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
155 changes: 155 additions & 0 deletions art/Baseballfield-Ventengo/index.js.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
/*
@title: Baseball field
@author: Ventengo
@snapshot: pic1
*/

const width = 125;
const height = 125;
const smallSquareSize = 20;
const smallSquareOffsets = [
[0, 0],
[width - smallSquareSize, 0],
[width - smallSquareSize, height - smallSquareSize],
[0, height - smallSquareSize]
];



setDocDimensions(width * 2, height * 2);

const lines = [];
const triangles = [];

// Draw the mound
const moundRadius = 15;
const moundX = width / 2;
const moundY = height / 2;
const numPoints = 30;
const angleIncrement = 2 * Math.PI / numPoints;
for (let i = 0; i < numPoints; i++) {
const angle = i * angleIncrement;
const x = moundX + moundRadius * Math.cos(angle);
const y = moundY + moundRadius * Math.sin(angle);
lines.push([
[x, y],
[moundX + moundRadius * Math.cos(angle + angleIncrement), moundY + moundRadius * Math.sin(angle + angleIncrement)]
]);
}

// Draw the fence
const fenceRadius = 196;
const fenceRotation = 105;
const fenceStartAngle = Math.PI / 2 + fenceRotation;
const fenceEndAngle = 2.25 * Math.PI / 2 + fenceRotation;

const fenceCenterX = 39;
const fenceCenterY = 50;

const numFencePoints = 50;
const fenceAngleIncrement = (fenceEndAngle - fenceStartAngle) / numFencePoints;
for (let i = 0; i <= numFencePoints; i++) {
const angle = fenceStartAngle + i * fenceAngleIncrement;
const x = fenceCenterX + fenceRadius * Math.cos(angle);
const y = fenceCenterY + fenceRadius * Math.sin(angle);
lines.push([
[x, y],
[fenceCenterX + fenceRadius * Math.cos(angle + fenceAngleIncrement), fenceCenterY + fenceRadius * Math.sin(angle + fenceAngleIncrement)]
]);
}

// Draw the star
const starPoints = 5;
const starInnerRadius = 10;
const starOuterRadius = 20;
const starCenterX = width / 2;
const starCenterY = height / 2;

const starLines = [];
for (let i = 0; i < starPoints; i++) {
const outerAngle = (i * 2 * Math.PI) / starPoints;
const innerAngle = outerAngle + Math.PI / starPoints;

const outerX = starCenterX + starOuterRadius * Math.cos(outerAngle);
const outerY = starCenterY + starOuterRadius * Math.sin(outerAngle);
const innerX = starCenterX + starInnerRadius * Math.cos(innerAngle);
const innerY = starCenterY + starInnerRadius * Math.sin(innerAngle);

const triangle1 = [
[10, 144],
[30, 171],
[50, 144]
];

const triangle2 = [
[137, 97],
[155, 127],
[173, 100]
];

const triangle3 = [
[164, 7],
[177, 32],
[199, 7]
];

bt.translate(triangles, [2, 16]);


// Draw the triangles
triangles.push(triangle1);
triangles.push(triangle2);
triangles.push(triangle3);
drawLines(triangles);

// Draw the outer square
lines.push([
[0, 0],
[width, 0]
]);
lines.push([
[width, 0],
[width, height]
]);
lines.push([
[width, height],
[0, height]
]);
lines.push([
[0, height],
[0, 0]
]);



smallSquareOffsets.forEach(([offsetX, offsetY]) => {
lines.push([
[offsetX, offsetY],
[offsetX + smallSquareSize, offsetY]
]);
lines.push([
[offsetX + smallSquareSize, offsetY],
[offsetX + smallSquareSize, offsetY + smallSquareSize]
]);
lines.push([
[offsetX + smallSquareSize, offsetY + smallSquareSize],
[offsetX, offsetY + smallSquareSize]
]);
lines.push([
[offsetX, offsetY + smallSquareSize],
[offsetX, offsetY]
]);
});



starLines.push([
[outerX, outerY],
[innerX, innerY]
]);
}

lines.push(...starLines);

// Draw all lines (including the star)
drawLines(lines);
Binary file added art/Baseballfield-Ventengo/screenshots/pic1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added art/Baseballfield-Ventengo/screenshots/pic2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added art/Baseballfield-Ventengo/screenshots/pic3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading