POV-Ray : Newsgroups : povray.advanced-users : Smooth, continuous Bezier splines (again) Server Time
5 Feb 2025 15:13:56 EST (-0500)
  Smooth, continuous Bezier splines (again) (Message 11 to 20 of 23)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 3 Messages >>>
From: William F Pokorny
Subject: Re: Smooth, continuous Bezier splines (again)
Date: 29 Jan 2025 15:02:39
Message: <679a895f$1@news.povray.org>
On 1/29/25 13:27, Tor Olav Kristensen wrote:
>> Perhaps time to add an inbuilt f_bezier_cubic() to yuqk too. 🙂
> Yes, that would be nice.
> 
> Then comes the question if adding f_bezier_quadratic() and f_bezier_quartic()
> also is a good idea.
> 
> And then if the various derivative functions of them should be added...

I've grabbed code over time for some 2D functions I planned to call 
f_bezier_2d_quartic() and f_bezier_2d_quintic().

Do you have - or know of - 3D code for either of these?

Or for a 3D quadratic?  I might have the quadratic 3D form in my notes 
notes somewhere or in my TCL wrapper script (where I'd coded up some 
simpler spline by segment types maybe 15 years ago). I wonder if 
quadratic that useful excepting having better performance?

FYI. As yuqk inbuilt functions the convenient versions (packed vectors) 
for 3D forms would be limited to a -10 to +10 box and single float 
accuracy rather than double for the any 2D forms.

As for the derivative forms, if you have code in hand, maybe we do a few 
  near term? I don't have anything ready to go.

The question too is whether some of this 'spline stuff' better fits in 
spline{} like SDL feature - one supporting the Bezier segment control 
point forms. We can describe many segment curves, function wrap, but 
what we can do dynamically from the render time VM is limited.

Aside: Jerome coded up a bunch of spline extensions in his hgpovray38 
fork (which 'maybe' came from megapov?). I don't recall any additional 
Bezier support, but my memory is not great these days.

Bill P.


Post a reply to this message

From: Bald Eagle
Subject: Re: Smooth, continuous Bezier splines (again)
Date: 29 Jan 2025 15:30:00
Message: <web.679a8f9996675d9f327467e125979125@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:

> I've grabbed code over time for some 2D functions I planned to call
> f_bezier_2d_quartic() and f_bezier_2d_quintic().
>
> Do you have - or know of - 3D code for either of these?
>
> Or for a 3D quadratic?

Maybe I'm misunderstanding, but:
They're not dimensional - they're parametric.
Take any N-D point and the spline just interpolates ALL of the dimensions with
the same equations.
Right?


Post a reply to this message

From: Bald Eagle
Subject: Re: Smooth, continuous Bezier splines (again)
Date: 29 Jan 2025 15:50:00
Message: <web.679a939896675d9f327467e125979125@news.povray.org>
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:

> The code below shows the results of what I think Ingo suggested.

Thank you.  I thought this would grab your attention - however I was hoping to
get some free time to do something with it before you submitted the solution!
:D
Too late.  You win.

I'll take a look when I get home in an hour.


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Smooth, continuous Bezier splines (again)
Date: 29 Jan 2025 16:30:00
Message: <web.679a9cb296675d9f5ad2295d89db30a9@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
>
> > The code below shows the results of what I think Ingo suggested.
>
> Thank you.  I thought this would grab your attention - however I was hoping to
> get some free time to do something with it before you submitted the solution!
> :D
> Too late.  You win.
>
> I'll take a look when I get home in an hour.

  ;)

Ingo is guilty too..

You are aware that you do not HAVE to look at my code, or?

You have probably noticed that I have only provided a 2D solution, with all the
points within a XY-plane.

Now, if you like a little extra challenge, you can rewrite the code so that it
can provide a full 3D solution.

