It is currently Wed May 08, 2024 5:32 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Request: Update L-System & Turtle Scripts
PostPosted: Mon Jul 25, 2011 12:43 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2260
Location: Poland
Wish list
Some remember the L-System.
[ viewtopic.php?f=8&t=2241&start=10#p29113 ]
It works with Gimp 2.2.17.
Is it possible to adapt to GIMP 2.7 - in slinky or path-waves ?


Attachments:
L-System and Turtle v.12 scm.zip [5.83 KiB]
Downloaded 231 times
L-System.png
L-System.png [ 46.11 KiB | Viewed 4999 times ]
Turtle paths.png
Turtle paths.png [ 158.13 KiB | Viewed 4999 times ]

_________________
Image

Slava
Ukraini!
Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: The return of the revenge on the son of Slinky, reloaded
PostPosted: Mon Jul 25, 2011 1:47 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
That would be cool! :)

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: The return of the revenge on the son of Slinky, reloaded
PostPosted: Mon Jul 25, 2011 2:03 am  (#3) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
Can't one of our script-fu mavens just fix it to work in 2.6/2.8?

What I'm working on right now is a mix of text-along-path and path-waves: instead of having fixed patterns, the repeated pattern can be any arbitrary path (which is scaled to fit). And of course you can use the script to apply a path on itself. On the other hand the weather is not so rainy here :)




 ! "Moderator" wrote:
Split From Slinky Thread

_________________
Image


Top
 Post subject: Re: The return of the revenge on the son of Slinky, reloaded
PostPosted: Mon Jul 25, 2011 3:17 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2260
Location: Poland
ofnuts wrote:
...On the other hand the weather is not so rainy here

Looking at Your plugins:
http://sourceforge.net/projects/gimp-pa ... s/scripts/
You're the expert on paths.
Weather has always changed in the past ...

_________________
Image

Slava
Ukraini!


Top
 Post subject: Re: The return of the revenge on the son of Slinky, reloaded
PostPosted: Mon Jul 25, 2011 3:53 am  (#5) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
MareroQ wrote:
ofnuts wrote:
...On the other hand the weather is not so rainy here

Looking at Your plugins:
http://sourceforge.net/projects/gimp-pa ... s/scripts/
You're the expert on paths.

But not in Scheme
MareroQ wrote:
Weather has always changed in the past ...
We are in summer :)

_________________
Image


Top
 Post subject: Re: Request: Update L-System & Turtle Scripts
PostPosted: Tue Jul 26, 2011 1:08 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2260
Location: Poland
Sure, we prefer Python - because it has more capabilities than scripts.
The possibility of L-system (in Java), you can try at:
http://www.javaview.de/vgp/tutor/lsystem/PaLSystem.html


Attachments:
L-System in Java.png
L-System in Java.png [ 137.71 KiB | Viewed 4913 times ]

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: Request: Update L-System & Turtle Scripts
PostPosted: Tue Jul 26, 2011 1:27 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12521
Don't remember this Script-fu for whatever reason and it would be a cool one to port to 2.6x. I did some extensive research on Single Line Fills (remember the Traveling Salesman thread I started way back; that was pretty much the closest that I could come to generating Single Line Fills) but haven't really ran across a good way to fill arbitrary containers (selections) convincingly with them. That is my motivation. Not sure even if this Script-fu for 2.2x could even do that, but still, I would like to fill a Sphere with a Hilbert Curve. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Request: Update L-System & Turtle Scripts
PostPosted: Tue Jul 26, 2011 3:56 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
What exactly would you use it for?
Creating paths?

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Request: Update L-System & Turtle Scripts
PostPosted: Tue Jul 26, 2011 8:56 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12521
Here's a little info Rod: http://en.wikipedia.org/wiki/Space-filling_curve

There are some who believe there is in reality only a single fractal dimension w.r.t. our Universe and what we see as 3D is just an illusion. Simplicity itself. I created a fake Hilbert seamless pattern (hilbert curves are not seamless, but may appear to be). Below's an example of what I'm sort of after (remember the Sculpture generator thread a while back). :)

Generated by Sculpture Generator 1 by Carlo H. Séquin, UC Berkeley

edit: Decided to share this texture so maybe you all might like it too. :)

