POV-Ray : Newsgroups : povray.general : How does bezier_spline work in prism? : Re: How does bezier_spline work in prism? Server Time
27 Apr 2024 12:34:50 EDT (-0400)
  Re: How does bezier_spline work in prism?  
From: Leroy
Date: 18 Sep 2019 12:50:01
Message: <web.5d825f0dcb41806e610414250@news.povray.org>
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!


Post a reply to this message

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