Inkscape Community

Help Using Inkscape => Stuck on a Tutorial? => Topic started by: brynn on February 14, 2015, 05:32:04 AM

Title: trouble drawing parametric curve hearts (Ragnar's tutorial)
Post by: brynn on February 14, 2015, 05:32:04 AM
Hi Friends,
I was just using Ragnar's tutorial (http://dropbox.com/s/hk6f5hvhw8g63tz/Ever%20tried%20to%20draw%20a%20perfect%20heart%20in%20Inkscape.pdf) to draw some hearts.  Happy Valentines Day, btw  :D

When I follow the tutorial (0.91, 32-bit, Win7) I get a traceback and no results.  Here's the traceback:

Traceback (most recent call last):

  File "param_curves.py", line 249, in <module>
    e.affect()
  File "C:\Program Files (x86)\Inkscape0.91\share\extensions\inkex.py", line 268, in affect
    self.effect()
  File "param_curves.py", line 233, in effect
    self.options.drawaxis)))
  File "param_curves.py", line 72, in drawfunction
    f2 = eval('lambda t: ' + fy.strip('"'))
  File "<string>", line 2
    -
    ^
SyntaxError: invalid syntax

Could this be a bug?  Or something else?

Hopefully Ragnar can help?  But thanks for anyone's help  :D

Title: Re: trouble drawing parametric curve hearts (Ragnar's tutorial)
Post by: Lazur on February 14, 2015, 01:44:53 PM
I assume by the syntax error you didn't close all opened brackets.
Title: Re: trouble drawing parametric curve hearts (Ragnar's tutorial)
Post by: brynn on February 14, 2015, 02:15:10 PM
I copied the text that the tutorial says to copy.  Maybe there has been some kind of change with 0.91 that makes it work differently?

It looks to me like the brackets are all closed.  But it's been a really long time since I could do math on that level.  I might have forgotten some rules.

Edit
Well, the parentheses are closed.  There aren't any brackets.
Title: Re: trouble drawing parametric curve hearts (Ragnar's tutorial)
Post by: Lazur on February 14, 2015, 02:29:08 PM
Not sure then if things have changed, it works on 0.48 with
x=16*(sin(t)*sin(t)*sin(t))
y=13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t)
just fine.
Title: Re: trouble drawing parametric curve hearts (Ragnar's tutorial)
Post by: brynn on February 14, 2015, 02:54:44 PM
Hhmmm....using 0.48.5, I also got a traceback, and no results.  Traceback:

Traceback (most recent call last):

  File "param_curves.py", line 249, in <module>
    e.affect()
  File "C:\Program Files (x86)\Inkscape0.48.5\share\extensions\inkex.py", line 221, in affect
    self.effect()
  File "param_curves.py", line 233, in effect
    self.options.drawaxis)))
  File "param_curves.py", line 72, in drawfunction
    f2 = eval('lambda t: ' + fy.strip('"'))
  File "<string>", line 2
    -
    ^

SyntaxError: invalid syntax
Title: Re: trouble drawing parametric curve hearts (Ragnar's tutorial)
Post by: brynn on February 14, 2015, 02:56:31 PM
Could it be related to custom default template?
Title: Re: trouble drawing parametric curve hearts (Ragnar's tutorial)
Post by: ragstian on March 05, 2015, 08:17:34 PM
Hi

brynn; Sorry for not replying to this earlier but have not seen your post before now! (By exploring your forum! So many hard to find nooks & crannies!)

Most likely you have been bit by the "comma vs. full stop as decimal separator" syndrome - or more unlikely - you have entered something incorrectly!

If you get the error when copying & pasting from here or the PDF file I would suggest you replace the commas with full stops in the dialog and try again. Please revert with your findings, might be necessary to update the guide.

Edit; I have tried unsuccessfully to replicate your error by "throwing in" errors "all over the  place" in the dialog both on 0.91 and 48.5 - seems inkscape can cope very well with both comma and full stop as decimal separator in this dialog.
Will keep trying!
Title: Re: trouble drawing parametric curve hearts (Ragnar's tutorial)
Post by: brynn on March 05, 2015, 09:37:42 PM
Thanks Ragnar  :D  I've seen some of the discussions of period vs comma on IF.  But it's always been periods (dots) on my system, with Inkscape.

Here are a couple of screenshots showing some of the icons you can use, to be alerted to new messages.  (attached) 

(icicons.png)  The green plus sign on a board (on the main forum index page) means there is a message in that board that you haven't seen.  For the orange "new" icon on the right, I realize you may have that block collapsed so that you can't see that "Recent Topics" block at all.  But by itself, that's one way to learn about new messages.  (Plus, they are shortcuts to those messages shown.)   It shows the orange "new" icon if you haven't read the message yet.

(new.png)  The orange "new" icon can also be seen on the board's index page, beside any topic which contains a new message that you haven't seen yet.