POV-Ray : Newsgroups : povray.general : Converting bezier splines to regular splines : Re: Converting bezier splines to regular splines Server Time
31 Jul 2024 16:32:12 EDT (-0400)
  Re: Converting bezier splines to regular splines  
From: Tek
Date: 13 Dec 2006 07:28:38
Message: <457ff1f6@news.povray.org>
You know personally I just wish pov could take bezier splines as one of it's 
spline types, I love the whole control point system of bezier, it makes so 
much sense!

Unfortunately the only way to "convert" it that I know of is to write your 
own macro that supports bezier splines, then sample it at a lot of points 
and create a spline to approximate those, though if you've got a macro that 
does bezier splines there's no need to convert it! Unfortunately I haven't 
got such a macro, the maths is on the internet somewhere...

-- 
Tek
http://evilsuperbrain.com

"scam" <sca### [at] mailusydeduau> wrote in message 
news:web.457e0b831c8380c719862de70@news.povray.org...
> Hi.
>
> Can someone help me out with a macro that can convert bezier splines to
> regular splines? Something that can take as input:
>
> prism {
>    linear_sweep
>    bezier_spline
>    1.0, //top
>    0.0, //bottom
>    16, //nr points
>    /*   0*/ <202, 884>, <202, 884>, <508,884>, <508,884>,
>    /*   1*/ <508, 884>, <508, 884>, <508,602>, <508,602>
> }
>
> and output something like
>
> spline {
>    cubic_spline
>    0.0, <202, 0, 884>,
>    0.125, <202, 0, 884>,
>    0.25, <508, 0, 884>,
>    0.375, <508, 0, 884>,
>    0.5, <508, 0, 884>,
>    0.625, <508, 0, 884>,
>    0.75, <508, 0, 602>,
>    0.875, <508,602>
> }
>
> That is a macro that can take a prism containing a bezier_spline, and 
> output
> a regular spline.
>
> My main problem is I don't know how to perform operations on POV-Ray 
> objects
> to extract their underlying structure. Any help would be greatly
> appreciated.
>
>
>


Post a reply to this message

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