|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi,
I'm making a macro that involves a bezier_spline prism. What I need to know
is how I should place the control points of a bezier spline to make it
resemble a quarter circle as closely as possible.
Just to clarify, this is how they points are placed:
O-------o
o
|
|
|
O
Big O's are endpoints, small o's control points. If I place the control
points halfway to the corner I come pretty close to a circle, but I hope
there is a more mathematical way to do it, I'm not very fond of guessing :)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Sebastian Strand wrote:
>
> Hi,
>
> I'm making a macro that involves a bezier_spline prism. What I need to know
> is how I should place the control points of a bezier spline to make it
> resemble a quarter circle as closely as possible.
>
> Just to clarify, this is how they points are placed:
> O-------o
>
> o
> |
> |
> |
> O
>
> Big O's are endpoints, small o's control points. If I place the control
> points halfway to the corner I come pretty close to a circle, but I hope
> there is a more mathematical way to do it, I'm not very fond of guessing :)
There is. If r is the radius of the quarter circle, then the distance from
the little-o control points to its big-O control point will be:
4/3*(sqrt(2)-1) * r
The spline will be an exact quarter circle. Your spline might look like:
Hope this helps,
John
--
ICQ: 46085459
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Sat, 15 Apr 2000 19:50:55 -0400, John VanSickle wrote:
>There is. If r is the radius of the quarter circle, then the distance from
>the little-o control points to its big-O control point will be:
>
> 4/3*(sqrt(2)-1) * r
>
>The spline will be an exact quarter circle. Your spline might look like:
In the MetaFont Book, IIRC, Knuth states that it's impossible to create
a circle using Bezier curves. Is this not true?
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
These are my opinions. I do NOT speak for the POV-Team.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"John VanSickle" <van### [at] erolscom> wrote in
news:38F9005F.7562EA25@erols.com...
> There is. If r is the radius of the quarter circle, then the distance
from
> the little-o control points to its big-O control point will be:
>
> 4/3*(sqrt(2)-1) * r
Thanks, works perfectly.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 16 Apr 2000 00:04:26 -0400, ron### [at] povrayorg (Ron Parker) wrote:
>On Sat, 15 Apr 2000 19:50:55 -0400, John VanSickle wrote:
>>There is. If r is the radius of the quarter circle, then the distance from
>>the little-o control points to its big-O control point will be:
>>
>> 4/3*(sqrt(2)-1) * r
>>
>>The spline will be an exact quarter circle. Your spline might look like:
>
>In the MetaFont Book, IIRC, Knuth states that it's impossible to create
>a circle using Bezier curves. Is this not true?
I also thought that it was impossible to get an exact circular arc represention
using Bezier curves, but I have just used John's expression to render a bezier
prism overlaid with a cylinder. With a difference in radius of 0.001, using an
orthographic camera and AA I get a uniformly thick line of difference. So
experimentally anyway, John's expression is good enough for me.
I have been faced with the problem in the past of a near approximation to a
circular arc using Bezier curves and your expression John, is a great help.
Thanks
David
dav### [at] hamiltonitecom
http://www.hamiltonite.com/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Ron Parker wrote:
>
> On Sat, 15 Apr 2000 19:50:55 -0400, John VanSickle wrote:
> >There is. If r is the radius of the quarter circle, then the
> >distance from the little-o control points to its big-O control point
> >will be:
> >
> > 4/3*(sqrt(2)-1) * r
> >
>
> In the MetaFont Book, IIRC, Knuth states that it's impossible to
> create a circle using Bezier curves. Is this not true?
It is indeed impossible to create an entire circle with a single
Bezier curve. However, the Bezier above creates a quarter of a
circle. I did the math two or three years back, and it boiled
down to a constant radius over that quarter circle.
Regards,
John
--
ICQ: 46085459
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Sun, 16 Apr 2000 22:09:55 -0400, John VanSickle wrote:
>Ron Parker wrote:
>>
>> On Sat, 15 Apr 2000 19:50:55 -0400, John VanSickle wrote:
>> >There is. If r is the radius of the quarter circle, then the
>> >distance from the little-o control points to its big-O control point
>> >will be:
>> >
>> > 4/3*(sqrt(2)-1) * r
>> >
>>
>> In the MetaFont Book, IIRC, Knuth states that it's impossible to
>> create a circle using Bezier curves. Is this not true?
>
>It is indeed impossible to create an entire circle with a single
>Bezier curve. However, the Bezier above creates a quarter of a
>circle. I did the math two or three years back, and it boiled
>down to a constant radius over that quarter circle.
Here's the quote I was looking for, from Chapter 3 of the MetaFont Book:
For example, the four-point method can produce an approximate
quarter-circle with less than 0.06% error; it never yields an
exact circle, but the difference between four such quarter-
circles and a true circle are imperceptible.
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
These are my opinions. I do NOT speak for the POV-Team.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
John VanSickle wrote:
>
> Sebastian Strand wrote:
> >
> > Hi,
> >
> > I'm making a macro that involves a bezier_spline prism. What I need to know
> > is how I should place the control points of a bezier spline to make it
> > resemble a quarter circle as closely as possible.
> >
> > Just to clarify, this is how they points are placed:
> > O-------o
> >
> > o
> > |
> > |
> > |
> > O
> >
> > Big O's are endpoints, small o's control points. If I place the control
> > points halfway to the corner I come pretty close to a circle, but I hope
> > there is a more mathematical way to do it, I'm not very fond of guessing :)
>
> There is. If r is the radius of the quarter circle, then the distance from
> the little-o control points to its big-O control point will be:
>
> 4/3*(sqrt(2)-1) * r
>
> The spline will be an exact quarter circle. Your spline might look like:
>
> Hope this helps,
> John
> --
> ICQ: 46085459
For my app, D-form (http://www.geocities.com/dkrota/D-form.html) I
searched for this formula but never found it.
Thanks!
Did you have also the formula for an half circle???
Regards
(---------------------------------------------------------------)
( Diego Krota http://www.geocities.com/SiliconValley/Way/2419 )
(---------------------------------------------------------------)
( Never do anything you wouldn't be caught dead doing )
(---------------------------------------------------------------)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In povray.general, ron### [at] povrayorg said:
> On Sat, 15 Apr 2000 19:50:55 -0400, John VanSickle wrote:
> >There is. If r is the radius of the quarter circle, then the distance from
> >the little-o control points to its big-O control point will be:
> >
> > 4/3*(sqrt(2)-1) * r
> >
> >The spline will be an exact quarter circle. Your spline might look like:
>
> In the MetaFont Book, IIRC, Knuth states that it's impossible to create
> a circle using Bezier curves. Is this not true?
Yes, taht is indeed sure but in a strict mathematical sense.
A bezier spline, which is a third degree polynomial, cannot closely
approximate a circle segment, which is described by a second degree
>rational< polynomial.
However the maximum error you have by approximating a circle segment with a
bezier spline with John VanSickle control points configuration is of the
order of 0.01 (I don't remember the exact value) which is should be
unnoticeable to the eye for practical rendering purposes.
The only critical situation which comes to my mind is possible seaming
cracks between cylinders or spheres and objects using bezier spline form.
Alessandro
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|