POV-Ray : Newsgroups : povray.general : Converting bezier splines to regular splines : Converting bezier splines to regular splines Server Time
31 Jul 2024 16:21:26 EDT (-0400)
  Converting bezier splines to regular splines  
From: scam
Date: 11 Dec 2006 20:55:01
Message: <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.