如何在svg中的三个点之间绘制polyLine,并且应该看起来像所附图像中的曲线。我用红色的虚线标出了三个点,使用它可以像图中一样获得一条折线
enter code here
var X = (1 - t) * p0.X + t * p1.X;
var Y = (1 - t) * p0.Y + t * p1.Y;
我使用上面的公式来计算点(在我的控制点之间计算256个点以获得平滑多段线),以便使用我的三个控制点绘制多段线。但它不起作用
您需要在path元素上设置fill =“ none”以及适当的笔触属性。
Also, you shouldn't need to do any math for this: just setting the d attribute to "M" + the (space/comma separated) X and Y of the first point + "T" + the (space/comma separated) X and Y of the second and third point should be enough.
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句