使用贝塞尔曲线圈出近似值 [英] Circle approximations using Bezier curves

查看:139
本文介绍了使用贝塞尔曲线圈出近似值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两条关于贝塞尔曲线的问题,并用它们来近似圆的一部分。


  1. 给定单位圆弧(1,0)→(cos(a),sin(a)),其中0 < a<通过求解等式B(1/3)=(cos(a / 3))所施加的等式来求出贝塞尔曲线的控制点p1,p2,其结果是
    , ,sin(a / 3))
    和B(2/3)=(cos(2a / 3),sin(2a / 3))。 (换句话说,要求
    bezier曲线经过圆弧中两个均匀间隔的点)。如果我们有仿射变换A这将变成一个
    椭圆弧中的圆弧,转换后的控制点Ap0,Ap1,Ap2,Ap3将定义
    a好的贝塞尔逼近椭圆弧吗?

p0和p3当然是曲线的起点和终点:(1,0)和(cos(a),sin(a))。

谢谢

解决方案

任何椭圆弧的一般解法作为三次贝塞尔曲线。

误差最大程度上取决于开始角度和结束角度的差异。通过将角度差限制在60°,我获得了很好的成功。也就是说,我每隔60°就做一个单独的立方部分。 (或其部分)并将它们链接在一起。

I have 2 questions about bezier curves, and using them to approximate portions of circles.

  1. Given the unit circle arc (1,0)->(cos(a),sin(a)) where 0 < a < pi/2, will it result in a good approximation of this arc to find the bezier curve's control points p1, p2 by solving the equations imposed by the requirements B(1/3) = (cos(a/3), sin(a/3)) and B(2/3) = (cos(2a/3), sin(2a/3)). (In other words, requiring that the bezier curve go through two evenly spaced points in the arc).

  2. If we have an affine transformation A which turns the circle arc in an ellipse arc will the transformed control points Ap0, Ap1, Ap2, Ap3 define a good bezier approximation to the ellipse arc?

p0 and p3, of course, are the start and end points of the curve: (1,0) and (cos(a), sin(a)).

Thank you

解决方案

Here's a general solution for any elliptical arc as a cubic Bezier curve.

The error is most dependent on the difference of the start and end angles. I've had good success by limiting the angle difference to 60°. That is, I make a separate cubic segment for every 60° (or fraction thereof) and chain them together.

这篇关于使用贝塞尔曲线圈出近似值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