等距曲线的绘制方法
我在 mathoverflow 上发布了这个问题,但我也想知道您对此的看法。我想要做的是绘制一条曲线,该曲线始终与给定曲线的表面法线保持一定距离。我知道给定曲线的公式(分段三次样条)。问题似乎是当偏差距离大于曲线半径时 - 点会变得混乱。有没有人遇到过这样的问题。有好的解决办法吗?
感谢您的任何想法,
Iulian
稍后:巫师先生在下面完美地描述了这个问题。
I posted this question on mathoverflow but I want to know your opinion regarding this also. What I want to do is to draw a curve that is always at a certain distance from the normal to the surface of a given curve. I know the formula of the given curve (a piecewise cubic spline). The problem appears to be when the deviation distance is more than the radius of the curve - the points get scrambled. Has anyone encountered such problem. Is there a nice solution?
Thanks for any ideas,
Iulian
LATER: The problem is perfectly described below by Mr. Wizard.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您的定义会遇到麻烦:“...绘制一条曲线,该曲线始终与给定曲线的表面法线保持一定距离。”
如果您在凹曲线内绘制一系列线条,则在某个时刻,线条将自行折叠,最终形成几何反转。
应用于椭圆,例如:
I think you will run into trouble with your definition: "... draw a curve that is always at a certain distance from the normal to the surface of a given curve."
If you draw a series of lines inside a concave curve, at some point the line will fold back on itself, ultimately creating a geometric inversion.
Applied to an ellipse, for example:
编辑:注意:这个答案并不是为了避免拐角包裹(这是严格等距曲线的一个特征)。
根据维基百科,
因此,您必须使用启发式方法来获得近似值。有一篇学术论文,名为比较偏移量曲线近似方法,包括 9 种算法的比较。
如果您想跳过研究而只是获得解决方案,请查看此描述 De Casteljau 算法实现的博客文章。 编辑:我必须承认,我不确定这个实现在急转弯时的表现如何。
EDIT: NOTE: This answer isn't about avoiding corner-wrapping (which is a feature of strict equidistant curves).
According to Wikipedia,
So, there are heuristic methods that you'll have to use to get an approximation. There's an academic paper called Comparing offset curve approximation methods including a comparison of 9 algorithms.
If you want to skip the research and just get a solution, take a look at this blog post describing an implementation of De Casteljau's algorithm. EDIT: I have to admit that I'm not sure how this implementation behaves with sharp turns.