Iterative art

Post unfinished work here for feedback and advise.
Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Iterative art

Postby Lazur » Mon Feb 11, 2013 1:32 am

Hello world,
I'm new to this forum, searched it a bit and assuming this is the right place to start off.
I have been using inkscape for some years now, and, want to progress more.
Would post things in the help sections, but I'm guessing an image can tell more than words.
So here is what I made (click on it for larger version):

Image

This image is based on a simple mathematical formula that I started to use in mspaint, but now I want to make things less complicated, thus need your help.
The problem is, that I would like to generate such imagery by parameters, but have no idea where to start.
I searched for svg-xml articles if it is possible to add a repeat cycle in the svg codes, but it wasn't mentioned.
Also I'm not very familiar with programming-scripting, but I would like to get used to.

This is another image of something done with a similar method:
Image
Note, that this version was edited with gimp from several ones, also, the colouring was made possible with it.
I would like to achieve similar results from a generated drawing, mainly with scripting (?).

So, this is all work in progress, as these were made manually, and not how it should be done.
Some fractal-like images, which not necesserily repeats to eternity, but vanishes right away it cannot be displayed.


Here is another idea, "work in progress" as the previous one:
Image

This is the most famous spiral, known as Fibonacci/golden spiral.
Where I want to design a spiral, it always has to be constructed from cyrcle segments. As with the previous one, this could be-and should be scripted.

Any help/constructive criticism much appreciated.
Last edited by Lazur URH on Mon Feb 11, 2013 5:54 pm, edited 1 time in total.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Op-art-ish and such

Postby brynn » Mon Feb 11, 2013 10:48 am

Image
Welcome to InkscapeForum!

I'm not clear what you're asking. There are some Inkscape extensions where you can input parameters, equations or formulas, and have things drawn. So you could investigate the Extensions menu. Here are some that come to mind, but there are others that I haven't tried yet. All of these in Extensions > Render: 3D Polyhedron, Function Plotter, L-System, Parametric Curves.

