Author Topic: trouble drawing parametric curve hearts (Ragnar's tutorial)  (Read 8746 times)

February 14, 2015, 05:32:04 AM
Read 8746 times

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Hi Friends,
I was just using Ragnar's tutorial 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

  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

February 14, 2015, 01:44:53 PM
Reply #1

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
I assume by the syntax error you didn't close all opened brackets.

February 14, 2015, 02:15:10 PM
Reply #2

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
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.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

February 14, 2015, 02:29:08 PM
Reply #3

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
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.

February 14, 2015, 02:54:44 PM
Reply #4

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
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
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

February 14, 2015, 02:56:31 PM
Reply #5

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Could it be related to custom default template?
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

March 05, 2015, 08:17:34 PM
Reply #6

ragstian

  • IC Mentor

  • Offline
  • ******

  • 25
  • Gender
    Male

    Male
  • Personal Text
    Forum Newbie
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!
Good Luck!
RGDS
Ragnar

March 05, 2015, 09:37:42 PM
Reply #7

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
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.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann