POV-Ray : Newsgroups : povray.general : Bezier spline approximations to circles : Bezier spline approximations to circles Server Time
26 Apr 2024 15:12:02 EDT (-0400)
  Bezier spline approximations to circles  
From: JimT
Date: 22 Jan 2019 10:25:00
Message: <web.5c47356c36095c6fbe7517870@news.povray.org>
Just so it didn't get lost in an old post...

I was in a rush when I replied last time and didn't have this to hand. Second
installment.

If you want a Bezier Spline approximation to an arc of a circle subtending angle
theta at the centre, the four control points are

(1,0), (1,a), (cos(theta) + asin(theta),sin(theta) -
acos(theta)),(cos(theta),sin(theta))

where a = (8/3)(sin(theta/2) - sin(theta)/2)/(1-cos(theta))

As mentioned before, this is tangent to the circle at theta/2 as well as the
endpoints and outside the circle otherwise.  For theta = pi/2 the defect is
0.03% of the radius. For theta = pi it is 1.8%, still not bad, but for theta =
5pi/4 it is an unusable 7.6%.

Tweaking a to have the spline cross the circle twice reduces the error only to
about 70% of the value given and is probably not worth it.

If anyone wants code for a single segment Bezier Spline sphere sweep, I will
post it again, since the last time was years ago.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.