









 
 




 
 


I tried to make a simple circle by bezier_spline,
prism {
bezier_spline
0,.3,32,
<0.154,0.605>,<0.128,0.605>,<0.128,0.605>,<0.1105,0.6225>
<0.1105,0.6225>,<0.093,0.64>,<0.093,0.64>,<0.093,0.666>
<0.093,0.666>,<0.093,0.691>,<0.093,0.691>,<0.1105,0.709>
<0.1105,0.709>,<0.128,0.727>,<0.128,0.727>,<0.154,0.727>
<0.154,0.727>,<0.18,0.727>,<0.18,0.727>,<0.1975,0.709>
<0.1975,0.709>,<0.215,0.691>,<0.215,0.691>,<0.215,0.666>
<0.215,0.666>,<0.215,0.64>,<0.215,0.64>,<0.1975,0.6225>
<0.1975,0.6225>,<0.18,0.605>,<0.18,0.605>,<0.154,0.605>
pigment { color rgb<1,0,0>}
}
but instead of a circle, it gave me an octagon as it seems the control points
are connected instead of start and end points.
What is wrong with my setting <start,control1,control2,end>?
Note that I want to understand bezier_spline rather than finding an alternative
for creating a specific shape.
Post a reply to this message


 
 




 
 


"Kima" <nomail@nomail> wrote:
> I tried to make a simple circle by bezier_spline,
IIRC, you can't do it with a single spline, but can append 2 semicircle
approximations.
See if this helps any, and see if LeForgeron's wiki page helps any.
https://news.povray.org/povray.general/thread/%3Cweb.5c47356c36095c6fbe7517870%40news.povray.org%3E/
http://wiki.povray.org/content/User:Le_Forgeron
Post a reply to this message


 
 




 
 


hi,
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Kima" <nomail@nomail> wrote:
> > I tried to make a simple circle by bezier_spline,
>
> IIRC, you can't do it with a single spline, but can append 2 semicircle
> approximations.
> See if this helps any, and see if LeForgeron's wiki page helps any.
prisms with bezier_spline are also used in the distribution include file
'lemon.inc', under 'scenes/advanced/grenadine/'.
regards, jr.
Post a reply to this message


 
 




 
 


"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Kima" <nomail@nomail> wrote:
> > I tried to make a simple circle by bezier_spline,
>
> IIRC, you can't do it with a single spline, but can append 2 semicircle
> approximations.
>
> See if this helps any, and see if LeForgeron's wiki page helps any.
>
>
https://news.povray.org/povray.general/thread/%3Cweb.5c47356c36095c6fbe7517870%40news.povray.org%3E/
>
> http://wiki.povray.org/content/User:Le_Forgeron
I still don't understand why povray draws berzier curves this way.
Mathematically, the bezier curves of these points create a circle. See this
image
https://ibb.co/YykPGPM
Post a reply to this message


 
 




 
 


"Kima" <nomail@nomail> wrote:
> I still don't understand why povray draws berzier curves this way.
>
> Mathematically, the bezier curves of these points create a circle. See this
> image
> https://ibb.co/YykPGPM
POVRay ought to draw Bezier curves the way all Bezier curves are drawn.
I'm not sure what your image is supposed to show, as there's no mathematical
data that relate it to Bezier curves.
Maybe try:
https://stackoverflow.com/questions/1734745/howtocreatecirclewithb%C3%A9ziercurves
I've probably spent the last several years working on understanding Bezier
splines and patches.
Lods of mistakes and frustration and misconceptions, but eventually got it all
worked out in the end.
Tor Olav Kristensen (TOK) mentored me after I got my second wind and felt up to
attacking the topic again.
Cousin Ricky has a Bezier spline based sphere sweep in the object collection.
Jerome Grimbert (LeForgeron) likely also has some good Bezier spline/patch work
in his excellent collection of experiments.
Post a reply to this message


 
 




 
 