--
Tor Olav
http://subcube.com
https://github.com/t-o-k


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Smooth, continuous Bezier splines (again)
Date: 29 Jan 2025 19:10:00
Message: <web.679ac2e996675d9fcc90517889db30a9@news.povray.org>
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
>...
> You have probably noticed that I have only provided a 2D solution, with all the
> points within a XY-plane.
>
> Now, if you like a little extra challenge, you can rewrite the code so that it
> can provide a full 3D solution.

That is actually not a simple challenge: There are difficult decisions to
be made if 3 of the given points lies on a line.

A simpler challenge is to change the code so that your endpoints are joined
smoothly too.

--
Tor Olav
http://subcube.com
https://github.com/t-o-k


Post a reply to this message

From: ingo
Subject: Re: Smooth, continuous Bezier splines (again)
Date: 30 Jan 2025 01:10:00
Message: <web.679b173f96675d9f17bac71e8ffb8ce3@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:

> The question too is whether some of this 'spline stuff' better fits in
> spline{} like SDL feature -

ABX has added several splines / curves in the past to MegaPov, Akima, x_spline,
TCB (Kochanek/Bartels), SOR spline and maybe even circle spline based on Ron
Parker's torus spline include file.

interpolate{} always seemed a more fitting keyword to me, even dough I didn't
use it in my curves.inc ( https://ingoogni.nl/download/Curve.zip )

ingo


Post a reply to this message

From: William F Pokorny
Subject: Re: Smooth, continuous Bezier splines (again)
Date: 30 Jan 2025 07:58:30
Message: <679b7776$1@news.povray.org>
On 1/30/25 01:07, ingo wrote:
> interpolate{} always seemed a more fitting keyword to me, even dough I didn't
> use it in my curves.inc (https://ingoogni.nl/download/Curve.zip )

Thanks for the reminder - should be useful. I see, for example, you have 
the quadratic bezier. When I checked I had a copy of your latest 
Curve.zip already stored locally in my Ingo directory.

Some of what you have in there does look more like interpolation within 
the constraints of a curve segment's form. I'll have to play those end 
point velocity control settings.

Rabbit hole...

Bill P.


Post a reply to this message

From: Bald Eagle
Subject: Re: Smooth, continuous Bezier splines (again)
Date: 30 Jan 2025 09:10:00
Message: <web.679b880396675d9f25b4de9225979125@news.povray.org>
"ingo" <nomail@nomail> wrote:
> William F Pokorny <ano### [at] anonymousorg> wrote:

> > The question too is whether some of this 'spline stuff' better fits in
> > spline{} like SDL feature -


> interpolate{} always seemed a more fitting keyword to me, even dough I didn't
> use it in my curves.inc ( https://ingoogni.nl/download/Curve.zip )


Well - I'm of two minds on this.
1. Yes, I suppose that formally, all of this would conceptually best be grouped
into the spline {} portions of the code.

however:

2. Using a spline in a user-defined SDL function would kill speed, would it not?
(I can also envision that if <x, y, z> were able to be plugged into splines at
render time, someone, somewhere would come up with some amazing thing to do with
that.)

However gets it done faster, or at all, is fine with me.

(This topic also suggests that looking into making array elements available to
functions might be something to look at as well.  After all, if splines can be
used in functions, why can't arrays be used - assuming that the element is of a
type able to be processed by a function {} )


Post a reply to this message

From: ingo
Subject: Re: Smooth, continuous Bezier splines (again)
Date: 30 Jan 2025 09:15:00
Message: <web.679b88a596675d9f17bac71e8ffb8ce3@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:

> Rabbit hole...

good place to hord obscure POV-Ray include files ;)

ingo


Post a reply to this message

From: Bald Eagle
Subject: Re: Smooth, continuous Bezier splines (again)
Date: 30 Jan 2025 09:30:00
Message: <web.679b8c2f96675d9f25b4de9225979125@news.povray.org>
"ingo" <nomail@nomail> wrote:
> William F Pokorny <ano### [at] anonymousorg> wrote:
>
> > Rabbit hole...
>
> good place to hord obscure POV-Ray include files ;)
>
> ingo

"What does Fn_RabbitHole () do?  I can't find it in the docs . . ."


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 3 Messages >>>

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