This file contains 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
# should run this using Luxor#master or >= v2.20.0 - | |
# I replaced a dodgy implementation of Jarvis March with | |
# a hopefully less dodgy implementation of Graham Scan. | |
using Luxor, ColorSchemes | |
@draw begin | |
background("black") | |
println("create points") | |
verts = randompointarray(BoundingBox(), 30) |
This file contains 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 | |
using Graphs | |
using Colors | |
function lighten(col::Colorant, f) | |
c = convert(RGB, col) | |
return RGB(f * c.r, f * c.g, f * c.b) | |
end | |
function julia_sphere(pt::Point, w, col::Colorant; |
This file contains 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, LightGraphs, Random, Colors | |
function lighten(col::Colorant, f) | |
c = convert(RGB, col) | |
return RGB(f * c.r, f* c.g, f * c.b) | |
end | |
function julia_sphere(pt, w; | |
col = 1, | |
action = :none, |
This file contains 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, Colors, Thebes | |
# requires Luxor >= 2.15.0 | |
function make_conical_mesh(; | |
origin = O, | |
radius = 250, | |
startangle = 0, | |
endangle = 2π, | |
startoutsidecolor = colorant"red", |
This file contains 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 | |
function make_matrix() | |
Drawing(40, 40, :image) | |
background(1, 1, 1, 1) | |
setantialias(0) | |
origin() | |
setcolor(0, 0, 0, 1) | |
fontsize(40) | |
text("a", halign=:center, valign=:middle) |
This file contains 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, Colors | |
function draw_logo(color=colorant"black") | |
box(O, 580, 500, 40, :clip) | |
mountain = [ | |
Point(-300, 250), | |
Point(-300, 200), | |
Point(-64, -70), | |
Point(40, 40), | |
Point(105, -5), |
This file contains 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 | |
function jump_circles() | |
setline(12) | |
setlinecap("round") | |
line(Point(20, 68), Point(120, 28), :stroke) | |
line(Point(4, 120), Point(120, 4), :stroke) | |
pts = box(Point(86, 84), 40, 40, vertices=true) | |
@layer begin | |
sethue(Luxor.julia_red) |
This file contains 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 Shapefile, Luxor, BenchmarkTools | |
cd(@__DIR__) | |
include(joinpath(dirname(pathof(Luxor)), "readshapefiles.jl")) | |
function drawairportmap(outputfilename, countryoutlines, airportdata) | |
Drawing(4000, 2000, outputfilename) | |
origin() | |
background(0.05, 0.2, 0.15) |
This file contains 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
### A Pluto.jl notebook ### | |
# v0.12.15 | |
using Markdown | |
using InteractiveUtils | |
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). | |
macro bind(def, element) | |
quote | |
local el = $(esc(element)) |
This file contains 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 | |
function meshlogo(fname) | |
Drawing(600, 600, fname) | |
origin() | |
# background | |
squircle(O, 285, 285, :clip, rt=0.2) | |
sethue("slateblue4") | |
paint() |