Skip to content

Instantly share code, notes, and snippets.

@cormullion
Last active October 4, 2020 15:12
Show Gist options
  • Save cormullion/83fb427d9cc1903808df03fc7c043017 to your computer and use it in GitHub Desktop.
Save cormullion/83fb427d9cc1903808df03fc7c043017 to your computer and use it in GitHub Desktop.
julia-hacktoberfest.jl
using Luxor, Thebes, Zalgo
leafverts = convert.(Point3D, Point[Point(-22.25390625, 44.8359375), Point(-42.9765625, 26.78515625), Point(-43.40625, 26.03125), Point(-35.67578125, 21.640625), Point(-35.66015625, 21.33984375), Point(-50.12109375, 7.46875), Point(-52.17578125, 4.1328125), Point(-47.66796875, 1.4140625), Point(-47.66015625, 1.17578125), Point(-61.1015625, -27.94140625), Point(-60.84375, -29.23828125), Point(-35.09375, -24.734375), Point(-34.35546875, -25.7109375), Point(-21.59375, -13.56640625), Point(-21.11328125, -13.94921875), Point(-22.65625, -40.26953125), Point(-22.44921875, -40.9609375), Point(-1.359375, -62.5703125), Point(-0.55078125, -62.203125), Point(5.35546875, -82.87109375), Point(5.80859375, -82.890625), Point(10.83203125, -62.71484375), Point(10.69921875, -61.34375), Point(29.7734375, -42.10546875), Point(30.01171875, -41.58203125), Point(24.234375, -13.328125), Point(24.4140625, -13.02734375), Point(36.2734375, -21.5625), Point(37.09375, -21.87109375), Point(57.6875, -23.015625), Point(57.9375, -22.5703125), Point(36.83203125, 18.00390625), Point(36.45703125, 18.78515625), Point(44.9921875, 24.50390625), Point(44.76953125, 25.1015625), Point(34.61328125, 35.44921875), Point(33.9765625, 36.5390625), Point(21.44921875, 42.90625), Point(20.59765625, 43.1328125), Point(8.83984375, 36.08203125), Point(6.1328125, 33.1640625), Point(6.70703125, 52.8984375), Point(6.0234375, 54.1796875), Point(4.07421875, 34.2265625), Point(3.59765625, 30.85546875), Point(-4.71875, 41.125), Point(-8.296875, 43.78125), Point(-21.2578125, 45.27734375), Point(-22.25390625, 44.835937)])
mysimplegfunction(v, f, l) = begin
sethue([Luxor.julia_green, Luxor.julia_red,Luxor.julia_purple, Luxor.julia_blue][rand(1:end)])
poly(v, :fill)
end
keycolor = "orange"
Drawing(800, 800, "/tmp/$(keycolor)-hacktoberfest.svg")
origin()
sethue(keycolor)
squircle(O, 795/2, 795/2, rt = 0.15, :path)
newsubpath()
circlepath(O, 251, :path)
clip()
perspective(400)
eyepoint(100, 100, 100)
t = Tiler(800, 800, 20, 20)
for i in 1:400
l = make((leafverts, []))
@layer begin
translate(first.(t)[i])
scaleby!(l, rand(0.05:0.05:0.2), rand(0.05:0.05:0.2), rand(0.05:0.05:0.2))
moveby!(l, rand(-10:10, 3)...)
rotateby!(l, -π/4, rand(π/4:π/12:π/2), 0)
pin(l, gfunction = mysimplegfunction)
end
end
clipreset()
fontface("JuliaMono-Black")
fontsize(100)
circle(O, 260, :clip)
sethue(keycolor)
setline(2)
circle(O, 250, :stroke)
circle(O, 242, :stroke)
@layer begin
fontsize(50)
textcurvecentred(fraktur("HACKTOBERFEST"), -π/2, 190, O + (0, -0), letter_spacing=5)
textcurvecentred(fraktur("HACKTOBERFEST"), clockwise=false, π/2, 230, O + (0, -0), letter_spacing=10)
end
@layer begin
scale(0.8)
translate(0, -10)
julialogo(color=true, bodycolor=keycolor, centered=true)
end
@layer begin
fontsize(30)
text("20", O + (-210, 0), halign=:center, valign=:middle)
text("20", O + (-210, 24), halign=:center, valign=:middle)
text("20", O + (210, 0), halign=:center, valign=:middle)
text("20", O + (210, 24), halign=:center, valign=:middle)
end
clipreset()
sethue(keycolor)
setline(3)
squircle(O, 795/2, 795/2, rt = 0.15, :stroke)
finish()
preview()
@logankilpatrick
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment