POV-Ray : Newsgroups : povray.general : bezier_spline with prism Server Time
28 Mar 2024 18:29:01 EDT (-0400)
  bezier_spline with prism (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Kima
Subject: bezier_spline with prism
Date: 19 Aug 2019 15:20:01
Message: <web.5d5af5fac5582318ecc0fada0@news.povray.org>
I can use bezier_spline set of points in lathe as

  lathe {
    bezier_spline
    80
    <2.00, 1.00>, <1.00, 1.50>, <3.00, 3.50>, <2.00, 4.00>
    <2.00, 4.00>, <3.00, 4.50>, <1.00, 6.50>,<2.00, 7.00>
    pigment { color rgbt<0.4,0.2,1,.5>}
    finish { ambient 1 }
  }

but when I use the same set in prism as

  prism {
    bezier_spline
    0,1,1,
//    80
    <2.00, 1.00>, <1.00, 1.50>, <3.00, 3.50>, <2.00, 4.00>
    <2.00, 4.00>, <3.00, 4.50>, <1.00, 6.50>,<2.00, 7.00>
    pigment { color rgbt<0.4,0.2,1,.5>}
    finish { ambient 1 }
  }

I get an error, "Prism with Bezier splines must have four points per segment."
Where did I do wrong?


Post a reply to this message

From: William F Pokorny
Subject: Re: bezier_spline with prism
Date: 19 Aug 2019 17:30:42
Message: <5d5b1502$1@news.povray.org>
On 8/19/19 3:18 PM, Kima wrote:
> I can use bezier_spline set of points in lathe as
> 
>    lathe {
>      bezier_spline
>      80
>      <2.00, 1.00>, <1.00, 1.50>, <3.00, 3.50>, <2.00, 4.00>
>      <2.00, 4.00>, <3.00, 4.50>, <1.00, 6.50>,<2.00, 7.00>
>      pigment { color rgbt<0.4,0.2,1,.5>}
>      finish { ambient 1 }
>    }
> 
> but when I use the same set in prism as
> 
>    prism {
>      bezier_spline
>      0,1,1,
> //    80
>      <2.00, 1.00>, <1.00, 1.50>, <3.00, 3.50>, <2.00, 4.00>
>      <2.00, 4.00>, <3.00, 4.50>, <1.00, 6.50>,<2.00, 7.00>
>      pigment { color rgbt<0.4,0.2,1,.5>}
>      finish { ambient 1 }
>    }
> 
> I get an error, "Prism with Bezier splines must have four points per segment."
> Where did I do wrong?
> 
> 
Hi. Not sure how either works. In the first where you have '80' I think 
it should be '8,'. In the second where you have '0,1,1,' I think 
'0,1,8,' is what is needed. In the latter the parser is probably seeing 
the 1 as the point count and saying you need at least 4 for a valid 
segment.

Bill P.


Post a reply to this message

From: Kima
Subject: Re: bezier_spline with prism
Date: 20 Aug 2019 01:05:00
Message: <web.5d5b7e4d57efbc06ecc0fada0@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> On 8/19/19 3:18 PM, Kima wrote:
> > I can use bezier_spline set of points in lathe as
> >
> >    lathe {
> >      bezier_spline
> >      80
> >      <2.00, 1.00>, <1.00, 1.50>, <3.00, 3.50>, <2.00, 4.00>
> >      <2.00, 4.00>, <3.00, 4.50>, <1.00, 6.50>,<2.00, 7.00>
> >      pigment { color rgbt<0.4,0.2,1,.5>}
> >      finish { ambient 1 }
> >    }
> >
> > but when I use the same set in prism as
> >
> >    prism {
> >      bezier_spline
> >      0,1,1,
> > //    80
> >      <2.00, 1.00>, <1.00, 1.50>, <3.00, 3.50>, <2.00, 4.00>
> >      <2.00, 4.00>, <3.00, 4.50>, <1.00, 6.50>,<2.00, 7.00>
> >      pigment { color rgbt<0.4,0.2,1,.5>}
> >      finish { ambient 1 }
> >    }
> >
> > I get an error, "Prism with Bezier splines must have four points per segment."
> > Where did I do wrong?
> >
> >
> Hi. Not sure how either works. In the first where you have '80' I think
> it should be '8,'. In the second where you have '0,1,1,' I think
> '0,1,8,' is what is needed. In the latter the parser is probably seeing
> the 1 as the point count and saying you need at least 4 for a valid
> segment.
>
> Bill P.

Thanks, Bill. 80 in lathe was a typo, as I clipped a larger bezier_spline set
for readability here. My mistake was the third parameter of prism. Now
everything works perfectly. Thank you very much.


Post a reply to this message

From: Usb Hub
Subject: Re: bezier_spline with prism
Date: 5 Sep 2019 12:20:00
Message: <web.5d71351a57efbc065256aba40@news.povray.org>
I tried the fixed prism, but that doesn't work for me. The lathe works fine, but
with the prism, I only see nothing. Thats my code:

#version 3.7; // 3.7
global_settings{assumed_gamma 1.0}
#default{ finish{ ambient 0.2 diffuse 0.9 }}
#default{pigment{rgb <0.800, 0.800, 0.800>}}
//------------------------------------------
#include "colors.inc"
#include "textures.inc"

//------------------------------------------
// camera ----------------------------------
#declare CamUp = < 0, 0, 1>;
#declare CamRight = <1.33, 0, 0>;
#declare CamRotation = <-35.264390534, 1.9538003485e-05, 45.0000026303>;
#declare CamPosition = <17.0710754395, -7.07106590271, 17.0710659027>;
camera {
    location <0, 0, 0>
    direction < 0, 1, 0>
    up CamUp
    right CamRight
    rotate CamRotation
    translate CamPosition
    angle 57.82
}

// sun -------------------------------------
light_source { <17.0710754395, -7.07106590271, 17.0710659027> color rgb<0.5,
0.5, 0.5> }

// background ------------------------------
sky_sphere {
   pigment {
   gradient z
   color_map {
        [ 0.00  color rgb<0.098, 0.667, 0.067> ]
        [ 0.30  color rgb<0.098, 0.667, 0.067> ]
        [ 0.50  color rgb<0.576, 0.000, 0.000> ]
        [ 0.70  color rgb<0.200, 0.200, 0.396> ]
        [ 1.00  color rgb<0.200, 0.200, 0.396> ]
       }
   scale 2
   translate -1
   rotate<-35.264390534, 1.9538003485e-05, 45.0000026303>
   }
}


//------------------------------------------
// objects in scene ------------------------

prism {
      bezier_spline
      0,.2,8,
      <2.00, 1.00>, <1.00, 1.50>, <3.00, 3.50>, <2.00, 4.00>
      <2.00, 4.00>, <3.00, 4.50>, <1.00, 6.50>,<2.00, 7.00>
      pigment { color rgbt<0.4,0.2,1,.5>}
      finish { ambient 1 }
    }
/*
lathe {
      bezier_spline
      8
      <2.00, 1.00>, <1.00, 1.50>, <3.00, 3.50>, <2.00, 4.00>
      <2.00, 4.00>, <3.00, 4.50>, <1.00, 6.50>,<2.00, 7.00>
      pigment { color rgbt<0.4,0.2,1,.5>}
      finish { ambient 1 }
    }*/

Thanks in advance!


Post a reply to this message

From: jr
Subject: Re: bezier_spline with prism
Date: 5 Sep 2019 13:00:00
Message: <web.5d713e8457efbc06feeb22ff0@news.povray.org>
hi,

"Usb Hub" <nomail@nomail> wrote:
> I tried the fixed prism, but that doesn't work for me. The lathe works fine, but
> with the prism, I only see nothing. Thats my code:

when I comment out bezier_spline, ie using default spline type, the prism shows.
 otherwise POV-Ray complains about prism "not closed".  hth.


regards, jr.


Post a reply to this message

From: Usb Hub
Subject: Re: bezier_spline with prism
Date: 5 Sep 2019 13:35:05
Message: <web.5d71466057efbc065256aba40@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> hi,
>
> "Usb Hub" <nomail@nomail> wrote:
> > I tried the fixed prism, but that doesn't work for me. The lathe works fine, but
> > with the prism, I only see nothing. Thats my code:
>
> when I comment out bezier_spline, ie using default spline type, the prism shows.
>  otherwise POV-Ray complains about prism "not closed".  hth.
>
>
> regards, jr.

OK, that's crazy :) With my POV-ray on Linux Mint 19 Cinnamon there a no errors,
also with the not outcommented bezier_spline. The only thing POV-Ray shows me,
is
that (with both, outcommented and not outcommented):

Ray->Shape Intersection


usbhub


Post a reply to this message

From: jr
Subject: Re: bezier_spline with prism
Date: 5 Sep 2019 14:10:01
Message: <web.5d714ed157efbc06feeb22ff0@news.povray.org>
hi,

"Usb Hub" <nomail@nomail> wrote:
> "jr" <cre### [at] gmailcom> wrote:
> > "Usb Hub" <nomail@nomail> wrote:
> > > I tried the fixed prism, but that doesn't work for me. The lathe works fine, but
> > > with the prism, I only see nothing. Thats my code:
> >
> > when I comment out bezier_spline, ie using default spline type, the prism shows.
> >  otherwise POV-Ray complains about prism "not closed".  hth.
>
> OK, that's crazy :) With my POV-ray on Linux Mint 19 Cinnamon there a no errors,

using v3.8 and and v3.71 on Slackware Linux.  not error, "Parse Warning" prism
not closed, ie not enough points.  when using default linear spline, POV-Ray
closes the prism for you, not with other splines (afaik).

> also with the not outcommented bezier_spline. The only thing POV-Ray shows me,
> is
> that (with both, outcommented and not outcommented):
>
> Ray->Shape Intersection

strange.


regards ,jr.


Post a reply to this message

From: Usb Hub
Subject: Re: bezier_spline with prism
Date: 5 Sep 2019 15:30:00
Message: <web.5d71619b57efbc065256aba40@news.povray.org>
Now it works! The solution is, that the direction of the tangents at the start
and end control point of joining curves must be identical.
(http://wiki.povray.org/content/HowTo:Use_Splines_and_Bezier_Curves)

With this example it works:
prism {
    bezier_spline
    0, 10, 16
    <0, 1>, <.5, 1>, <1, .5>, <1, 0>
    <1, 0>, <1, -.5>, <.5, -1>, <0, -1>
    <0, -1>, <-.5, -1>, <-1, -.5>, <-1, 0>
    <-1, 0>, <-1, .5>, <-.5, 1>, <0, 1>
}

But now is the question, how can I make edges in the spline?

Thank you very much jr!


Post a reply to this message

From: Usb Hub
Subject: Re: bezier_spline with prism
Date: 5 Sep 2019 15:35:01
Message: <web.5d71633957efbc065256aba40@news.povray.org>
I don't understand POV-Ray :)
This example works also, even there are edges:
prism {
    bezier_spline
    0, 10, 16
    <0, 1>, <.5, 1>, <1, 1.5>, <1, 0>
    <1, 0>, <1, -.5>, <.5, -1>, <0, -1>
    <0, -1>, <-.5, -3>, <-1, -.5>, <-1, 0>
    <-1, 0>, <-1, .5>, <-.5, 5>, <0, 1>
}

I don't know why it works now, but whatever.

usbhub


Post a reply to this message

From: jr
Subject: Re: bezier_spline with prism
Date: 5 Sep 2019 17:35:06
Message: <web.5d717eba57efbc06feeb22ff0@news.povray.org>
hi,

"Usb Hub" <nomail@nomail> wrote:
> I don't understand POV-Ray :)
> This example works also, ...
> I don't know why it works now, but whatever.
> usbhub

keep going.  some here, including self, find (strong) coffee an invaluable help.
 :-)

note that the "finish {ambient 1}" also will give you grief (ie POV-Ray
warnings) when/if you upgrade to v3.8.


regards, jr.


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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