Last active
February 5, 2020 10:06
-
-
Save cormullion/eb742ccf31e4c1e4f7c0df0060dd8f31 to your computer and use it in GitHub Desktop.
revise graphics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Luxor | |
| """ | |
| makegear(nteeth, s, pos, rot) | |
| nteeth is number of teeth, s is basically radius | |
| pos is center, rot is initial rotation | |
| """ | |
| function makegear(nteeth, s, pos, rot) | |
| @layer begin | |
| translate(pos) | |
| rotate(rot) | |
| toothx = s .* [-8.0, -5.5, -5, 0, 5, 5.5, 8.0] | |
| toothy = s .* (55 .+ [0.0, -6.0, -8, -8, -8, -6, 0]) | |
| tooth = reverse(map(x -> Point(x...), zip(toothx, toothy))) | |
| a = Point[] | |
| for i in 1:nteeth | |
| append!(a, polyrotate!(tooth, 2π/nteeth)) | |
| end | |
| poly(a, close=true, :fillpreserve) | |
| sethue("black") | |
| strokepath() | |
| end | |
| end | |
| function drawlogo(w, h) | |
| @layer begin | |
| squircle(O, w/2, h/2, rt=0.2, :clip) | |
| background("antiquewhite") | |
| gearcenters = map(pt -> Point(0.95pt.x, 1.4pt.y), box(O, w/2 + 50, h/2 + 50, vertices=true)) | |
| sethue("black") | |
| #setline(2) | |
| for (n, pt) in enumerate(gearcenters) | |
| sethue([Luxor.julia_green, Luxor.julia_red,Luxor.julia_purple, Luxor.julia_blue][mod1(n, 4)]), | |
| makegear(15, 2.75, pt, n * π/25) | |
| end | |
| sethue("black") | |
| clipreset() | |
| end | |
| @layer begin | |
| fontface("FiraGO-ExtraBold") | |
| fontsize(140) | |
| text("Revise", O + (0, -10), halign=:center, valign=:middle) | |
| setline(3) | |
| squircle(O, w/2, h/2, rt=0.2, :stroke) | |
| end | |
| end | |
| function squarelogo() | |
| Drawing(500, 500, "revise.svg") | |
| origin() | |
| drawlogo(500, 500) | |
| finish() | |
| preview() | |
| end | |
| function wordmark() | |
| Drawing(780, 250, "revise-wordmark.png") | |
| origin() | |
| t = Table([300], [250, 550]) # 1 row 2 columns | |
| @layer begin | |
| setline(1.2) | |
| translate(t[1]) | |
| scale(0.3) | |
| drawlogo(500, 500) | |
| end | |
| @layer begin | |
| translate(t[2]) | |
| sethue("black") | |
| setline(3) | |
| fontface("FiraGO-ExtraBold") | |
| fontsize(140) | |
| text("Revi", O + (0, 45), halign=:right) | |
| @layer begin | |
| # red over green | |
| sethue("black") | |
| textoutlines("s", O + (80, -10), halign=:right, :strokepreserve) | |
| sethue("red") | |
| fillpath() | |
| sethue("black") | |
| textoutlines("z", O + (80, 80), halign=:right, :strokepreserve) | |
| sethue((34, 240, 48) ./ 255) | |
| fillpath() | |
| end | |
| text("e", O + (160, 45), halign=:right) | |
| end | |
| finish() | |
| preview() | |
| end | |
| squarelogo() | |
| wordmark() |
Author
cormullion
commented
Feb 5, 2020

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