我看到这篇文章:
(https://pythongraphicgames.wordpress.com/tag/curved-line/),我想知道 Tkinter 使用什么插值算法来创建曲线。立方体?隐士?余弦?有没有办法可以指定这一点?
最佳答案
它使用贝塞尔算法。
线和多边形对象具有用于控制平滑的smooth
选项。这就是canonical documentation关于该选项的说明:
-smooth smoothMethod : smoothMethod must have one of the forms accepted by Tcl_GetBoolean or a line smoothing method. Only true and raw are supported in the core (with bezier being an alias for true), but more can be added at runtime. If a boolean false value or empty string is given, no smoothing is applied. A boolean truth value assumes true smoothing. If the smoothing method is true, this indicates that the line should be drawn as a curve, rendered as a set of quadratic splines: one spline is drawn for the first and second line segments, one for the second and third, and so on. Straight-line segments can be generated within a curve by duplicating the end-points of the desired line segment. If the smoothing method is raw, this indicates that the line should also be drawn as a curve but where the list of coordinates is such that the first coordinate pair (and every third coordinate pair thereafter) is a knot point on a cubic Bezier curve, and the other coordinates are control points on the cubic Bezier curve. Straight line segments can be generated within a curve by making control points equal to their neighbouring knot points. If the last point is a control point and not a knot point, the point is repeated (one or two times) so that it also becomes a knot point.
关于python - Tkinter 对曲线使用什么插值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62836960/