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

在 svg-path-commander 2.0 中,lineToCubic更新为了一个更简单的算法 #102

Closed
entronad opened this issue Mar 3, 2023 · 2 comments

Comments

@entronad
Copy link

entronad commented Mar 3, 2023

在 svg-path-commander 2.0 中,lineToCubic更新为了一个更简单的算法:
thednp/svg-path-commander@1757702#diff-a7563e18ea440e76d4aa2b638cd044a860e08c1e297ddbc8745fdc296d808e82

现在这个算法我觉得挺合理的,因为事先不知道line变成cubic后要去变换成的曲线是什么样子的,所以事先去精细的计算两个控制点的分位似乎没必要是一种过度优化,只要在线段上就行了(各在1/3, 2/3分位似乎也挺好?)

老实说,它之前那个算法为什么要大费周章从p0算到p6的我不太理解,而且传入segmentLineFactory的参数数目都对不上(我看到你们截取了前面几个数目对上了,但似乎含义还是对不上)

@entronad
Copy link
Author

entronad commented Mar 3, 2023

作者说原先那个是错的:
thednp/svg-path-commander#25

@xiaoiver
Copy link
Contributor

v3.3.4 is published.

xiaoiver added a commit that referenced this issue Jul 25, 2023
* fix: update line2cubic algorithm #102

* chore: bump version
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