Guide To Creating Line Art Using Inkscape Parametric Curves
Guide To Creating Line Art Using Inkscape Parametric Curves
For key presses I will use the <Key> convention, when you see this press what’s inside the brackets,
<CTRL-SHIFT-D> means you press the three keys Ctrl, Shift and D key simultaneously.
In the end of this guide you will be able to make figures or “plots” as a mathematician would call it, like
this:
First set the pagesize to your output print size, normally A4 or letter size. Use File –Document properties
or press < CTRL-SHIFT-D> to go direct to the document properties window.
After setting to what you like close document properties window and maximize page in Inkscape
window: press the “5”-key <5>
Draw a square by clicking the square icon on the toolbar: Draw a square approximately half the
page size, keep it square by holding the <CTRL> key down as you draw. Set the fill to “None” and stroke
size to “1” for now. Look in the bottom left corner of the Inkscape window to see that your settings are
“right” :
Select the square just drawn and go to Extensions – Render – Parametric Curves:
(Don’t worry if your dropdown list’s look different than mine – that’s from installing additional features.)
Lets just start to plot a circle - just to keep it simple and verify our settings, we will use the “sin” and
“cosine” functions for this, we will set our “window” size to go from -1 to 1 in both x and y direction as
the “sin” and “cosine” varies between these values. Make sure you “check” the Multiply t-range by 2*pi
box and “uncheck” the “Remove rectangle” boxes. Set the “Samples” to 10 for this simple plot.
To avoid typo’s copy <CTRL-C> from lines below and paste <CTRL-V> in your Inkscape dialog.
sin(t)
cos(t)
Press Apply and you will end up with a circle in your box:
Let’s plot a spiral by “extending” our function. For the figure to expand or contract as we go along we
will just divide or multiply the value of x and y by the variable t as we plot.
sin(t)*t/25
cos(t)*t/25
Still not very artistic, what if we add a sine-wave to the spiral path?
sin(t)*t/25+sin(10*t)/10
cos(t)*t/25+cos(10*t)/10
Hm, looks like the added curve is varying too fast, by having it change exponentially instead of linearly
we can change that.
(sin(t)+sin(5*t))*exp(-t*0.01)
(cos(t)+cos(5*t))*exp(-t*0.01)
By varying the Samples to sample every “pi/4” or thereabout you can get some interesting curves, since
we are plotting a range from 0 to 5 let’s try to sample close to every pi/4 (45 degrees), we change the
samples to 41 and number of waves around the circle to 10:
sin(t)+sin(10*t)*exp(-t*0.01)
cos(t)+cos(10*t)*exp(-t*0.01)
Due to the fact that Inkscape are plotting Bezier Curves between the calculated points (marked by red
dots) the curve looks nice!
( A lot of the similar Java plots found on the net have too few samples, the result looks nice but the
“true” curve are not plotted. )
If we draw straight lines between the points we end up with this figure:
Try experimenting with samples, start and end t-values etc. – have fun and play!
Since the figures are made of Bezier curves a nice effect can be obtained by making the lines between
calculated points straight lines – select the figure press <F2> to select node edit mode – then select all
nodes <CTRL-A> and make all segment straight lines: The above figure turns into this:
Just by varying the number of samples by a little some dramatic effects can be obtained, all the figures
below are from the same plot, just different sample numbers.
A few more to play with:
For this one the number of samples is set to 2000 – by default the max in the menu is 1000, this can be
changed by changing the file: Inkscape\share\extensions\param_curves_inx
Find the line containing “samples” and change the number 1000 to 100000:
While you are at it, change the start end end t-values to 100000 as well, will be used later in the guide.
pow(cos(t),3)*exp(t*0.001)+t/300
pow(sin(t),3)*exp(t*0.001)+t/300
The “+t/300” term causes the plot position to “move” across the page, in this figure the plot moves in
both x and y direction.
Try duplicate the figure <CTRL-D> and flip it – set transparency to 75% - change color – blur, change
some parameters slightly, place figures on top of each other etc. Some variations:
(sin(1*t)+sin(2.01*t))*exp(-t*0.0001)
(cos(1*t)+cos(2.01*t))*exp(-t*0.0001)
This one is “undersampled” – try changing the samples.
References Temple H. Fay, "The Butterfly Curve" American Mathematical Monthly 96, No. 5,
May 1989.
Temple H. Fay, "A Study in Step Size" Mathematics Magazine 70, No 2, April 1997
http://www.johndcook.com/blog/category/graphics/