How to create a function contains of two parametric functions X(t) and Y(t)

Post about using Inkscape with cutters or plotters.
alex.cool93
Posts: 2
Joined: Sat Apr 22, 2017 12:27 am

How to create a function contains of two parametric functions X(t) and Y(t)

Postby alex.cool93 » Sat Apr 22, 2017 12:29 am

Hello!

I'd like to draw something like this:

http://www.guard-soft.com/materials/CER ... df#page=83
https://dev.oberonplace.com/products/se ... nction.htm

I thought it'd possible to make it in inkscape with using "Parametric Curves" extension. But it didn't work the way I expected. This is what i got:

http://imgh.us/7fAupzF1g0I.jpg

I dont understand what am i doing wrong? How can i get a periodic function like in examples above?

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

Re: How to create a function contains of two parametric functions X(t) and Y(t)

Postby Lazur » Sat Apr 22, 2017 3:55 am

alex.cool93 wrote:Hello!

I'd like to draw something like this:

http://www.guard-soft.com/materials/CER ... df#page=83
https://dev.oberonplace.com/products/se ... nction.htm

I thought it'd possible to make it in inkscape with using "Parametric Curves" extension. But it didn't work the way I expected. This is what i got:

http://imgh.us/7fAupzF1g0I.jpg

I dont understand what am i doing wrong? How can i get a periodic function like in examples above?





Welcome aboard!

That seems a nice program.

You are using the right tool but need a bit different function to plot.

First tick in the multiply by 2 pi option for t.
Then it takes some math and/or try and errors for fine-tuning the process.

The base function would be drawing a circle:
x=sin(t)*r
y=cos(t)*r

After that, modulating the radius with a sin function would be something similar:

x=sin(t)*((r-s*sin(t))
y=cos(t)*((r-s*sin(t))

That will always be continuous if you set a higher range for t than 1.
To avoid that, you need the rotation to be "dragging or rushing".

That means altering the sin(t) and cos(t) divisors at the start of the functions.

Something this will do:
x=sin(t*0.9)*((r-s*sin(t))
y=cos(t*0.9)*((r-s*sin(t))

Now you can set the range of t higher, and don't forget to also set higher sample values.

For example,
x=sin(0.95*t)*(500-100*sin(3*t))
y=cos(0.95*t)*(500-100*sin(3*t)),

with t range from 0 to 25 and 901 samples draws a decent guilloche ring.
Only thing remaining is adding another modulation to the r value, that will interfere fith the previous alteration.


Checking
x=sin(0.95*t)*(500-100*sin(3*t)-20*sin(0.3*t))
y=cos(0.95*t)*(500-100*sin(3*t)-20*sin(0.3*t)), it's almost good enough.


So the general function looks as the following:

x=sin(a*t)*(R1-R2*sin(b*t)-R3*sin(c*t))
y=cos(a*t)*(R1-R2*sin(b*t)-R3*sin(c*t))

"a" controls the dragging. If you are after a dense fill, set it to an "off-beat" value like 0.874 that won't repeat itself until alot turns.
Need some math to adjust it with the right periodic repeats.

"R1" is tha "basic" radius of the ring, "R2" and "R3" are the amplitudes of a sin curve stretched along the circle.
They have the most control on the distances from the origo in the overall look.

"b" and "c" values are the most crucial parts of this function.

x=sin(0.825*t)*(500-100*sin(6*t)-50*sin(0.6*t))
y=cos(0.825*t)*(500-100*sin(6*t)-50*sin(0.6*t)) plots a nice guilloche but with b=5, c=0.5 you won't get anything similar.

That's how far I can see it by first glance, would go on by try and errors.

alex.cool93
Posts: 2
Joined: Sat Apr 22, 2017 12:27 am

Re: How to create a function contains of two parametric functions X(t) and Y(t)

Postby alex.cool93 » Sat Apr 22, 2017 6:43 am

Lazur wrote:
alex.cool93 wrote:Hello!

I'd like to draw something like this:

http://www.guard-soft.com/materials/CER ... df#page=83
https://dev.oberonplace.com/products/se ... nction.htm

I thought it'd possible to make it in inkscape with using "Parametric Curves" extension. But it didn't work the way I expected. This is what i got:

http://imgh.us/7fAupzF1g0I.jpg

I dont understand what am i doing wrong? How can i get a periodic function like in examples above?





Welcome aboard!

That seems a nice program.

You are using the right tool but need a bit different function to plot.

First tick in the multiply by 2 pi option for t.
Then it takes some math and/or try and errors for fine-tuning the process.

The base function would be drawing a circle:
x=sin(t)*r
y=cos(t)*r

After that, modulating the radius with a sin function would be something similar:

x=sin(t)*((r-s*sin(t))
y=cos(t)*((r-s*sin(t))

That will always be continuous if you set a higher range for t than 1.
To avoid that, you need the rotation to be "dragging or rushing".

That means altering the sin(t) and cos(t) divisors at the start of the functions.

Something this will do:
x=sin(t*0.9)*((r-s*sin(t))
y=cos(t*0.9)*((r-s*sin(t))

Now you can set the range of t higher, and don't forget to also set higher sample values.

For example,
x=sin(0.95*t)*(500-100*sin(3*t))
y=cos(0.95*t)*(500-100*sin(3*t)),

with t range from 0 to 25 and 901 samples draws a decent guilloche ring.
Only thing remaining is adding another modulation to the r value, that will interfere fith the previous alteration.


Checking
x=sin(0.95*t)*(500-100*sin(3*t)-20*sin(0.3*t))
y=cos(0.95*t)*(500-100*sin(3*t)-20*sin(0.3*t)), it's almost good enough.


So the general function looks as the following:

x=sin(a*t)*(R1-R2*sin(b*t)-R3*sin(c*t))
y=cos(a*t)*(R1-R2*sin(b*t)-R3*sin(c*t))

"a" controls the dragging. If you are after a dense fill, set it to an "off-beat" value like 0.874 that won't repeat itself until alot turns.
Need some math to adjust it with the right periodic repeats.

"R1" is tha "basic" radius of the ring, "R2" and "R3" are the amplitudes of a sin curve stretched along the circle.
They have the most control on the distances from the origo in the overall look.

"b" and "c" values are the most crucial parts of this function.

x=sin(0.825*t)*(500-100*sin(6*t)-50*sin(0.6*t))
y=cos(0.825*t)*(500-100*sin(6*t)-50*sin(0.6*t)) plots a nice guilloche but with b=5, c=0.5 you won't get anything similar.

That's how far I can see it by first glance, would go on by try and errors.





That's a really interesting and useful equations for making guilloche rings. Thank you, I appreciate this!

But I just wanted to draw a contour. I need to figure out how to draw that simple one period of a function specified by coefficients of Fourier series.
And then I'm just going to use "pattern along path" extension with circle/square/curve as a path.

Could you please help me with that?


Return to “Inkscape & Cutters/Plotters”

Who is online

Users browsing this forum: No registered users and 2 guests