POV-Ray : Newsgroups : povray.general : How does bezier_spline work in prism? : Re: How does bezier_spline work in prism? Server Time
26 Apr 2024 06:49:44 EDT (-0400)
  Re: How does bezier_spline work in prism?  
From: Alain Martel
Date: 18 Sep 2019 18:59:16
Message: <5d82b6c4$1@news.povray.org>
Le 2019-09-18 à 12:45, Leroy a écrit :
> 
>   This may be a little late to help you much.
> So here it goes. A long ago I fell in love with Prisms and Polygons, or I should
> say it was the shapes they created. I think one of my first POV files was a
> snowflake maker using Polygons, then prisms. There are an infinite number of
> shape s you can come up with. To keep up with all those shapes I came up with,
> and make new ones I wrote a windows program.
> You can find it at  http://leroyw.byethost15.com/
> 
>   But you where asking about a circle(really a cylinder) using Prism and
> bezier_spline. We should be able to let POV make one of any size for us.
> 
> You know the basics data
> point1, control1, control2, point2
> point2, control1, control2, point3
>   :          :         :        :
> pointN, controlNa, control1a, point1
> 
> if the prism is center is <0,0> and the number of points is N
>   all the points are just point1 rotated around the center evenly
>   the control points are a little more complicated
>   if you use the formula with K=N
>    control1(K)=(Pnt(N)+Pnt(N+1))*.333 and control2(K)=(Pnt(N)+Pnt(N+1))*.6666
>    you will a n sided polygonal shape
>   but if you adjust the control points out using
>    L=vlength(Pnt(0))
>    control1(K)=vnormalize(control1(K))*L
>    control2(K)=vnormalize(control1(K))*L
>   you should get a nice circle
> 
> This is just an over view. The code will have to be different. Prism doesn't
> like 3d vectors and vnormalize outputs a 3d vector
> I may be wrong, I haven't tried it.
> 
> Have Fun!
> 
> 
> 
> 
If all your points share the same Y coordinate, there is no problem. 
Same if they share the same X or Z.
You can multiply every point by <1,0,1> to ensure that you are on the 
X-Z plane.


Post a reply to this message

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