http://lylejk.deviantart.com/#/d41p9tk (ssp; lol)


Attachments:
sculpture_hilbert.png
sculpture_hilbert.png [ 525.85 KiB | Viewed 4875 times ]

_________________
Lyle

Psalm 109:8

Image
Top
 Post subject: Re: The return of the revenge on the son of Slinky, reloaded
PostPosted: Tue Jul 26, 2011 9:39 am  (#10) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
ofnuts wrote:
What I'm working on right now is a mix of text-along-path and path-waves: instead of having fixed patterns, the repeated pattern can be any arbitrary path (which is scaled to fit). And of course you can use the script to apply a path on itself.


You should look at the Inkscape pattern on path extension as it does the same thing (attached for your convenience)

-Rob A>


Attachments:
File comment: inkscape path along path extension
pathalongpath.zip [3.6 KiB]
Downloaded 210 times

_________________
Image
Fantasy Cartography and Mapping by RobA
Top
 Post subject: Re: Request: Update L-System & Turtle Scripts
PostPosted: Tue Jul 26, 2011 9:59 am  (#11) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
It seems to split things in small segments... and there are a bunch of imports that aren't part of standard python?

_________________
Image


Top
 Post subject: Re: The return of the revenge on the son of Slinky, reloaded
PostPosted: Wed Feb 01, 2012 8:23 pm  (#12) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12521
RobA wrote:
ofnuts wrote:
What I'm working on right now is a mix of text-along-path and path-waves: instead of having fixed patterns, the repeated pattern can be any arbitrary path (which is scaled to fit). And of course you can use the script to apply a path on itself.


You should look at the Inkscape pattern on path extension as it does the same thing (attached for your convenience)

-Rob A>


Somehow missed this one Rob. Anyway you can make a no deformation option? Here's something I concocted using your custom extension. :)


Attachments:
bitmap.png
bitmap.png [ 279.64 KiB | Viewed 2111 times ]

_________________
Lyle

Psalm 109:8

Image
Top
 Post subject: Re: Request: Update L-System & Turtle Scripts
PostPosted: Wed Feb 01, 2012 9:43 pm  (#13) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
i should have guessed that you already know Hilbert SFC !

I believe L-System & Turtle implemented well in many fractal apps (yes i 'm more and more hooked by fractal ), better then may be in Gimp but...well i suppose you prefer use in gimp and also i don't want be responsible to introduce you to such addictive dope ( i just read a message from somebody that waited 6 months 2 weeks, 5 days, 8 hours and 50 seconds for his fractal animation to finish to render...ii found really scaring that he counted even the seconds...)

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: The return of the revenge on the son of Slinky, reloaded
PostPosted: Wed Feb 01, 2012 9:55 pm  (#14) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
lylejk wrote:
Somehow missed this one Rob. Anyway you can make a no deformation option? Here's something I concocted using your custom extension. :)


That would be the scatter extension:
Attachment:
rect3883.png
rect3883.png [ 121.81 KiB | Viewed 2106 times ]


I created a variant that will pick objects from a group and uses them along the curve with the scatter extension that looks like it will make it into inkscape 0.49

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Request: Update L-System & Turtle Scripts
PostPosted: Wed Feb 01, 2012 10:56 pm  (#15) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12521
I get into various fractal stuff every so often PC, but they are short lived (mainly because I'm impatient and can't achieve the result that I want or it takes too long on my nearly 4 year old dinosaur; I know. I should be greatful that at least I have a 64-bit OS. lol).

Now Rob; you know you just made me a happy camper right? Thanks a heap. Haven't tried multiple grouped objects, but I will eventually. :)


Attachments:
bitmap.png
bitmap.png [ 885.75 KiB | Viewed 2101 times ]

_________________
Lyle

Psalm 109:8

Image
Top
 Post subject: Re: Request: Update L-System & Turtle Scripts
PostPosted: Fri Feb 03, 2012 10:47 am  (#16) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
lylejk wrote:
Haven't tried multiple grouped objects, but I will eventually. :)


it can do some neat things:
Attachment:
scatter.png
scatter.png [ 94.91 KiB | Viewed 2081 times ]


-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Request: Update L-System & Turtle Scripts
PostPosted: Fri Feb 03, 2012 11:04 am  (#17) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Rob! - Excellent, and i can not wait for this in Inkscape 0.49 :)
I added the module to my 0.48 version to check it out.

Thanks for your contribution.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Request: Update L-System & Turtle Scripts
PostPosted: Thu Sep 11, 2014 9:08 am  (#18) 
Offline
GimpChat Member
User avatar

Joined: Jan 15, 2013
Posts: 133
Reviving the dead here a bit, but has anyone successfully converted these scripts to work with Tiny-Scheme yet?

_________________
Gimp 2.8.16
Arch Linux - XFCE 4.12
Some of my work.


Top
 Post subject: Re: Request: Update L-System & Turtle Scripts
PostPosted: Thu Sep 08, 2016 7:19 am  (#19) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2260
Location: Poland
No one attempted to repair script-fu. :gaah
My solution - installed Gimp 2.2.17 for Win 32bit (only 38 Mb). :geek


Attachments:
LSystem-old_Gimp-2.2.17.png
LSystem-old_Gimp-2.2.17.png [ 68.46 KiB | Viewed 1437 times ]

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: Request: Update L-System & Turtle Scripts
PostPosted: Sat Sep 24, 2016 4:11 am  (#20) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2260
Location: Poland
Alternative - Turtle.scm

https://github.com/RyanBurnside/GIMP-Turtle

It only works with the console.
Can I use these commands in gimp-python? :geek

With README:

Quote:
GIMP-Turtle
=============

A simple set of functions designed to be used in the Script-Fu REPL to add precise placement and drawing commands to GIMP using turtle graphics.

This allows the user to define drawing routines in real time.
Precision lines and shapes can be made by defining a Turtle and telling it to move and face various directions.

=============
README

These commands are used in real time, start a Script-Fu console to begin.
The Script-Fu console is actually a TinyScheme language environment.
This environment is traditionally called a Read Evaluate Print Loop or REPL.
You will give TinyScheme instructions here using my Turtle library.

Turtles?:

To start you need to define a Turtle which is another name for a movable position that you will be drawing with. A Turtle has a pen attached to his tail, you can raise or lower the pen with the pu and pd commands.

These stand for pen up and pen down. By default a turtle has his pen down.

A Turtle keeps track of his position, color, direction and pen.

Let's try an example type in each line and hit ENTER key.
First, we need to make a new Turtle and call him "t".

(define t (make-Turtle 0 0 0))

Now, we want to move him to the center of the screen, tell him to go "home"

(home t)

Now, let's tell him to look at 0 degrees (points left).

(lk 0 t)

Good, lets tell him to move forward 100 pixels.

(fd 100 t)

A line appears! Lets tell him to turn right 90 degrees.

(rt 90 t)

Repeat the last two steps until you form a 100 x 100 pixel square!

Now please quickly look over the source code Turtle.scm. This contains all the functions you may use. You might take a week or so to learn TinyScheme. Gimp and this Turtle library are NOT part of TinyScheme but extend the language to be used in Gimp.

I've included a help function that may give you additional information on the command parameters if you get stuck. For help on the mv command you could type the following into the REPL.

(help mv)

You will be given the document string for mv command.

***Note***
Currently there is a bug in Gimp.
You will need to make a brush with a 1 pixel image to draw a thin line.
Otherwise you will be drawing in an unscaled version of the current brush.
This may be fixed in the future.

Also, if you wish to execute many commands without flooding your undo stack you might wrap your calls in the (with-undo-group ...) macro. See complex examples in source code.

I'm not a professional programmer but encourage you to learn a dialect of LISP
It may not be trendy but there are a lot of unique aspects to both Scheme and Common Lisp.

Have fun! Happy programming!

-Ryan Burnside


Attachments:
Gimp-Turtle.png
Gimp-Turtle.png [ 33.09 KiB | Viewed 1378 times ]

_________________
Image

Slava
Ukraini!
Top
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts 11 Extra Crown Molding gradients default in my GIMP system

4

No new posts Attachment(s) Script request

3

No new posts My shameful n00b request for help

3

No new posts Attachment(s) pm_create_a_water_drop_text.py (Issabella request) updated

17

No new posts Attachment(s) pm_plexi_text_effect plugin (Issabella request) version_2

13



* Login  



Powered by phpBB3 © phpBB Group