Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QuadraticBezier segment length() function gives 'inf' as result #186

Open
xmarduel opened this issue Sep 16, 2022 · 1 comment
Open

QuadraticBezier segment length() function gives 'inf' as result #186

xmarduel opened this issue Sep 16, 2022 · 1 comment

Comments

@xmarduel
Copy link

for the points:
st = (335.43211 + 69.71516199999999j)
end = (335.27971 + 69.86756199999999j)
ctrl = (335.33051+ 69.816762j)
segment= svgpathtools.QuadraticBezier(st, ctrl, end)
len = segment.length() # len is 'inf' !!!

Note that for the points:
st = (335.43211 + 69.715162j)
end = (335.27971 + 69.867562j)
ctrl = (335.33051 + 69.816762j)
the length of the segment is ok : 0.21552614690565985

[python-3.10]

Sincerely,
XM

@MaybeJustJames
Copy link

MaybeJustJames commented Dec 21, 2022

I have another test case:

  • svgpathtools = 1.5.1
  • Python 3.11.1
import svgpathtools

from svg.path import path as svgpath


def bad():
    path = svgpathtools.QuadraticBezier(
        start=(46 + 125j), control=(45.8 + 124.6j), end=(45.7 + 124.4j)
    )
    return path.length()


def good():
    path = svgpath.QuadraticBezier(
        start=(46 + 125j), control=(45.8 + 124.6j), end=(45.7 + 124.4j)
    )
    return path.length()


assert bad() == good()

This is parsed from the path "M 46.0 125.0 Q 45.8 124.6, 45.7 124.4"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants