2018-08-21 14:11:06 +02:00
|
|
|
local thickness = 72 -- change this to change the spiral thickness.
|
2018-05-10 21:42:24 +02:00
|
|
|
|
2018-08-21 14:11:06 +02:00
|
|
|
local inv_pi = 1 / math.pi
|
|
|
|
local thickness2 = thickness * 2
|
2017-07-18 21:29:12 +02:00
|
|
|
|
2018-08-21 14:11:06 +02:00
|
|
|
return function(x, y)
|
2018-10-02 21:58:22 +02:00
|
|
|
local d_sq = x * x + y * y
|
|
|
|
if d_sq < 16384 then --d < 128
|
2018-08-21 14:11:06 +02:00
|
|
|
return true
|
|
|
|
end
|
2017-07-18 21:29:12 +02:00
|
|
|
|
2018-08-21 14:11:06 +02:00
|
|
|
local angle = 1 + inv_pi * math.atan2(x, y)
|
|
|
|
local offset = d + (angle * thickness)
|
|
|
|
|
|
|
|
return offset % thickness2 >= thickness
|
2017-07-18 21:29:12 +02:00
|
|
|
end
|