What is the algorithm to convert a quadratic bezier (with 3 points) to a cubic one (with 4 points)?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
From http://fontforge.sourceforge.net/bezier.html:
Any quadratic spline can be expressed as a cubic (where the cubic term is zero). The end points of the cubic will be the same as the quadratic's.
CP0 = QP0
CP3 = QP2The two control points for the cubic are:
CP1 = QP0 + 2/3 *(QP1-QP0)
CP2 = QP2 + 2/3 *(QP1-QP2)...There is a slight error introduced due to rounding, but it is unlikely to be noticeable.