POV-Ray : Newsgroups : povray.general : Ribbon following spline Server Time
1 Nov 2024 15:28:54 EDT (-0400)
  Ribbon following spline (Message 1 to 10 of 10)  
From: kurtz le pirate
Subject: Ribbon following spline
Date: 31 Dec 2015 05:06:00
Message: <5684fe08$1@news.povray.org>
hello,

i would try to make a ribbon that follows a curve defined by a 3d spline.

which method to use?

thanks


---
kurtz le pirate
compagnie de la banquise


Post a reply to this message

From: Le Forgeron
Subject: Re: Ribbon following spline
Date: 31 Dec 2015 08:39:49
Message: <56853025$1@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Le 31/12/2015 11:05, kurtz le pirate a écrit :
> 
> hello,
> 
> i would try to make a ribbon that follows a curve defined by a 3d
> spline.
> 

You mean 2 3D splines,... either both edges of the ribbon, or one
edge/center and the normal of the ribbon and its width, or similar.

A single 3D spline is not enough for a ribbon.

> which method to use?
> 

I would have a look at parametric, probably with precompute, and
functions extracting the component of the splines.

On the u coordinate, the position on the ribbon.
On the v coordinate, the wide of the ribbon.

> thanks
> 
> 
> --- kurtz le pirate compagnie de la banquise

Bonne année.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iJwEAQEIAAYFAlaFMCQACgkQhKAm8mTpkW2qNgP+IpFPn//GQ3p9aUrCObQHh7ZL
jo7FeZXGe8/XdpbzCmhGxXvQ957yKjePtgGR8qF1pqPUayZ7CVFw+nbrZR2PSEDs
Adns2OLD6yurrdvykK+RDRZQu9CmuesK83Nn0/pAjhlw85I/2SN2E1lI+K2UjbVX
D3Td/vwrNynmdjrQZEY=
=sbDE
-----END PGP SIGNATURE-----


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Ribbon following spline
Date: 31 Dec 2015 21:55:00
Message: <web.5685e9816378af8062f88d070@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:
> hello,
>
> i would try to make a ribbon that follows a curve defined by a 3d spline.
>
> which method to use?

Are you thinking of something similar to what is shown in this thread ?

http://news.povray.org/povray.binaries.images/thread/%3Cweb.4d04e35320256a0cc734aecd0%40news.povray.org%3E/
From: Tor Olav Kristensen
Subject: Spacing of points along natural cubic splines
Date: 12 Dec 2010 15:05:01

If so, then follow the link to the message thread with the source code.

These searches may also be relevant:

https://www.google.com/search?q="frenet+frame"+along+spline
https://www.google.com/search?q="orthogonal+axes"+spline

https://www.google.com/search?q=arc+length+parameterization+spline
https://www.google.com/search?q=spline+reparameterization

--
Tor Olav
http://subcube.com


Post a reply to this message

From: kurtz le pirate
Subject: Re: Ribbon following spline
Date: 1 Jan 2016 11:49:09
Message: <5686ae05$1@news.povray.org>

> Are you thinking of something similar to what is shown in this thread ?
>
>
http://news.povray.org/povray.binaries.images/thread/%3Cweb.4d04e35320256a0cc734aecd0%40news.povray.org%3E/
> From: Tor Olav Kristensen
> Subject: Spacing of points along natural cubic splines
> Date: 12 Dec 2010 15:05:01
>
> If so, then follow the link to the message thread with the source code.
>
> These searches may also be relevant:
>
> https://www.google.com/search?q="frenet+frame"+along+spline
> https://www.google.com/search?q="orthogonal+axes"+spline
>
> https://www.google.com/search?q=arc+length+parameterization+spline
> https://www.google.com/search?q=spline+reparameterization

Thanks for this links.
I'll look at this links closely.

In fact, i already made some tests with simple polygons (squares et 
triangles). My problem is that in some places, the objects are not 
positioned correctly. You can see the issue here :
<http://louisbel.free.fr/en_cours/wip16.shtml>

...and as Alain said, ribbon need two spline.



---
kurtz le pirate
compagnie de la banquise


Post a reply to this message

From: Le Forgeron
Subject: Re: Ribbon following spline
Date: 1 Jan 2016 11:55:03
Message: <5686af67$1@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Le 01/01/2016 17:49, kurtz le pirate a écrit :

> Thanks for this links. I'll look at this links closely.
> 
> In fact, i already made some tests with simple polygons (squares
> et triangles). My problem is that in some places, the objects are
> not positioned correctly. You can see the issue here : 
> <http://louisbel.free.fr/en_cours/wip16.shtml>
> 
> ...and as Alain said, ribbon need two spline.
> 

Please have a look in povray.binaries.images, I made a post for you.
(image and scene)





-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iJwEAQEIAAYFAlaGr2YACgkQhKAm8mTpkW1BBQQAn3R5ib0hBWaJVt/LF81t5OFi
MMS476fojZJJFP0q76KgnHVJgqupxj2xtYipwKhP2lzLUHujI0haJhIfRA7qutze
oClQ98mg4UYHbVeCVb9vrHt4no0mV1axCyqwZpyacBd8A0tvz77gI/U6IS/jSM+a
wEhPPVynVwf7mI9yzwg=
=YjYh
-----END PGP SIGNATURE-----


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Ribbon following spline
Date: 1 Jan 2016 15:50:14
Message: <web.5686e6146378af804c3587780@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:
....
> In fact, i already made some tests with simple polygons (squares et
> triangles). My problem is that in some places, the objects are not
> positioned correctly. You can see the issue here :
> <http://louisbel.free.fr/en_cours/wip16.shtml>

The curve_Trans macro does not seem to be robust, as it is dependent on a sky
vector.

I would guess that there will be problems with any curve that has regions that
are nearly parallel to this sky vector.


> ...and as Alain said, ribbon need two spline.

In general, information about the spline itself should be sufficient. The
remaining needed information can sometimes be calculated. And if not, it can
often be estimated.

This is usually done by constructing a Frenet frame from the first and the
second derivatives of the vector function and their cross product. (All the
vectors should be normalized.)

The first derivative of the vector function is the tangent vector function, the
second derivative of the vector function is the binormal vector function and
their cross product is the normal vector function.

The curve_Trans macro estimates the tangent vector of the curve by numerical
differentiation. But, as you have the mathematical expressions for each of the
x, y and z components of the vector function, you don't have to do this
numerically. You can use these expressions to find all the 3 vector functions
analytically.

When you have found the expressions for these 3 vector functions, you can use
them to calculate 3 orthogonal and normalized vectors for each point along the
curve.

You can then create a matrix from these 3 vectors and the vector/point given by
the original vector function for the curve. And this matrix can be used in a
transformation that both orients and translates objects along the curve. (The
Matrix_Trans macro is useful for this.)

If you need make more complex constructs at points along the curve, these 3
vectors can be used as orthonormal basis vectors for local coordinate systems at
these points.

You have to be careful though, because there may be regions of some splines
where the values of the derivative vector functions is equal to the zero vector.
There will also be problems if the vectors from the second derivative vector
function suddenly changes direction at one or more points.


Can you please post the complete problematic scene file ?

--
Tor Olav
http://subcube.com


Post a reply to this message

From: kurtz le pirate
Subject: Re: Ribbon following spline
Date: 3 Jan 2016 02:52:29
Message: <5688d33d$1@news.povray.org>

>
> ....
>
> Can you please post the complete problematic scene file ?


In p.b.i

---
kurtz le pirate
compagnie de la banquise


Post a reply to this message

From: kurtz le pirate
Subject: Re: Ribbon following spline
Date: 3 Jan 2016 02:53:23
Message: <5688d373$1@news.povray.org>
Le 01/01/2016 17:55, Le_Forgeron a écrit :

> Please have a look in povray.binaries.images, I made a post for you.
> (image and scene)

thanks

---
kurtz le pirate
compagnie de la banquise


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Ribbon following spline
Date: 5 Jan 2016 03:45:04
Message: <web.568b32be6378af802fc085110@news.povray.org>
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
....
> This is usually done by constructing a Frenet frame from the first and the
> second derivatives of the vector function and their cross product. (All the
> vectors should be normalized.)
>
> The first derivative of the vector function is the tangent vector function, the
> second derivative of the vector function is the binormal vector function and
> their cross product is the normal vector function.
....

I see now that I must have been a too tired when I wrote the above. Sorry about
that.

The statements about the binormal and the normal vector functions are wrong. The
binormal vector function is the cross product of the first and the second
derivatives of the vector function. And the normal vector function is the cross
product of the tangent and binormal vector functions.

--
Tor Olav
http://subcube.com


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Ribbon following spline
Date: 5 Jan 2016 13:05:01
Message: <web.568c05606378af802fc085110@news.povray.org>
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> "Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> ....
> > This is usually done by constructing a Frenet frame from the first and the
> > second derivatives of the vector function and their cross product. (All the
> > vectors should be normalized.)
> >
> > The first derivative of the vector function is the tangent vector function, the
> > second derivative of the vector function is the binormal vector function and
> > their cross product is the normal vector function.
> ....
>
> I see now that I must have been a too tired when I wrote the above. Sorry about
> that.
>
> The statements about the binormal and the normal vector functions are wrong. The
> binormal vector function is the cross product of the first and the second
> derivatives of the vector function. And the normal vector function is the cross
> product of the tangent and binormal vector functions.

Here's an image that is made with this method:
http://news.povray.org/povray.binaries.images/thread/%3Cweb.568c02c24eea97032fc085110%40news.povray.org%3E/
From: Tor Olav Kristensen
Subject: Frenet frames along parametric curve
Date: 5 Jan 2016 17:55:01

(There's also a link to the source code in that post.)

--
Tor Olav
http://subcube.com


Post a reply to this message

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