POV-Ray : Newsgroups : povray.binaries.images : Deja-Vu : Deja-Vu Server Time
31 Jul 2024 20:23:12 EDT (-0400)
  Deja-Vu  
From: alphaQuad
Date: 5 May 2009 20:50:01
Message: <web.4a00ddf9d91245a5dc528f710@news.povray.org>
Scanned the logo for some Bezier splines:

2 problems:

Center circle was a poor excuse for a circle and using a Bezier editor seemed
impossible for making it round. R was 3.77 and I kept landing 2.08 for a handle
length. I was very close, as it turns out. 2.08 / 3.77 = 0.551724

Ratio of radius to handle length for a circle = kappa
4*(sqrt(2)-1)/3 = 0.552284749830792

Raw Bezier output produces unevenly spaced points along a curve with linear
iteration increment.

I was able to get an even point spread, but before explaining I was wondering if
someone else might have a different method. If you can genius this one, show
your work maybe?

I'll get you started:



OK, sorry 'bout that. Forget all that. Here's the macro:

#macro bezier_curve(p1,h1,h2,p2,detail) // <x,y> or <x,y,0,> or <x,0,y>
           //(node, ctrlh, ctrlh, node, .01)
     #local C = 3*(h1-p1);
     #local B = 3*(h2-h1)-C;
     #local A = p2-p1-C-B;

     #local i = 0;
     #while (i<1)
         #local xy= A*pow(i,3)+B*pow(i,2)+C*i+p1;
////////////////////// do something with xyz here \\\\\\\\\\\\\\\\\\\\\\\\
         #local i=i+detail;
     #end
     #local i=1;
     #local xy = A*pow(i,3)+B*pow(i,2)+C*i+p1;
     echov2(xy) echo("\n")
     #local xy=p2;
     echov2(xy) echo("\n") // same numbers
#end

want some points?

#declare pov_P_prism = prism {
linear_sweep
bezier_spline
0.0, //top
-1.0, //bottom
144,
<-9.2,-19.525406>,<-9.2,-19.440014>,<-8.838889,-18.091264>,<-8.397532,-16.528183>,
<-8.397532,-16.528183>,<-7.956175,-14.965102>,<-7.368484,-12.876218>,<-7.091552,-11.886218>,
<-7.091552,-11.886218>,<-6.814619,-10.896218>,<-6.377995,-9.347766>,<-6.121276,-8.445214>,
<-6.121276,-8.445214>,<-6.093917,-8.349029>,<-5.681872,-6.900396>,<-5.654513,-6.804211>,
<-5.654513,-6.804211>,<-5.733833,-6.743314>,<-5.912544,-6.606111>,<-5.991864,-6.545214>,
<-5.991864,-6.545214>,<-6.949847,-5.809737>,<-8.173005,-4.57589>,<-8.058069,-4.460954>,
<-8.058069,-4.460954>,<-8.033586,-4.436471>,<-7.729255,-4.618013>,<-7.381778,-4.86438>,
<-7.381778,-4.86438>,<-6.683262,-5.359639>,<-5.788497,-5.836218>,<-5.557179,-5.836218>,
<-5.557179,-5.836218>,<-5.466318,-5.836218>,<-5.361915,-5.66957>,<-5.290922,-5.411218>,
<-5.290922,-5.411218>,<-5.226689,-5.177468>,<-5.052159,-4.536218>,<-4.903076,-3.986218>,
<-4.903076,-3.986218>,<-4.73495,-3.365963>,<-4.57847,-2.976851>,<-4.491008,-2.961551>,
<-4.491008,-2.961551>,<-4.413454,-2.947984>,<-4.22395,-3.115874>,<-4.069889,-3.334639>,
<-4.069889,-3.334639>,<-3.714304,-3.839567>,<-2.760591,-4.576203>,<-2.063077,-4.884677>,
<-2.063077,-4.884677>,<-1.362151,-5.194659>,<-0.372358,-5.370874>,<0.225,-5.292026>,
<0.225,-5.292026>,<0.793263,-5.217019>,<0.813394,-5.28537>,<0.4,-5.886218>,
<0.4,-5.886218>,<0.235,-6.126037>,<0.1,-6.370395>,<0.1,-6.429236>,
<0.1,-6.429236>,<0.1,-6.59938>,<0.511971,-6.555244>,<1.443472,-6.285306>,
<1.443472,-6.285306>,<4.012626,-5.540794>,<5.89133,-3.893033>,<6.615852,-1.74875>,
<6.615852,-1.74875>,<7.048219,-0.469122>,<6.852897,1.205381>,<6.124482,2.463782>,
<6.124482,2.463782>,<5.775273,3.06707>,<4.88527,3.991084>,<4.15,4.513718>,
<4.15,4.513718>,<0.932457,6.800763>,<-3.878082,6.807377>,<-7.198783,4.52932>,
<-7.198783,4.52932>,<-7.445614,4.35999>,<-7.929364,3.935457>,<-8.273783,3.585914>,
<-8.273783,3.585914>,<-8.97885,2.870357>,<-9.068581,2.945591>,<-8.545709,3.813906>,
<-8.545709,3.813906>,<-7.705588,5.209065>,<-6.418528,6.351022>,<-4.770785,7.163245>,
<-4.770785,7.163245>,<-2.482826,8.29105>,<0.356032,8.547967>,<2.944599,7.861487>,
<2.944599,7.861487>,<5.740213,7.120099>,<8.392345,4.800938>,<9.190649,2.39962>,
<9.190649,2.39962>,<9.638526,1.052392>,<9.701838,-0.633887>,<9.353438,-1.936218>,
<9.353438,-1.936218>,<8.9653,-3.387091>,<7.903633,-4.934387>,<6.547978,-6.024955>,
<6.547978,-6.024955>,<4.684337,-7.524178>,<3.017211,-8.113809>,<0.378661,-8.206925>,
<0.378661,-8.206925>,<-0.896005,-8.251909>,<-1.21953,-8.29295>,<-1.334904,-8.424298>,
<-1.334904,-8.424298>,<-1.46537,-8.572831>,<-4.591501,-13.099385>,<-7.59325,-17.486218>,
<-7.59325,-17.486218>,<-8.924857,-19.432264>,<-9.2,-19.781458>,<-9.2,-19.525406>,
<0,-3.7704>,<-2.082334,-3.7704>,<-3.7704,-2.082334>,<-3.7704,0>,
<-3.7704,0>,<-3.7704,2.082334>,<-2.082334,3.7704>,<0,3.7704>,
<0,3.7704>,<2.082334,3.7704>,<3.7704,2.082334>,<3.7704,0>,
<3.7704,0>,<3.7704,-2.082334>,<2.082334,-3.7704>,<0,-3.7704>
}
#declare P_bez = array[144] {
paste points to here to make an array
}

and call something like this:

#local i = 0;
#while (i < 144/4)
bezier_curve(
        P_bez[i*4]+<0,0,0>,
        P_bez[i*4+1]+<0,0,0>,
        P_bez[i*4+2]+<0,0,0>,
        P_bez[i*4+3]+<0,0,0>,
        .01
)


find more stuff here:
http://home.earthlink.net/~povraytrace/

storybook lowercase c has a glitch :(

232 evenly spaced points for wall logo
1892 * 2 for the 2 logo rims


Post a reply to this message


Attachments:
Download 'povlogo_007.jpg' (77 KB)

Preview of image 'povlogo_007.jpg'
povlogo_007.jpg


 

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