From your description, it sounds like you may be looking for something like fractal drawing programs, most of which are old and no longer supported. Some of them work only via code or equations or formulas. I ran into this one awhile back. Fragmentarium. I was never able to learn how to use it though. (because I didn't understand the code/scripts) There's an older fractal app which I don't think is either supported or developed anymore, called Tierazon. And Apophysis, which may still be developed and supported. I've lost my links to them, but they should be easily searchable.

And there's one that a member here has mentioned from time to time, where you enter some kind of code or scripts to make them draw.....but darned if I can remember the name of it at the moment.... Well, hopefully he'll either see this message and reply, or I'll remember Image

"repeat things" I believe might be called "iteration" which the previously mentioned fractal programs will do, as well as a couple of those extensions in Inkscape. But if you could be a little more clear about what you're asking, you might get more appropriate replies :D

PS - My favorite Inkscape extension, Extensions > Render > Spirograph!

Edit
You mentioned MSPaint. You do realize that Inkscape is a vector graphics program, right?

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Op-art-ish and such

Postby Lazur » Mon Feb 11, 2013 11:18 am

Thank's for the quick feedback!

Iteration would be good for the start to achive, as the first two images are based on iterating the scaling of an object, and placing the scaled one over the top.
The parameters should be something like defining two numbers for the scaling percentage, and one to be the size of the smallest object, that shouldn't be scaled more.
With the colouring I'm guessing it would be much complicated, because it would be the best to use gradient fills, and they should be changed in each downscaled object just a bit.

With the spiral, the goal is to iterate scaling one cyrcle segment, rotate it, and place it next to the previous one.
This would also make some fractal-like images if other than cyrcles used, but the main parameters that I would have are the following:
Circle radius, circle segment controlpoint numbers, angle of segment, scale percent, numbers of iteration; option of displaying the vanishing point.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Op-art-ish and such

Postby Lazur » Mon Feb 11, 2013 11:23 am

I do realise inkscape is vector, and mspaint is not. It was mot that relevant to the post, just something that means it's on my mind since more than I knew inkscape.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Op-art-ish and such

Postby brynn » Mon Feb 11, 2013 11:38 am

I just remembered that other program. Don't have a link, but it's called PovRay.

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Op-art-ish and such

Postby ragstian » Mon Feb 11, 2013 12:21 pm

Hi Lazur URH

Love your images!

For "super simple" way to create a Fibonacci spiral in Inkscape see this post; http://www.inkscapeforum.com/viewtopic.php?f=28&t=13427#p51751

For repetitive patterns you can use tiled clones in the Edit menu; see this forum thread for some simple examples; viewtopic.php?f=30&t=13203

As brynn mentioned the spirograph I would like to draw (pun intended) your attention to Inkscapes Parametric curves; you will find a "how-to" guide here; http://www.inkscapeforum.com/viewtopic.php?f=6&t=12946

brynn also mentioned pov-ray, great tool; http://povray.org/ - povray "Hall of fame" ; http://hof.povray.org/

Hope this can give you some ideas.

Keep posting your images - they are so nice!

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Op-art-ish and such

Postby Lazur » Mon Feb 11, 2013 2:27 pm

Thank's!

Will post some spiral approximations with the use of circles soon.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Op-art-ish and such

Postby Lazur » Mon Feb 11, 2013 5:46 pm

Image

Work in progress, still manual though.

Image

Image

Image

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Op-art-ish and such

Postby Lazur » Wed Feb 20, 2013 11:08 am

Started to learn the inkscape extensions and python, and fractal logic.
The iteration should be done with a while cycle. The harder thing will be the colouring of the thing -the copy/pasted object's fill's gradients should be modified on every object a bit.
I want to make this in inkscape because I'd like to be able printing it on canvas with the best possible solution.
Which is right now, 1200/2400 dpi, with the actual print size of about 1500/1500 mm, which would need at least a 70866/70866 pixel sized raster image, which is impossible to handle in any raster program.

One other thing: is there a way to change the linear gradients default linear RGB option to non-linear (with scripting)?
Like in sumopaint: http://www.sumopaint.com/app/. The linear steps between colour steps are not appealing. You know what I mean if you try to draw a realistic shaded chrome cylinder.
Last edited by Lazur URH on Thu Feb 21, 2013 4:24 am, edited 2 times in total.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Op-art-ish and such

Postby Lazur » Wed Feb 20, 2013 10:51 pm

Tried out the tiled clone and the function plotter options.
I couldn't handle the plotter one, it doesn't seemed to understand (x)^2 to plot a regular parabola.
Thus used geogebra, which is more accurate, because it plots lot more nodes of such plotted mathematic curves.
It can export svg-s, so it was perfect for this time.
Geogebra is available here for free: http://www.geogebra.org/cms/

The tiled clones use similar method that I would use. It works with a for cycle, but the bigger problem is I can't input the exact parametres I would use, making the result less accurate.

Here is the result (click on it to enlarge, it looks much better in big):

Image

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Op-art-ish and such

Postby ragstian » Wed Feb 20, 2013 11:38 pm

Hi.

For the function plotter and parametric curves; the (x)^2 has to be input as; pow(x,2).
See my line art guide; https://dl.dropbox.com/s/53fibdy4an2dtp ... Curves.pdf

Great image by the way!

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Op-art-ish and such

Postby Lazur » Thu Feb 21, 2013 12:30 am

Thank's!
I couldn't figure that pow out. Also now I realized the sample can be set up to even 1000 on the menu. Or even more, typing in a higher number into the fplot.inx's max="..." in line 14.
That line art guide looks great, will try that out sometime.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Op-art-ish and such

Postby Lazur » Tue Feb 26, 2013 4:07 am

Does anybody know where is the tiled clone via .py in the inkscape folders? Searched through the extensions but couldn't find it.
It would be the best to build things from that code as I'm still not that familiar with coding.

This is what I could put together recently for a basic linear iterate scale extension inx:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">

    <_name>linear iterate scale</_name>
    <id>org.lazururh.effect.lineariteratescale</id>

    <dependency type="executable" location="extensions">lineariteratescale.py</dependency>
   <dependency type="executable" location="extensions">inkex.py</dependency>
   
   <param name="tab" type="notebook">
       <page name="parameters" _gui-text="float input">
            <param name="pow" type="float" min="1.001" max="1000.0" _gui-text="pow value of parabola">3.55</param>
         <param name="xsale" type="float" min="0.52" max="0.98" _gui-text="x scale ratio">0.9</param>
         <param name="minsize" type="float" min="0.03" max="50.0" _gui-text="size limit">1.0</param>
      </page>
      <page name="use" _gui-text="Use">
          <_param name="lineariteratescaleuse" type="description" xml:space="preserve">select a path before calling the extension</param>
      </page>
    </param>
   
    <effect>
       <object-type>path</object-type>
        <effects-menu>
          <submenu _name="Generate from Path"/>
      </effects-menu>
   </effect>
   
   <script>
       <command reldir="extensions" interpreter="python">interp.py</command>
   </script>
   
</inkscape-extension>


For the starting it should work with paths only, but if I figure out how tiled clones work, it would be necessary to work on groups as well.

The idea is the following:
Select the object that should have copies with iterated downscaling on each after applying extension.
Put in a pow value of the parabola that should be drawn with the copies bounding boxes top right corner
-the origo should be in the bottom left corner, the top right corner should be (1,1)
Put in a scaling value fo the x dimension.
Then, the program should duplicate he selected path, place it over the previous,
scale it down in x direction with the given value,
scale it down in y direction with a calculated value -based on the simple pow function,
and iterate it until the smallest dimension reaches the size input in the menu.

It is very simple, although I have no idea right now how to move on with the coding.

After reaching this as a result, the next thing would be changing the x dimension's downscaling to a given function from this "linear" one, and
making it able to render different curves, not just a parabola. Most ideally a path that is selected as well.



Then, after it all, the interpolation between gradients through the copies should be done in a way.

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Op-art-ish and such

Postby ragstian » Tue Feb 26, 2013 6:13 am

Hi

The Tiled Clones is part of the "Core"-Inkscape and is not implemented through extensions.

Source code in the "inkscape-0.48.4\src\ui\dialog\tile.cpp"

Code to be found here: http://sourceforge.net/projects/inkscape/?source=dlp

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Op-art-ish and such

Postby Lazur » Tue Feb 26, 2013 8:33 am

Thank's for the help!
I just can't seem to find the right file to download.
Is this possible only as descriebed here?:
http://wiki.inkscape.org/wiki/index.php/Compiling_Inkscape_on_Windows#Obtaining_Inkscape_source_code

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Op-art-ish and such

Postby ragstian » Tue Feb 26, 2013 9:56 am

Hi.

Oops, my bad!

Try this link;http://downloads.sourceforge.net/inkscape/inkscape-0.48.4.tar.gz

Have not compiled Inkscape myself yet as there are weekly updates to download,
might give it a try just for fun! :)

RGDS Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Op-art-ish and such

Postby Lazur » Tue Feb 26, 2013 7:52 pm

Thank's!
Just opened it. 888 lines of C++ (?) code. Oh my.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Op-art-ish and such

Postby Lazur » Mon Mar 04, 2013 5:40 am

Here is another "work in progress" stage of that extension.

the .inx

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">

    <_name>lineariteratescale</_name>
    <id>org.lazururh.effect.lineariteratescale</id>

    <dependency type="executable" location="extensions">lineariteratescale.py</dependency>
   <dependency type="executable" location="extensions">inkex.py</dependency>
   
   <param name="tab" type="notebook">
       <page name="parameters" _gui-text="float input">
            <param name="pow" type="float" min="1.001" max="1000.0" _gui-text="pow value of the parabola">3.55</param>
         <param name="xscale" type="float" min="0.52" max="0.98" _gui-text="x scale ratio">0.9</param>
         <param name="minsize" type="float" min="0.03" max="50.0" _gui-text="size limit">1.0</param>
      </page>
      <page name="use" _gui-text="Use">
          <_param name="lineariteratescaleuse" type="description" xml:space="preserve">select a group before calling the extension</param>
      </page>
    </param>
   
    <effect>
       <object-type>group</object-type>
        <effects-menu>
          <submenu _name="Render"/>
      </effects-menu>
   </effect>
   
   <script>
       <command reldir="extensions" interpreter="python">interp.py</command>
   </script>
   
</inkscape-extension>





the .py

Code: Select all

#!/usr/bin/env python
'''
Quick description:
This script iterates scaling on a selected object with given scaling values, putting smaller generated objects on the top of each.
'''
import inkex, copy, math, simpletransform

