POV-Ray : Newsgroups : povray.binaries.images : Deja-Vu Server Time
31 Jul 2024 18:23:19 EDT (-0400)
  Deja-Vu (Message 1 to 8 of 8)  
From: alphaQuad
Subject: Deja-Vu
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


 

From: alphaQuad
Subject: Re: Deja-Vu
Date: 5 May 2009 20:55:01
Message: <web.4a00df3b7a8ca8fcdc528f710@news.povray.org>
Deja Vu


Post a reply to this message


Attachments:
Download 'copycat3.jpg' (186 KB)

Preview of image 'copycat3.jpg'
copycat3.jpg


 

From: alphaQuad
Subject: Re: Deja-Vu
Date: 23 May 2009 20:40:00
Message: <web.4a1896fa7a8ca8fcc5212f130@news.povray.org>
Update one the bezier stuff ...

With a little bezier help:

    bezier_subdivision() will still divide points closer at sharper part of the
curve
    bezier_length()
    bezier_point_spread() evenly-spaced points along multiple paths
and
    bezPrism(exH,rm1,rm2,slices,Switch)
with width and height radius modifiers: 0-1 range = R*kappa thru R
> 1 is bowl-shaped

Design considerations:
Multiple entries for backbone points, triangulating up one side and down the
other, presents a dilemma of using a fast face-index search for normal addition
or VEq() and going 9 times slower.

Perimeters that have little shape-wise relation to the backbone are buggy, such
as this one required increment-rate-control at a critical point along the path.


Post a reply to this message


Attachments:
Download 'bezier_prism.jpg' (246 KB)

Preview of image 'bezier_prism.jpg'
bezier_prism.jpg


 

From: alphaQuad
Subject: Re: Deja-Vu
Date: 24 May 2009 21:00:01
Message: <web.4a19ed737a8ca8fcc2247a290@news.povray.org>
Happy with everything, except UV vectors for "up one side and down the other" of
a "cresent with a handle" ?!?

Anyway, radius modifers work well, eh?


Post a reply to this message


Attachments:
Download 'povlogo_smooth8.jpg' (59 KB)

Preview of image 'povlogo_smooth8.jpg'
povlogo_smooth8.jpg


 

From: alphaQuad
Subject: Re: Deja-Vu
Date: 26 May 2009 21:20:00
Message: <web.4a1c94397a8ca8fcb70d65c50@news.povray.org>
rewrite!

norms are made and then written to mesh face-indexed without missing any faces
due to multiple-entry backbone points, VEq is out the window.

At first tried to write it by using previously written face and edge
definitions. These had to be redone.

Ended up with 2 sets of norms seen here; points that all have the average of
adjacent faces, and backbone to perimeter vector norms. The latter being the
case for 2 lower transparencies, with averaged smoothing on the smaller 2
hearts and the purpleP .


Post a reply to this message


Attachments:
Download 'heart02.png' (338 KB)

Preview of image 'heart02.png'
heart02.png


 

From: alphaQuad
Subject: Re: Deja-Vu
Date: 26 May 2009 22:20:01
Message: <web.4a1ca2407a8ca8fcb70d65c50@news.povray.org>
640 doesnt do it justice.

perimeter to center 3D bezier path handles now have 2 modifers length and
rotation


Post a reply to this message


Attachments:
Download 'heart02_lossy.jpg' (215 KB)

Preview of image 'heart02_lossy.jpg'
heart02_lossy.jpg


 

From: Darren New
Subject: Re: Deja-Vu
Date: 26 May 2009 23:32:22
Message: <4a1cb446$1@news.povray.org>
alphaQuad wrote:
> 640 doesnt do it justice.

Very surreal. :-)

-- 
   Darren New, San Diego CA, USA (PST)
   There's no CD like OCD, there's no CD I knoooow!


Post a reply to this message

From: alphaQuad
Subject: Re: Deja-Vu
Date: 29 May 2009 02:25:00
Message: <web.4a1f7eb37a8ca8fc1369e86e0@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> alphaQuad wrote:
> > 640 doesnt do it justice.
>
> Very surreal. :-)
>
> --
>    Darren New, San Diego CA, USA (PST)
>    There's no CD like OCD, there's no CD I knoooow!

Get this script. Why it hasn't been done before, I dont know.
Hardest part was gettin triangle def right.

I have dubbed the new evolution bezierPrismQ() for Quads.
Before was auto triangulation, increment if closer. This time it is linear
increment, requiring sweeps parameter to request a point ratio of a*2-1=b,
ending with a single triangle at the nose and all other faces being quads.

Even 'with' taking ten minutes to add up the norms, if you dont quad around the
object you get streaks of misaligned normals with triangles defined anywhere in
the domain of perimeter to backbone.

2 bezier paths to this:


Post a reply to this message


Attachments:
Download 'ship1_lossy.jpg' (104 KB)

Preview of image 'ship1_lossy.jpg'
ship1_lossy.jpg


 

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