## turtle.lua - Drawing library

arthure
Prole
Posts: 9
Joined: Sat Jul 25, 2020 6:25 pm

### turtle.lua - Drawing library

Minimalist turtle graphics implementation in lua.

Source code : https://github.com/arthurealike/turtle.lua

If you are familiar with turtle graphics, it will be super easy to use our tool with chain methods.
Create a turtle instance, give commands it on load() or when an event is published, then call its draw function in love.draw(), and it is done.

Code: Select all

require "turtle"
local triangle = Turtle()
local red = {1, 0, 0}
triangle:setcolor(red):left(60):forward(50):right(120):forward(50):left(60):backward(50)
end

function love.draw()
triangle:draw()
end

You can also create multiple instances.
There are many methods that we described in readme on repository. We added also animation state that you can toggle drawing state such as stop and play in real-time. We'll keep updating/developing, finding better approaches to achieve turtle graphic's all methods. Thanks for supporting. Keep in touch!

Last edited by arthure on Wed Aug 05, 2020 10:32 am, edited 3 times in total.
sphyrth
Party member
Posts: 258
Joined: Mon Jul 07, 2014 11:04 am
Contact:

### Re: turtle.lua - Turtle graphics on LÖVE

I'm not old enough to have experienced it, but I'm old enough to know about it. This is a fun library!
arthure
Prole
Posts: 9
Joined: Sat Jul 25, 2020 6:25 pm

### Re: turtle.lua - Turtle graphics on LÖVE

sphyrth wrote: Wed Jul 29, 2020 2:48 am I'm not old enough to have experienced it, but I'm old enough to know about it. This is a fun library!
Let me tell you a secret, I did not experienced turtle graphics too But it is real fun and can be used in different ways. Thank you!
zorg
Party member
Posts: 3074
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

### Re: turtle.lua - Turtle graphics on LÖVE

I'm ancient enough to have had the pleasure of doing turtle graphics decades ago, and it isn't less fun now than it was then.
It's a neat thing what one can draw with this; L-systems, patterns found in nature, fractals, chaos... the possibilities are endless!
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
arthure
Prole
Posts: 9
Joined: Sat Jul 25, 2020 6:25 pm

### Re: turtle.lua - Turtle graphics on LÖVE

zorg wrote: Wed Jul 29, 2020 10:22 am I'm ancient enough to have had the pleasure of doing turtle graphics decades ago, and it isn't less fun now than it was then.
It's a neat thing what one can draw with this; L-systems, patterns found in nature, fractals, chaos... the possibilities are endless!
I was trying to implement a fractal engine for love2d, then i found myself as writing turtle in lua. As you said, turtle is a super easy way of implementing fractals.
arthure
Prole
Posts: 9
Joined: Sat Jul 25, 2020 6:25 pm

### Re: turtle.lua - Turtle graphics on LÖVE

It is updated with new methods.
Alp
Prole
Posts: 7
Joined: Wed Jul 10, 2019 2:48 pm

### Re: turtle.lua - Drawing library

Huh... I've never even heard of turtle graphics!
Does it have any relation to Fourier Series, or is it entirely different?

Procedural graphics creation has always been a fascinating subject to me.
Lead programmer, and secondary artist at "Nosey Studios", I draw lots of butts!
zorg
Party member
Posts: 3074
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

### Re: turtle.lua - Drawing library

It is different; just a way to graph things... that said, it is indeed powerful. One could implement things like fourier series based waveform drawing, rule-based auromata visualization, L(indenmayer)-system based drawing (more natural things e.g. trees, leaves, etc.)
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
pgimeno
Party member
Posts: 2566
Joined: Sun Oct 18, 2015 2:58 pm

### Re: turtle.lua - Drawing library

Alp wrote: Wed Aug 12, 2020 12:31 pm Huh... I've never even heard of turtle graphics!
Does it have any relation to Fourier Series, or is it entirely different?
It has more to do with these: http://cyberneticzoo.com/cyberneticanim ... -american/

Logo is a language with which you can give commands to a "turtle" (most commonly an arrow painted on the screen, but there were robot models that painted on paper too, as shown in the link). Basically, commands are relative to the turtle: forward N, right N, pendown, penup, etc. "Turtle graphics" refers to a way of drawing graphics using that basic concept from Logo, without being a Logo language implementation itself.
arthure
Prole
Posts: 9
Joined: Sat Jul 25, 2020 6:25 pm

### Re: turtle.lua - Drawing library

I keep developing and try to make it well documented guys, thanks for your interest.

### Who is online

Users browsing this forum: Google [Bot] and 11 guests