Shape Maker

Size
2,056 Kb
Views
18,216

How do I make an shape maker?

What is a shape maker? How do you make a shape maker? This script and codes were developed by Gregory Potdevin on 01 October 2022, Saturday.

Shape Maker Previews

Shape Maker - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Shape Maker</title>
</head>
<body> <pre id="result"/> <script src="js/index.js"></script>
</body>
</html>

Shape Maker - Script Codes JS Codes

var str = ""
function addPath(name, path){ var minX = 1000000, maxX = 0 var minY = 1000000, maxY = 0 path.forEach(function(p){ if (p[0] < minX) minX = p[0] if (p[0] > maxX) maxX = p[0] if (p[1] < minY) minY = p[1] if (p[1] > maxY) maxY = p[1] }) var width = maxX - minX var height = maxY - minY var midX = (maxX + minX)/2 var midY = (maxY + minY)/2 var ratio = 2 / (Math.max(width, height)) str += "Vec2 path" + name + "[] = {<br />" path.forEach(function (p){ str += " Vec2(" str += Math.round(((p[0] - midX)*ratio)*100)/100 str += ", " str += Math.round(((p[1] - midY)*ratio)*100)/100 str += "),<br />" }) str += "};<br /><br />"
}
addPath("Tree", [ [174, 26], [153, 50], [162, 50], [135, 71], [153, 71], [125, 106], [160, 106], [160, 120], [184, 120], [184, 106], [220, 106], [192, 71], [211, 71], [185, 50], [195, 50],
])
addPath("Gift", [ [291, 504], [270, 484], [251, 494], [255, 511], [272, 523], [228, 523], [228, 641], [352, 641], [352, 523], [311, 523], [330, 513], [338, 496], [327, 482], [305, 485],
])
addPath("Candle", [ [543, 558], [529, 580], [526, 602], [536, 617], [546, 618], [547, 625], [525, 625], [525, 762], [490, 762], [490, 782], [615, 782], [615, 762], [580, 762], [580, 625], [550, 625], [550, 618], [562, 605], [562, 597], [544, 575],
])
addPath("Gingerbread", [ [406, 236], [386, 245], [375, 264], [383, 290], [356, 283], [339, 296], [343, 309], [376, 326], [368, 364], [348, 370], [341, 381], [349, 400], [360, 403], [406, 382], [440, 399], [455, 403], [465, 400], [473, 381], [468, 371], [445, 362], [437, 327], [468, 309], [473, 298], [471, 291], [457, 282], [429, 288], [436, 272], [435, 255], [425, 243],
]) document.getElementById("result").innerHTML = str
Shape Maker - Script Codes
Shape Maker - Script Codes
Home Page Home
Developer Gregory Potdevin
Username GregoryPotdevin
Uploaded October 01, 2022
Rating 3
Size 2,056 Kb
Views 18,216
Do you need developer help for Shape Maker?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Gregory Potdevin (GregoryPotdevin) Script Codes
Name
Climb
CheckboxFilter
RangeInputFilter
A Pen by Gregory Potdevin
Turn
Guass
Searchkit 0.8
Line
Control
RangeFilter
Create amazing SEO content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!