Attachment 'raisedbed-8hoop.pov'

Download

   1 // raisedbed01.pov
   2 // 2013 Aug 31 
   3 // y is vertical, x is length, z is depth
   4 #version 3.7 ;
   5 
   6 // dimensions in inches
   7 #declare len    = 96.0   ; // inside length of raised bed
   8 #declare wid    = 36.0   ; // inside width of raised bed 
   9 #declare npost  = 3      ; // number of posts per side
  10 #declare nboard = 2      ; // boards high
  11 #declare nhoop  = 8      ; // number of hoops
  12 
  13 #declare dirtd  = -2.0   ; // dirt is 2 inches below height
  14 #declare postt  = 3.5    ; // post thickness
  15 #declare boardw = 9.5    ; // board width (10 inch dimensional)
  16 #declare ledgew = 5.5    ; // ledge width (6 inch dimensional )
  17 #declare lap    = 3.0    ; // ledge end overlap 
  18 #declare ledger = 2.0    ; // ledge corner radius
  19 #declare boardt = 1.5    ; // board thickness
  20 #declare g      = 0.2    ; // drawn board gap (subtract from sides)
  21 #declare postl  = 48     ; // post depth
  22 #declare cabler = 0.15   ; // cable thickness/2
  23 #declare cablee = 1.0    ; // cable end
  24 #declare tl     = 8.0    ; // turnbuckle length
  25 #declare tr     = 0.40   ; // turnbuckle radius
  26 #declare br     = 0.20   ; // bolt radius
  27 #declare bh     = 0.40   ; // bolt head radius
  28 #declare boltl  = 4.0    ; // bolt length
  29 #declare hr     = 3.5    ; // pipe hole radius
  30 #declare por    = 3.4    ; // pipe outer radius
  31 #declare pir    = 3.0    ; // pipe inner radius
  32 #declare sandl  = -0.8   ; // sand depth
  33 #declare hoopr  = 0.6    ; // hoop radius
  34 
  35 #declare r2d= 45.0 / atan2( 1.0, 1.0 );
  36 #declare WoodColor  = color red 0.40 green 0.30 blue 0.02;
  37 #declare DirtColor  = color red 0.28 green 0.25 blue 0.19;
  38 
  39 #declare height = nboard*(boardw+g)   ;
  40 #declare holey  = postl-height        ;
  41 #declare hooph  = hoopr+g             ;
  42 
  43 #include "colors.inc"
  44 global_settings { assumed_gamma 1.0 }
  45 
  46 // camera and sun -------------------------
  47 light_source { < -1000, 5000, -7000> color rgb 1.0 }
  48 camera { angle 30.0  location <70,100,-200> look_at <0,20,0> sky y  }
  49 
  50 // clocks ---------------------------------
  51 
  52 #declare clk10 =  10.0*clock ;
  53 
  54 #declare chole = clk10 - 0.0 ;
  55 #declare cpipe = clk10 - 1.0 ;
  56 #declare cpost = clk10 - 2.0 ;
  57 #declare cside = clk10 - 3.0 ;
  58 #declare cledg = clk10 - 4.0 ;
  59 #declare cbolt = clk10 - 5.0 ;
  60 #declare cdirt = clk10 - 6.0 ;
  61 #declare choop = clk10 - 7.0 ;
  62 
  63 #if ( chole > 1.0 ) #declare chole =  1.0 ; #end
  64 #if ( cpipe > 1.0 ) #declare cpipe =  1.0 ; #end
  65 #if ( cpost > 1.0 ) #declare cpost =  1.0 ; #end
  66 #if ( cside > 1.0 ) #declare cside =  1.0 ; #end
  67 #if ( cledg > 1.0 ) #declare cledg =  1.0 ; #end
  68 #if ( cbolt > 1.0 ) #declare cbolt =  1.0 ; #end
  69 #if ( cdirt > 1.0 ) #declare cdirt =  1.0 ; #end
  70 #if ( choop > 1.0 ) #declare choop =  1.0 ; #end
  71 
  72 #declare csand = cledg ;  // simultaneous with ledge
  73 
  74 #declare cend  = cside ;
  75 #declare ccabl = cside ;
  76 
  77 // draw lawn with holes -----------------------------------
  78 // sinking in
  79 
  80 #declare z0 =  wid/2 + boardt + postt/2 ;
  81 #declare y0 =  holey/6                  ;
  82 #declare y1 =  y0-g - chole*holey/3     ;  // only part way
  83 #declare dx =  (len-postt)/(npost-1)    ;
  84 
  85 union {
  86    difference {
  87       box { < -2000, -1, -2000>, < 2000, 0, 2000> }
  88       union {
  89          #declare x0 = -(len-postt)/2.0          ;
  90          #while( x0 < len/2 )
  91             cylinder{ < x0, y0,  z0 >, < x0, y1,  z0 >, hr }
  92             cylinder{ < x0, y0, -z0 >, < x0, y1, -z0 >, hr }
  93             #declare x0 = x0 + dx ;
  94          #end  // post loop
  95       }
  96       finish { ambient 0.2 diffuse 0.7 } pigment { SpringGreen }
  97    }
  98    
  99    difference {
 100       box { < -2000, -1, -2000>, < 2000, -100, 2000> }
 101       union {
 102          #declare x0 = -(len-postt)/2.0          ;
 103          #while( x0 < len/2 )
 104             cylinder{ < x0, y0,  z0 >, < x0, y1,  z0 >, hr }
 105             cylinder{ < x0, y0, -z0 >, < x0, y1, -z0 >, hr }
 106             #declare x0 = x0 + dx ;
 107          #end  // post loop
 108          }
 109       finish { ambient 0.2 diffuse 0.7 } pigment { DirtColor   }
 110    }
 111 }
 112 
 113 // draw pipes ------------------------------------------------
 114 // sinking in
 115 
 116 #if( cpipe > 0.0 )
 117    union {
 118    #declare z0 =  wid/2 + boardt + postt/2 ;
 119    #declare x0 = -(len-postt)/2.0          ;
 120    #declare dx =  (len-postt)/(npost-1)    ;
 121    #declare y0 =  postl-postl*cpipe        ;
 122    #declare y1 =  y0 - holey               ;
 123    #while( x0 < len/2 )
 124       difference {
 125          cylinder{ < x0, y0  ,  z0 >, < x0, y1  ,  z0 >, por }
 126          cylinder{ < x0, y0+g,  z0 >, < x0, y1-g,  z0 >, pir }
 127       }
 128       difference {
 129          cylinder{ < x0, y0  , -z0 >, < x0, y1  , -z0 >, por }
 130          cylinder{ < x0, y0+g, -z0 >, < x0, y1-g, -z0 >, pir }
 131       }
 132       #declare x0 = x0 + dx ;
 133    #end  // post loop
 134    finish { ambient 0.2 diffuse 0.7 } pigment { Gray10 } 
 135 }
 136 #end  // if cpipe
 137 
 138 // draw posts -----------------------------
 139 // sinking in
 140 #if( cpost > 0.0 )
 141    #declare z0 =  wid/2  + boardt + g  ;
 142    #declare z1 =  z0     + postt       ;
 143    #declare y0 =  height - cpost*postl ;
 144    #declare y1 =  y0     + postl       ;
 145    #declare x0 = -len/2                ;
 146    #declare dx = (len-postt)/(npost-1) ;
 147    union {
 148       #while( x0 < len/2 )
 149          #declare x1 =  x0 + postt ;
 150          box{ < x0, y0,  z0 >, < x1,  y1,  z1 > }
 151          box{ < x0, y0, -z0 >, < x1,  y1, -z1 > }
 152          #declare x0 = x0 + dx ;
 153       #end  // post loop
 154      finish { ambient 0.5 diffuse 0.7 } pigment { WoodColor }
 155    }
 156 #end  // if cpost
 157 
 158 // draw sand ------------------------------------------------
 159 #if( csand > 0.0 )
 160    #declare x0 = len ;
 161    #declare z0 = wid ;
 162    #declare y0 = sandl - (1.0-csand)*holey ;
 163    #declare y1 = y0-1 ;
 164    box { < -x0, y0, -z0>, < x0, y1, z0>
 165       finish { ambient 0.2 diffuse 0.7 } pigment { Gray90 } }
 166 #end // if csand
 167 
 168 // draw end boards ------------------------
 169 // appearing
 170 #if( cend  > 0.0 )
 171    #declare  z0 =  wid/2 + boardt + postt ;
 172    #declare  z1 = -z0                     ;
 173    #declare  y0 =  0.0                    ;
 174    #declare  x0 =  len/2 + g              ;
 175    #declare  x1 =  x0 + boardt            ;
 176    #declare  yd =  boardw + g             ;
 177    union {
 178      #while( y0 < height*cend-g )
 179         #declare  y1 =  y0 + boardw            ;
 180         box { <  x0, y0, z0 >, <  x1, y1, z1 > }
 181         box { < -x0, y0, z0 >, < -x1, y1, z1 > }
 182         #declare y0 = y0 + yd ;
 183      #end
 184      finish { ambient 0.5 diffuse 0.7 } pigment { WoodColor }
 185    }
 186 #end  // if cend
 187 
 188 // draw cables ----------------------------
 189 // appearing
 190 #if( ccabl > 0.0 )
 191    #declare x0 = len/2 - postt - bh            ;
 192    #declare x1 = len/2 - (len-postt)/(npost-1) ;
 193    #declare x2 = -x1                           ;
 194    #declare x3 = -x0                           ;
 195    #declare yd = height / nboard               ;      
 196    #declare y0 = 0.5 * yd                      ;
 197    #declare z0 = wid/2 + boardt + postt/2      ;
 198    #declare z1 = wid/2 + boardt + postt + 2*g  ;
 199    #if( npost < 3 ) 
 200       #declare x1 = 1  ;
 201       #declare x2 = -1 ;
 202       #declare z1 = z0 ;
 203    #end
 204    #declare tx0 = len/2 + boardt + bh + g      ;
 205    #declare tx1 = x0                           ;
 206    #declare tx2 = tx1 - tl                     ;
 207    #declare tx3 = tx2 - tl                     ;
 208    #declare slp = (z1-z0)/(x1-x0)              ;
 209    #declare tz0 = z0                           ;
 210    #declare tz1 = z0                           ;
 211    #declare tz2 = z0 + slp*(tx2-x0)            ;
 212    #declare tz3 = z0 + slp*(tx3-x0)            ;
 213    #while(  y0 < height*ccabl )
 214       union { 
 215          #declare zm = -1 ;
 216          #while( zm < 2 ) 
 217             // cable
 218             cylinder { <  x0, y0, zm* z0>, <  x1, y0, zm* z1 >, cabler }
 219             cylinder { <  x1, y0, zm* z1>, <  x2, y0, zm* z1 >, cabler }
 220             cylinder { <  x2, y0, zm* z1>, <  x3, y0, zm* z0 >, cabler }
 221             // turnbuckle
 222             cylinder { < tx2, y0, zm*tz2>, < tx3, y0, zm*tz3 >, tr     }
 223             // bolts
 224             sphere { <  tx0, y0, zm*tz0>, bh }
 225             sphere { <  tx1, y0, zm*tz0>, bh }
 226             sphere { < -tx0, y0, zm*tz0>, bh }
 227             sphere { < -tx1, y0, zm*tz0>, bh }
 228             #declare zm = zm + 2 ;
 229          #end  // z loop 
 230          finish { ambient 0.5 diffuse 0.7 } pigment { Gray30 }
 231       }
 232       #declare y0 = y0 + yd ;
 233    #end  // y loop
 234 #end  // if ccabl
 235 
 236 // draw side boards -----------------------
 237 // appearing
 238 #if( cside > 0.0 )
 239    #declare  z0 =  wid/2                  ;
 240    #declare  z1 =  z0 + boardt            ;
 241    #declare  y0 =  0.0                    ;
 242    #declare  x0 =  len/2                  ;
 243    #declare  x1 =  -x0                    ;
 244    #declare  yd =  boardw + g             ;
 245    #declare  yy =  boardw*0.8             ;
 246    #while( y0 < height*cside-(g+yy) )
 247       #declare  y1 =  y0 + boardw         ;
 248       union {
 249          box { < x0, y0,  z0 >, < x1, y1,  z1 > }
 250          box { < x0, y0, -z0 >, < x1, y1, -z1 > }
 251          finish { ambient 0.5 diffuse 0.7 } pigment { WoodColor }
 252       }
 253       #declare y0 = y0 + yd ;
 254    #end
 255 #end  // if cside
 256 
 257 // hoops object -----------------------------
 258 
 259 #declare hz0 =  wid/2  + boardt + hoopr  ; //
 260 #declare hy0 =  0                        ; // bottom of hoop posts
 261 #declare hy1 =  hy0 +boardt + height + g ; // top of hoop posts
 262 #declare hooph = hoopr + g               ; // hole through board
 263 
 264 #declare allhoops = union {
 265    #declare hx0 =  hoopr-(len/2-postt)   ; // left side hoop position
 266    #declare hdx =  2*hx0/(1-nhoop)       ; // delta spacing
 267    #while( hx0 < len/2 )
 268       #declare hx1 = hx0 - 2*hoopr       ; //
 269       #declare hx2 = hx0 + 2*hoopr       ; //
 270       #declare hy2 = hy1 + hz0 + 2*hoopr ; //
 271       #declare hz1 = hz0 + 2*hoopr       ; //
 272       cylinder{ < hx0, hy0,  hz0 >, < hx0, hy1,  hz0 >, hoopr }
 273       cylinder{ < hx0, hy0, -hz0 >, < hx0, hy1, -hz0 >, hoopr }
 274       intersection {
 275          box  { < hx1, hy1,  hz1 >, < hx2, hy2, -hz1 >        }
 276          torus{ hz0, hoopr rotate 90*z translate <hx0, hy1, 0>}
 277        }
 278        #declare hx0 = hx0 + hdx ;
 279     #end  // post loop
 280    finish { ambient 0.5 diffuse 0.7 } pigment { White }
 281 }
 282 
 283 #declare hoophole = union {
 284    #declare hx0 =  hoopr-(len/2-postt)      ; // left side hoop position
 285    #declare hdx =  2*hx0/(1-nhoop)          ; // delta spacing
 286    #while( hx0 < len/2 )
 287       cylinder{  < hx0, hy0,  hz0 >, < hx0, hy1,  hz0 >, hooph }
 288       cylinder{  < hx0, hy0, -hz0 >, < hx0, hy1, -hz0 >, hooph }
 289       #declare hx0 = hx0 + hdx ;
 290    #end  // post loop
 291    finish { ambient 0.5 diffuse 0.7 } pigment { WoodColor  }
 292 }
 293 
 294 // top bolts object -----------------------------
 295 
 296 #declare allbolts = union {
 297    #declare bz0 =  wid/2  + boardt + postt/2    ;
 298    #declare by0 =  height + boardt + g   ;
 299    #declare by1 =  by0    - boltl        ;
 300    #declare bx0 = -(len-postt)/2.0       ;
 301    #declare bdx =  (len-postt)/(npost-1) ;
 302       #while( bx0 < len/2 )
 303          sphere  { < bx0, by0,  bz0 >,                      bh }
 304          cylinder{ < bx0, by0,  bz0 >, < bx0,  by1,  bz0 >, br }
 305          sphere  { < bx0, by0, -bz0 >,                      bh }
 306          cylinder{ < bx0, by0, -bz0 >, < bx0,  by1, -bz0 >, br }
 307       #declare bx0 = bx0 + bdx ;
 308    #end  // post loop
 309    finish { ambient 0.5 diffuse 0.7 } pigment { Gray30 }
 310 }
 311 
 312 // draw ledge boards ------------------------
 313 //  descend from top
 314 #if( cledg > 0.0 )
 315    #declare  z0 =  wid/2                ;
 316    #declare  z1 =  z0     + ledgew      ;
 317    #declare  y0 =  height *(2.0-cledg)  ;
 318    #declare  y1 =  y0     + boardt      ;
 319    #declare  x0 =  len/2 + boardt + lap ;
 320    #declare  x1 = -x0                   ;
 321    #declare lx0 =  x0 + 1.0             ;
 322    #declare lx1 =  x0 + g - ledger      ;
 323    #declare ly0 =  y0 - 1.0             ;
 324    #declare ly1 =  y1 + 1.0             ;
 325    #declare lz0 =  z1 + 1.0             ;
 326    #declare lz1 =  z1 + g - ledger      ;
 327    difference {
 328       union {
 329         box{ < x0, y0,  z0 >,  <x1, y1,  z1> }
 330         box{ < x0, y0, -z0 >,  <x1, y1, -z1> }
 331       }
 332       difference {                 // rounded corners
 333          union {
 334            // negative block, corners
 335            box      { <  lx0, ly0,  lz0 >, <  lx1, ly1,  lz1 >         }
 336            box      { < -lx0, ly0,  lz0 >, < -lx1, ly1,  lz1 >         }
 337            box      { <  lx0, ly0, -lz0 >, <  lx1, ly1, -lz1 >         }
 338            box      { < -lx0, ly0, -lz0 >, < -lx1, ly1, -lz1 >         }
 339            // negative block, hoop and bolt holes
 340            #if( cbolt > 0.0 ) 
 341               object { hoophole
 342                  finish { ambient 0.5 diffuse 0.7 } pigment { WoodColor }
 343               }
 344               object { allbolts
 345                  finish { ambient 0.5 diffuse 0.7 } pigment { WoodColor }
 346               }
 347            #end 
 348          }
 349          union {  // double negative cylinder
 350            cylinder { <  lx1, ly0,  lz1 >, <  lx1, ly1,  lz1 >, ledger }
 351            cylinder { < -lx1, ly0,  lz1 >, < -lx1, ly1,  lz1 >, ledger }
 352            cylinder { <  lx1, ly0, -lz1 >, <  lx1, ly1, -lz1 >, ledger }
 353            cylinder { < -lx1, ly0, -lz1 >, < -lx1, ly1, -lz1 >, ledger }
 354          }
 355       }
 356       finish { ambient 0.5 diffuse 0.7 } pigment { WoodColor }
 357    }
 358 #end  // if cledg
 359 
 360 // draw top bolts -----------------------------
 361 // sinking in
 362 #if( cbolt > 0.0 )
 363    #declare byd =  (1.0-cbolt)*1.6*boltl ;
 364    object{ allbolts translate byd*y }
 365 #end  // if cbolt
 366 
 367 // dirt ---------------------------------------------------
 368 // filling
 369 #if( cdirt > 0.0 )
 370   #declare dy1 = cdirt*height + dirtd;
 371   box{ <-len/2, dy1 , -wid/2 >, < len/2, -1.0 ,  wid/2 >
 372        finish { ambient 0.1 diffuse 0.7 } pigment { DirtColor }
 373   }
 374 #end  // if cdirt
 375 
 376 // draw hoops -----------------------------
 377 // sinking in
 378 #if( choop > 0.0 ) 
 379    #declare hpy =  1.2*height*(1-choop) ;
 380    object { allhoops translate < 0, hpy, 0 > }
 381 #end  // if hoop
 382 

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2014-02-22 03:13:15, 13.3 KB) [[attachment:raisedbed-8hoop.pov]]
  • [get | view] (2022-03-14 23:50:02, 2080.3 KB) [[attachment:raisedbed480.png]]
  • [get | view] (2014-02-22 04:50:25, 4362.0 KB) [[attachment:raisedbed480.swf]]
 All files | Selected Files: delete move to page

You are not allowed to attach a file to this page.