Skip to content

[svgfig 2.0alpha2] problem with function smooth (pathdata.py) #11

@GoogleCodeExporter

Description

@GoogleCodeExporter
The function smooth in pathdata.py doesn't seem to work correct.
It doesnt return a list which can be used for the "d" attribute in SVG("path")

furthermore adding loop=true as keyword argument throws an TypeError exception

What steps will reproduce the problem?
>>> s_p = smooth((1, 0), (2, 1), (3, 2))
>>> print s_p
[('M', (1, 0, 0.0, 0.0), (2, 1, 1.0, 1.0))]

>>> s_p = smooth((1, 0), (2, 1), (3, 2), loop=True)
>>> print s_p
Exception:......

What is the expected output? What do you see instead?
In the first case:
[('M', 1, 0), ('C', 1.0, 0.0, 1.6666666666666667, 0.66666666666666674, 2,
1),('C', 2.3333333333333335, 1.3333333333333333, 3.0, 2.0, 3, 2)]

In the second case:
[('M', 1, 0), ('C', 0.83333333333333337, -0.16666666666666666,
1.6666666666666667, 0.66666666666666674, 2, 1), ('C', 2.3333333333333335,
1.3333333333333333, 3.1666666666666665, 2.1666666666666665, 3, 2), ('C',
2.8333333333333335, 1.8333333333333333, 1.1666666666666667,
0.16666666666666666, 1, 0), ('Z',)]


What version of the product are you using? On what operating system?
"SVGFig 2.0.0alpha2; From SVN r365
python '2.5.4 (r254:67916, Mar  7 2009, 17:19:39) \n[GCC 4.2.1 20070719 
[FreeBSD]]'
FreeBSD 7.1-RELEASE-p3

Please provide any additional information below.

The (helper) function velocity isn't called with the right arguments from
smooth.
The call on line 144 of file pathdata.py should read:
return velocity(loop=loop, *zip(x, y, vx, vy))

instead of:
return velocity(zip(x, y, vx, vy), loop)

I didnt check the svgfig 1.x version


Original issue reported on code.google.com by Franz...@gmail.com on 25 Jun 2009 at 7:20

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions