POV-Ray : Newsgroups : povray.advanced-users : Bi-cubic to cubic spline conversion Server Time
2 Nov 2024 09:22:08 EDT (-0400)
  Bi-cubic to cubic spline conversion (Message 1 to 6 of 6)  
From: Bret Slivka
Subject: Bi-cubic to cubic spline conversion
Date: 27 Jan 2000 01:54:33
Message: <388FEC19.9CF84A00@chisp.net>
I'm not sure if this question is advanced enough for this group.. But
I'll give it a try.
Is there away to convert a bicubic, or bezier spline as used in
illustrator to a cubic spline as used in povray, to make smooth prism or
lathe objects with contours defined in illustrator-- or any other
program or spline designer?  I don't know the math behind a cubic spline
and have been unable to find it on the internet so far. I've noticed the
behavior of a cubic spline and noticed that it's difficult to make sharp
corners.. of course, unless you use multiple sections. The problem with
this is that multiple spline sections would produce a discontinuous
shape in povray... and I believe that the starting and ending points of
a prism object are required to be identical. I've resorted to simply
using a linear aproximation of the bezier spline in the prism which is
fairly satisfactory.. but it would be nice to know this for future
reference anyway.  Thanks in advance, and to advanced.

-Bret


Post a reply to this message

From: Thomas Willhalm
Subject: Re: Bi-cubic to cubic spline conversion
Date: 27 Jan 2000 04:29:21
Message: <qqmhffzn9qm.fsf@schlatt.fmi.uni-konstanz.de>
Hello,

I'm by far no specialist for spline, but I hope that I can help you
anyway. So, I ask the others to correct me where I'm wrong.

Bret Slivka <coo### [at] chispnet> writes:
>
> Is there away to convert a bicubic, or bezier spline as used in
> illustrator to a cubic spline as used in povray,

As far as I know, the term "bicubic" is used for patches. In each of
the two directions ("bi-") you have a "-cubic" curve.

Bezier splines consist of piecewise cubic curves. They are described 
and connected in a particular way. According to the POV-Ray documentation,
you can use them for lathe and prism.

> I've noticed the behavior of a cubic spline and noticed that it's 
> difficult to make sharp corners.. 

The purpose of splines is to make smooth curves. That's why it is not
surprising that you have difficulties to make sharp corners. I suggest
that you use CSG for doing so. An intersection should do the trick.
If you don't know anything about CSG, read the sections in the POV-Ray 
documentation and/or ask for help in povray.newusers.

As reference for splines I have only a book, which contains probably
much more information than you want:

Su Bu-Qing and Liu Ding-Yuan
Computational Geometry Curve and Surface Modeling
Academic Press 1989
ISBN 0-12-675610-4

Thomas

-- 
http://thomas.willhalm.de/ (includes pgp key)


Post a reply to this message

From: Bret Slivka
Subject: Re: Bi-cubic to cubic spline conversion
Date: 27 Jan 2000 11:39:30
Message: <38907530.B5548B85@chisp.net>
Oh thanks, I don't know how I could have missed that in the documentation. I
should have looked there first. Serves me right for working in moray too much.
I'll have to code out the whole thing then. Cool.


Post a reply to this message

From: Bret Slivka
Subject: Re: Bi-cubic to cubic spline conversion
Date: 27 Jan 2000 11:50:47
Message: <389077D8.70462E9A@chisp.net>
It seems that book is out of print and unavailable. I'll have to find
something similar. All very good stuff to know. Thanks again for clarifying.


Post a reply to this message

From: David Wilkinson
Subject: Re: Bi-cubic to cubic spline conversion
Date: 27 Jan 2000 19:46:25
Message: <2ap19sgup3bg4345a32f8tv9dpqbn5gubu@4ax.com>
On Wed, 26 Jan 2000 23:56:25 -0700, Bret Slivka <coo### [at] chispnet> wrote:

>Is there away to convert a bicubic, or bezier spline as used in
>illustrator to a cubic spline as used in povray, to make smooth prism or
>lathe objects with contours defined in illustrator-- or any other
>program or spline designer?  I don't know the math behind a cubic spline
>and have been unable to find it on the internet so far. I've noticed the
>behavior of a cubic spline and noticed that it's difficult to make sharp
>corners.. of course, unless you use multiple sections. The problem with
>this is that multiple spline sections would produce a discontinuous
>shape in povray... and I believe that the starting and ending points of
>a prism object are required to be identical. I've resorted to simply
>using a linear aproximation of the bezier spline in the prism which is
>fairly satisfactory.. but it would be nice to know this for future
>reference anyway.

As Thomas Willhalm has already said, bi-cubics are used to define patches, not space
curves, although the boundary curves of these patches are cubics.
.
It is quite easy to use Bezier splines to define smooth curves for use in POV lathe or
prism objects.  The bottle macro that I posted in povray.binaries.scene-files on 21
Dec 99
uses Bezier splines to make the outline of the bottle.  This uses several spline
segments
and as I wanted them to blend I ensured that the slopes at the common end point of two
connected splines were the same.  If I had wanted sharp corners I would have allowed
each
curve to have different slopes at the common point. The real point of using spline
curves
is that they can be used as piecewise curves to approximate to any sort of curve -
with or
without slope discontinuities.

Bezier splines can be used in a prism in exactly the same manner.  You can have a
series
of segments and these can have straight lines, corners and curves. I give a simple
example
below.

I can appreciate your problems in trying to make the output of your spline generator
programs relate to the POV spline, but there may be other spline generators that do
this.
I suggest that you have a look through Ken Tyler's links at
http://www.povray.org/links/

\\ ****** POV source starts.
camera
{ location  <0, 1, -4.0>
  direction 1.5*z
  right     4/3*x
  look_at   <1, 0.5,  0.0>}
light_source { <-60, 60, -30> color rgb 1 }
light_source { <60, 60, -30> color rgb 1 }

// Prism constructed of bezier curves.
// Note.  The second and third points in each bezier segment are control points.
//        They do not necessarily lie on the curve, but are on the tangent to the
//         curve at the adjacent point in that segment.  The length of this tangent
//         affects the curvature of the curve.
  prism {
    bezier_spline
    0,0.2, 28, 
    <0,0> <0.2,0.3> <0.4,0.6> <0.7,0.6>   // 1st segment
    <0.7,0.6> <1.1,0.6> <1.1,1> <1.4, 1>
    <1.4,1> <1.6,1> <1.8,1> <2,1>
    <2,1> <2,0.6> <2,0.4> <2,0>
    <2,0> <1.8,0> <1.6,0> <1.6,0>
    <1.6,0> <1.6,0.5> <1.2,0> <0.8,0>
    <0.8,0> <0.6,0> <0.2,0> <0,0>   // 7th segment
    sturm   // this is usually necessary to ensure no glitches when rendering. 
    pigment { rgb <1,1,0>} 
    rotate -x*110
  }
//***** end of pov source.

----------------------------
dav### [at] cwcomnet
http://www.hamiltonite.mcmail.com
----------------------------


Post a reply to this message

From: Bret Slivka
Subject: Re: Bi-cubic to cubic spline conversion
Date: 27 Jan 2000 20:22:05
Message: <3890EFAE.29F5DD94@chisp.net>
No.. really. it's ok I got it :}   spline coordinates can be found in the *.ai files
that
adobe illustrator saves in.   I was just using Moray which doesn't support bezier
splines and
forgot that povray did.

David Wilkinson wrote:

> On Wed, 26 Jan 2000 23:56:25 -0700, Bret Slivka <coo### [at] chispnet> wrote:
>
> >Is there away to convert a bicubic, or bezier spline as used in
> >illustrator to a cubic spline as used in povray, to make smooth prism or
> >lathe objects with contours defined in illustrator-- or any other
> >program or spline designer?  I don't know the math behind a cubic spline
> >and have been unable to find it on the internet so far. I've noticed the
> >behavior of a cubic spline and noticed that it's difficult to make sharp
> >corners.. of course, unless you use multiple sections. The problem with
> >this is that multiple spline sections would produce a discontinuous
> >shape in povray... and I believe that the starting and ending points of
> >a prism object are required to be identical. I've resorted to simply
> >using a linear aproximation of the bezier spline in the prism which is
> >fairly satisfactory.. but it would be nice to know this for future
> >reference anyway.
>
> As Thomas Willhalm has already said, bi-cubics are used to define patches, not space
> curves, although the boundary curves of these patches are cubics.
> .
> It is quite easy to use Bezier splines to define smooth curves for use in POV lathe
or
> prism objects.  The bottle macro that I posted in povray.binaries.scene-files on 21
Dec 99
> uses Bezier splines to make the outline of the bottle.  This uses several spline
segments
> and as I wanted them to blend I ensured that the slopes at the common end point of
two
> connected splines were the same.  If I had wanted sharp corners I would have allowed
each
> curve to have different slopes at the common point. The real point of using spline
curves
> is that they can be used as piecewise curves to approximate to any sort of curve -
with or
> without slope discontinuities.
>
> Bezier splines can be used in a prism in exactly the same manner.  You can have a
series
> of segments and these can have straight lines, corners and curves. I give a simple
example
> below.
>
> I can appreciate your problems in trying to make the output of your spline generator
> programs relate to the POV spline, but there may be other spline generators that do
this.
> I suggest that you have a look through Ken Tyler's links at
http://www.povray.org/links/
>
> \\ ****** POV source starts.
> camera
> { location  <0, 1, -4.0>
>   direction 1.5*z
>   right     4/3*x
>   look_at   <1, 0.5,  0.0>}
> light_source { <-60, 60, -30> color rgb 1 }
> light_source { <60, 60, -30> color rgb 1 }
>
> // Prism constructed of bezier curves.
> // Note.  The second and third points in each bezier segment are control points.
> //        They do not necessarily lie on the curve, but are on the tangent to the
> //         curve at the adjacent point in that segment.  The length of this tangent
> //         affects the curvature of the curve.
>   prism {
>     bezier_spline
>     0,0.2, 28,
>     <0,0> <0.2,0.3> <0.4,0.6> <0.7,0.6>   // 1st segment
>     <0.7,0.6> <1.1,0.6> <1.1,1> <1.4, 1>
>     <1.4,1> <1.6,1> <1.8,1> <2,1>
>     <2,1> <2,0.6> <2,0.4> <2,0>
>     <2,0> <1.8,0> <1.6,0> <1.6,0>
>     <1.6,0> <1.6,0.5> <1.2,0> <0.8,0>
>     <0.8,0> <0.6,0> <0.2,0> <0,0>   // 7th segment
>     sturm   // this is usually necessary to ensure no glitches when rendering.
>     pigment { rgb <1,1,0>}
>     rotate -x*110
>   }
> //***** end of pov source.
>
> ----------------------------
> dav### [at] cwcomnet
> http://www.hamiltonite.mcmail.com
> ----------------------------


Post a reply to this message

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