平滑多边形Smoothed polygons
本文延续了 p-范数单位圆的研究,探讨如何用三个函数 Li(x,y) 构造出介于圆形与方形之间的平滑多边形。当 p=2 时为标准圆,p→∞ 时趋近于正方形。这些函数通过调整参数 p 可实现任意边数的平滑过渡形状,为计算机图形学中的抗锯齿与形状建模提供数学工具。
John
The previous post constructed a triangular analog of the squircle, the unit circle in the p-norm where p is typically around 4. The case p = 2 is a Euclidean circle and the limit as p → ∞ is a Euclidean square.
The previous post introduced three functions Li(x, y) such the level set of each function
forms a side of a triangle. Then it introduced a soft penalty for each L being away 1, and the level sets of that penalty function formed the rounded triangles we were looking for.
Another approach would be to change the L‘s slightly so that the sides are the levels sets Li(x, y) = 0. The advantage to this formulation is that the product of three numbers is 0 if and only if one of the numbers is zero. That means if we define
then the set of points
corresponds to the three lines when c = 0 and the level sets for small c > 0 are nearly triangles. The level sets will be smooth if the gradient is non-zero, i.e. c is not zero.
This approach is not unique to triangles. You could create smooth approximations any polygon by multiplying linear functions that define the sides. Or you could do something similar with curved arcs.
If we define our L’s by
then our curves will be the level sets of
A few level sets are shown below. The level set for c = 0 is the straight lines.
Note the level sets are not connected. If you’re interested in approximate triangles, you want the components that are inside the triangle.
需要完整排版与评论请前往来源站点阅读。