On 9/8/19 2:32 PM, Kima wrote:
> I tried to make a simple circle by bezier_spline,
>
> prism {
> bezier_spline
> 0,.3,32,
> <0.154,0.605>,<0.128,0.605>,<0.128,0.605>,<0.1105,0.6225>
> <0.1105,0.6225>,<0.093,0.64>,<0.093,0.64>,<0.093,0.666>
> <0.093,0.666>,<0.093,0.691>,<0.093,0.691>,<0.1105,0.709>
> <0.1105,0.709>,<0.128,0.727>,<0.128,0.727>,<0.154,0.727>
> <0.154,0.727>,<0.18,0.727>,<0.18,0.727>,<0.1975,0.709>
> <0.1975,0.709>,<0.215,0.691>,<0.215,0.691>,<0.215,0.666>
> <0.215,0.666>,<0.215,0.64>,<0.215,0.64>,<0.1975,0.6225>
> <0.1975,0.6225>,<0.18,0.605>,<0.18,0.605>,<0.154,0.605>
>
> pigment { color rgb<1,0,0>}
>
> }
>
> but instead of a circle, it gave me an octagon as it seems the control points
> are connected instead of start and end points.
>
> What is wrong with my setting <start,control1,control2,end>?
>
> Note that I want to understand bezier_spline rather than finding an alternative
> for creating a specific shape.
>
Your control points in each segment are identical.
The usual way to do circles with Bezier curves is with 4 segments using
the method from: Michael Goldapp, "Approximation of circular arcs by
cubic polynomials" Computer Aided Geometric Design (#8 1991 pp.227238).
I'm lazy and keep a point list created by this method for a circle at a
radius of 1.0 at the origin laying around  which I can scale, move etc.
So a circle within a circle to create a prism ring of sorts becomes:
#declare Cheese = srgb <1,0.65098,0>;
#declare Prism00 = prism {
bezier_spline
linear_sweep
0.2, 0.2, 32,
<1,0>,<1,0.552285>,<0.552285,1>,<0,1>
<0,1>,<0.552285,1>,<1,0.552285>,<1,0>
<1,0>,<1,0.552285>,<0.552285,1>,<0,1>
<0,1>,<0.552285,1>,<1,0.552285>,<1,0>
<0.5,0>,<0.5,0.276143>,<0.276143,0.5>,<0,0.5>
<0,0.5>,<0.276143,0.5>,<0.5,0.276143>,<0.5,0>
<0.5,0>,<0.5,0.276143>,<0.276143,0.5>,<0,0.5>
<0,0.5>,<0.276143,0.5>,<0.5,0.276143>,<0.5,0>
pigment { color Cheese }
}
Bill P.
Post a reply to this message


 
 




 
 


William F Pokorny <ano### [at] anonymousorg> wrote:
> On 9/8/19 2:32 PM, Kima wrote:
> > I tried to make a simple circle by bezier_spline,
> >
> > prism {
> > bezier_spline
> > 0,.3,32,
> > <0.154,0.605>,<0.128,0.605>,<0.128,0.605>,<0.1105,0.6225>
> > <0.1105,0.6225>,<0.093,0.64>,<0.093,0.64>,<0.093,0.666>
> > <0.093,0.666>,<0.093,0.691>,<0.093,0.691>,<0.1105,0.709>
> > <0.1105,0.709>,<0.128,0.727>,<0.128,0.727>,<0.154,0.727>
> > <0.154,0.727>,<0.18,0.727>,<0.18,0.727>,<0.1975,0.709>
> > <0.1975,0.709>,<0.215,0.691>,<0.215,0.691>,<0.215,0.666>
> > <0.215,0.666>,<0.215,0.64>,<0.215,0.64>,<0.1975,0.6225>
> > <0.1975,0.6225>,<0.18,0.605>,<0.18,0.605>,<0.154,0.605>
> >
> > pigment { color rgb<1,0,0>}
> >
> > }
> >
> > but instead of a circle, it gave me an octagon as it seems the control points
> > are connected instead of start and end points.
> >
> > What is wrong with my setting <start,control1,control2,end>?
> >
> > Note that I want to understand bezier_spline rather than finding an alternative
> > for creating a specific shape.
> >
> Your control points in each segment are identical.
>
> The usual way to do circles with Bezier curves is with 4 segments using
> the method from: Michael Goldapp, "Approximation of circular arcs by
> cubic polynomials" Computer Aided Geometric Design (#8 1991 pp.227238).
>
> I'm lazy and keep a point list created by this method for a circle at a
> radius of 1.0 at the origin laying around  which I can scale, move etc.
> So a circle within a circle to create a prism ring of sorts becomes:
>
> #declare Cheese = srgb <1,0.65098,0>;
> #declare Prism00 = prism {
> bezier_spline
> linear_sweep
> 0.2, 0.2, 32,
> <1,0>,<1,0.552285>,<0.552285,1>,<0,1>
> <0,1>,<0.552285,1>,<1,0.552285>,<1,0>
> <1,0>,<1,0.552285>,<0.552285,1>,<0,1>
> <0,1>,<0.552285,1>,<1,0.552285>,<1,0>
> <0.5,0>,<0.5,0.276143>,<0.276143,0.5>,<0,0.5>
> <0,0.5>,<0.276143,0.5>,<0.5,0.276143>,<0.5,0>
> <0.5,0>,<0.5,0.276143>,<0.276143,0.5>,<0,0.5>
> <0,0.5>,<0.276143,0.5>,<0.5,0.276143>,<0.5,0>
> pigment { color Cheese }
> }
>
> Bill P.
Thanks, Bill. I got it that the problem is my points, but your answer came
before I correct myself. Like your set, the controls should have identical x OR
y, but mine has both together, and that was the problem.
Post a reply to this message


 
 




 
 


On 08/09/2019 20:32, Kima wrote:
> but instead of a circle, it gave me an octagon as it seems the control points
> are connected instead of start and end points.
>
> What is wrong with my setting <start,control1,control2,end>?
>
> Note that I want to understand bezier_spline rather than finding an alternative
> for creating a specific shape.
A little reading there :
<https://stackoverflow.com/questions/1734745/howtocreatecirclewithb%C3%A9ziercurves>

Kurtz le pirate
Compagnie de la Banquise
Post a reply to this message


 
 




 

