dntzhang / pasition

Path Transition with little JS code, render to anywhere - 轻量级 Path 过渡库,渲染到任何地方
https://dntzhang.github.io/pasition/
1.21k stars 94 forks source link

算法上有点疑惑 #5

Closed Rowandjj closed 6 years ago

Rowandjj commented 6 years ago

Hi,最近看了下pasition的算法,有个疑惑的地方:

2018-07-18 3 00 16

_preprocessing 函数中有个splitCurves的操作,我理解目的应该是让两个path的curves的数目保持一致,但是这里为啥MIN_CURVES_COUNT=100的限制,假设curves的长度很小,那么会填充到100的长度,这个过程应该很耗时吧?

dntzhang commented 6 years ago

确实耗时,但是没想象中耗时,计算量不大,分割得越多最短路径找得越准确。