POV-Ray : Newsgroups : povray.advanced-users : Smooth, continuous Bezier splines (again) Server Time
5 Feb 2025 15:14:30 EST (-0500)
  Smooth, continuous Bezier splines (again) (Message 14 to 23 of 23)  
<<< Previous 10 Messages Goto Initial 10 Messages
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

From: ingo
Subject: Re: Smooth, continuous Bezier splines (again)
Date: 30 Jan 2025 10:10:00
Message: <web.679b962a96675d9f17bac71e8ffb8ce3@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

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

Dig. Dig deeper.


Yes, SDL is slow when one cannot use functions. This is why I implemented the
meshmakermacros and the curves in Nim, but have not married them.

https://gist.github.com/ingoogni/490d2d50710bab4fe5e689714e9ef287

for mesh it is easy, generate and use, for splines it realy depends on the use,

ingo


Post a reply to this message

From: Bald Eagle
Subject: Re: Smooth, continuous Bezier splines (again)
Date: 30 Jan 2025 17:35:00
Message: <web.679bfd9d96675d9f1f9dae3025979125@news.povray.org>
That approach was also close to what I was doing, however it doesn't match the
curvature of the spline segments at the endpoints.

Visually, it still looked too flat-then rounded-then flat-then rounded....

Although I didn't pore over your code yet, I quickly skimmed it to see where the
control points were calculated, and then bolted on my curvature comb code to
visualize the curvature over all of the spline segments.

You can see where the mismatches are.

So I still think I have to degree elevate and then I can mirror the additional
control points to get the curvature to match.

(Also, FYI: the point/tip is actually a hard point.  So 2 separate composite
splines - 1 on the left and 1 on the right)

I'll see if I have enough time to patch in my degree elevation code and extend
the control-point mirroring that one extra "level" into the splines.

- BW


Post a reply to this message


Attachments:
Download 'tok spline curvature.png' (160 KB)

Preview of image 'tok spline curvature.png'
tok spline curvature.png


 

From: Leroy
Subject: Re: Smooth, continuous Bezier splines (again)
Date: 1 Feb 2025 14:50:00
Message: <web.679e79e196675d9f65a8eed3f712fc00@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> I've got a diagram of where measured points should be along a CURVE that
> describes the profile of a solid edge.

 I came late to this, After I reading all the other inputs, I thought I'd throw
my two cents in. I wrote a win program a long time ago to make prisms and
polygons for POV. PolPrm.exe it's at http://leroyw.byethost15.com with the rest
of my window program I wrote for POV.

I wrote in mainly so I could switch the between different types of prisms and
polygons as needed. It started as a simple project with limited options and a
small working area. After using for it awhile I started adding things to make
life easier. I put in a few predefined shapes, set it so I could dump the data
into an array file, and a bunch of little things.
 The last time I upgraded, it started because someone in this forum wanted to
know how to make a circle out of a prism. I'd like to have that in PolPrm. So
after figuring out how to make the circle, I went on a building spree. I add
more curve shapes, made it where can split a shape in two, combine two shapes
into one,and finally made the long over due undo function. I swore that this was
the last upgrade.
 When I saw your shape I said 'that would fit nicely in PolPrm'. You see PolPrm
still has a small working area 2*2 pov units square. Then reading all the
messages it seamed that what you wanted is the math or a least the conversation
went that way. But I went ahead and put a shape similar to yours in PolPrm and
play around with it. That's when I realize PolPrm wasn't really made for
precision. It make custom shapes very well.
 Another thing I learned after reading all this forum messages is that the real
reason I wrote PolPrm is that I didn't want to the math every time  I made a
prism.

Have Fun!


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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