wia/code/hilbert.jl

22 lines
452 B
Julia
Raw Permalink Normal View History

2024-07-12 13:17:55 +02:00
using Lindenmayer, Luxor
f(t::Turtle) = begin
t.pencolor = (0.0,0.0,0.0)
setline(4)
end
hilbert_curve = LSystem(Dict(
"L" => "*+RF-LFL-tFR+",
"R" => "*-LF+RFR+FL-"),
"3L")
drawLSystem(hilbert_curve,
forward = 25,
turn = 90,
iterations = 4,
startingx = -200,
startingy = -200,
filename = "./images/hilbert_curve.png",
backgroundcolor = "white",
asteriskfunction = f,
showpreview = true)