class lineariteratescale(inkex.Effect):
    def __init__(self):
        inkex.Effect.__init__(self)
        self.OptionParser.add_option("-pw", "--pow",
                        action="store", type="float",
                        dest="pow", default=3.55,
                        help="type in the pow value of the parabola")
        self.OptionParser.add_option("-xs", "--xscale",
                        action="store", type="float",
                        dest="xscale", default=0.9,
                        help="type in the x scale ratio")   
        self.OptionParser.add_option("-mns", "--minsize",
                        action="store", type="float",
                        dest="minsize", default=1.0,
                        help="type in the minimum size of the clones to be displayed"

   def effect(self):

if __name__ == '__main__':
    e = lineariteratescale()
    e.affect()


Only the core is missing, hope I can figure it out soon.
Last edited by Lazur URH on Mon Mar 04, 2013 7:09 am, edited 1 time in total.

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Op-art-ish and such

Postby ragstian » Mon Mar 04, 2013 5:46 am

Hi.

Interesting!

The .inx and .py files seems to be the same??

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Op-art-ish and such

Postby Lazur » Mon Mar 04, 2013 7:10 am

ragstian wrote:Hi.

Interesting!

The .inx and .py files seems to be the same??

RGDS
Ragnar


Sorry, my bad, edited it since.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Op-art-ish and such

Postby Lazur » Mon Mar 04, 2013 7:11 am

More golden spiral approximations, this time with 7,5° segments.
The original circle's diameter was 3000 pixels, and there is a 0,005 pixel inaccuracy I couldn't get rid off.
That was from the rotation though, applying 7,5° rotation to one part 11 times made such inaccuracy compared to one part rotated 90°-s.


This was made manually, to become as precise as possible.
I used clones of the basic object, and run into an old program issue:
the duplicating of the gradients.

I added a gradient for the master object, then used the modify gradient panel to add more steps to it, then, closing that panel, used the handles to move steps by bits, and adjusted colour several times, which made inkscape capture all preliminary gradients, so there are 718 unused gradients saved with the file.
This made inkscape crash more times.
Is there a way to get rid of them, without editing the svg with a notepad? It would be disappointing if it was the only solution.*


Anyway, here are the results -click on them to enlarge:

Image
This one has a circular gradient fill from the centre of each segment.


Image
This fill was aligned in the vanishing point of the spiral.


Image
These were not using the approximation's segment's centre, the master object was drawn aligned on a line with the vanishing point of the spiral.

Image


*vacuum unused defs, case solved

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Op-art-ish and such

Postby Lazur » Wed Mar 06, 2013 8:46 pm

Here are two Vasarely image's reconstructions, that may be possible to draw with an iterate scale extension someday:
-click on them to enlarge-

Image

Image

User avatar
Johannski
Posts: 65
Joined: Wed May 05, 2010 3:13 am
Location: Austria
Contact:

Re: Op-art-ish and such

Postby Johannski » Fri Mar 08, 2013 7:51 am

Wow! Really interesting what you're doing with Inkscape. I've got the feeling that you like the golden ratio ;)
What I thought about when i saw that double spiral was: If one spiral would have the gradient mirrored so that the golden part is on the outside, you could create a pretty neat texture!

Hope to see more of this!
Image

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Op-art-ish and such

Postby Lazur » Thu Oct 09, 2014 1:06 am

Resurrecting this old topic.
Not that I could get along with making an "envelope parametric iteration" extension, but that as it is a work in progress one, maybe less polished images, with different conceptcs can keep things going well.


Getting back to spirals, this may seem interesting to all cnc users as well:
SVG Image


The concept was to make a polar, angled hatching. This is an approximation, don't hold back if anyone knows the mathematical description of such a spiral.

The white lines are white stroked paths with no fills. To make the tone appear consistent, at each distance from the centre -at each radius-, the intersection with concentric circles of the stroke's shape produce the same amount in percents.
In the example image 50% is stroked, and there are 180 strokes used in total.
The shape is related to the inner-starting radius- of the spiral, where it is perpendicular, and, it is related to the stroke's width.
Archimedean spirals are quite close, if their stroke width is 0.
But since the stroke has to be wider than that, these kind of spirals are less and steeper than them, going from the centre.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Op-art-ish and such

Postby Lazur » Sun Oct 12, 2014 12:04 pm

After a bit of research, it seems the right shape is of a circle's involute/evolvent -which is used in regular gear tooth profiles.

Image
http://mathworld.wolfram.com/Involute.html

In the differential geometry of curves, an involute (also known as evolvent) is a curve obtained from another given curve by attaching an imaginary taut string to the given curve and tracing its free end as it is wound onto that given curve...

...Alternatively, another way to construct the involute of a curve is to replace the taut string by a line segment that is tangent to the curve on one end, while the other end traces out the involute. The length of the line segment is changed by an amount equal to the arc length traversed by the tangent point as it moves along the curve....

...The involute of a circle resembles, but is not, an Archimedean spiral.
Its successive turns are parallel curves with constant separation distance, a property which is often (inaccurately) ascribed to the Archimedean spiral....


http://en.wikipedia.org/wiki/Involute



Sounds good, but I have no idea how that behaviour can be proved from the description of the curve.

svg-s:
Image



Image


Can be drawn with the parametric curves extension:

x=a*(cos(t)+t*sin(t))
y=a*(sin(t)-t*cos(t))




Another thing, that is related: the evolute.
In the differential geometry of curves, the evolute of a curve is the locus of all its centers of curvature.

http://en.wikipedia.org/wiki/Evolute
By that the evolute of an involute means the original curve.


The spirals in the previous posts show well those centres.

The evolute of a equiangular spiral is the same spiral rotated.

The involute of a equiangular spiral is the same spiral rotated.

http://xahlee.info/SpecialPlaneCurves_dir/EquiangularSpiral_dir/equiangularSpiral.html

It would be great to have a live path effect displaying the evolute and tangent radiuses, so that perception on a right shape of a path coud get more accurate.


Return to “Work in progress”