POV-Ray : Newsgroups : povray.advanced-users : A Simple Lamp Shade ? : Re: A Simple Lamp Shade ? Server Time
30 Jul 2024 14:18:57 EDT (-0400)
  Re: A Simple Lamp Shade ?  
From: Ron Parker
Date: 27 Apr 1999 11:12:48
Message: <3725c5e0.0@news.povray.org>
On 27 Apr 1999 09:37:38 -0500, Ron Parker <par### [at] my-dejanewscom> wrote:
>Go get my Jan/Feb IRTC Stills entry (borrow.zip) and make suitable 
>modifications to the bottle cap object.  It's a bunch of patch objects, 
>so you get the added advantage of double illumination for your lampshade.

I just went and grabbed a copy of that file and realized that I never did
get around to documenting it.  So, here's some (slight) documentation:

rad     this is the average radius at the narrow end of the cone
sl      this is the "slope" and should be the difference in average radius
        from one end of the cone to the other, divided by 3.  
fac     The furrows in the bottlecap go from zero amplitude at the narrow
        end to fac*3 amplitude at the wide end.
ys      ys is the height of the cone, divided by 3.  Think "Y-step"
steps   steps is twice the number of furrows around the cone.  Must be even.


So, here's your cone:

          radius at this end is rad, and there are no pleats.
         ____
        /    \
       /      \     height is 3*ys
      /________\

          radius at this end is rad+3*sl +/- fac*3

As for the actual pleated cone, you want to keep the union called "cap_part"
and delete the last two bicubic_patch objects, keeping just the first one.
If you want to make the furrows be of constant depth, you'll have to modify
the part of the code that makes the furrows from
 
           #if ((X=1 | X=2)&(Y>0))
              #if ( mod(i,2) ) 
                #local lrad=lrad+fac*(Y-1);
              #else
                #local lrad=lrad-fac*(Y-1);
              #end 
            #end
 
to 
           #if ((X=1 | X=2))
              #if ( mod(i,2) ) 
                #local lrad=lrad+fac;
              #else
                #local lrad=lrad-fac;
              #end 
            #end
 
and then set fac to the desired amplitude.  

Throw away the rest of the include file; you probably don't need the peas or
the test-render version of the cap.


Post a reply to this message

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