// The font used for the bobanddoug.com web site.
// 6 April 2002 by Erik Niklas.
// Final renderings done with options: +W800 +H600 +A0.8 +R8 +V +D +P (3.5)
// for POV-Ray 3.1 add option +L/usr/local/povray31/include

#include "colors.inc"
#include "textures.inc"
#include "finish.inc"

/* For looking at 'bobanddoug.com' (used for the main site title)
camera {
    location <7.15, 0, -15.5>
    look_at <7.15, 0, 0>
}
*/

// For looking at 'erikniklas.net'
camera {
    location <6, 0, -12>
    look_at <6, 0, 0>
}

//background { rgb <(5/256), (27/256), (51/256)> }  // Navy blue (left pane)
background { rgb <(9/256), (33/256), (75/256)> }    // Navy blue (main window)
//background { rgb <1, 1, 1> }                      // White

/* For looking at 'albums' or 'movies'
camera {
    location <2.75, 0, -12>
    look_at <2.75, 0, 0>
}
*/

/* for looking at 'sounds'
camera {
    location <3.3, 0, -12>
    look_at <3.3, 0, 0>
}
*/

/* For looking at 'pictures'
camera {
    location <0, 0, -12>
    look_at 0
}
*/

/* For looking at 'the_stash'
camera {
    location <4.4, 0, -12>
    look_at <4.4, 0, 0>
}
*/

/* For looking at 'news'
camera {
    location <1.925, 0, -12>
    look_at <1.925, 0, 0>
}
*/

/* For looking at 'powered_by'
camera {
    location <4.8125, 0, -12>
    look_at <4.8125, 0, 0>
}
*/

/* For looking at a single letter
camera {
    location <0, 0, -5>
    look_at <0, 0, 0>
}
*/

//light_source { <750, 500, -1000> White }    // For vertical title and 'stash'
light_source { <-750, 500, -1000> White }     // For all other titles
/* The following 4 lines will light up 'bobanddoug.com' nicely
light_source { <-.2, 0, -3> White }
light_source { <3.1, 0, -3> White }
light_source { <7.15, 0, -3> White }
light_source { <11.3, 0, -3> White }
*/

#declare short_vbar = union {
    box {                       // Top plate
        <0.15, -0.4, -0.05>,    // Near lower left
        <0.4, 0, -0.04>         // Far upper right
    }

    box {                       // Bottom plate
        <0, -0.55, 0>,          // Near lower left
        <0.55, 0, 0>            // Far upper right
    }

    mesh {
        // Bottom
        triangle { <0, -0.55, 0>, <0.55, -0.55, 0>, <0.15, -0.4, -0.05> }
        triangle { <0.4, -0.4, -0.05>, <0.55, -0.55, 0>, <0.15, -0.4, -0.05> }
        // Right
        triangle { <0.4, -0.4, -0.05>, <0.4, 0, -0.05>, <0.55, 0, 0> }
        triangle { <0.4, -0.4, -0.05>, <0.55, -0.55, 0>, <0.55, 0, 0> }
        // Left
        triangle { <0, -0.55, 0>, <0, 0, 0>, <0.15, 0, -0.05> }
        triangle { <0, -0.55, 0>, <0.15, -0.4, -0.05>, <0.15, 0, -0.05> }
    }
}

#declare long_vbar = union {
    box {                       // Top plate of vertical bar
        <0.15, 0, -0.05>,       // Near lower left
        <0.4, 0.95, -0.04>      // Far upper right
    }

    box {                       // Bottom plate of vertical bar
        <0, 0, 0>,              // Near lower left
        <0.55, 1.1, 0>          // Far upper right
    }

    mesh {
        // Left side of vertical bar
        triangle { <0, 0, 0>, <0, 1.1, 0>, <0.15, 0.95, -0.05> }
        triangle { <0, 0, 0>, <0.15, 0, -0.05>, <0.15, 0.95, -0.05> }

        // Top of vertical bar
        triangle { <0, 1.1, 0>, <0.55, 1.1, 0>, <0.15, 0.95, -0.05>}
        triangle { <0.4, 0.95, -0.05>, <0.55, 1.1, 0>, <0.15, 0.95, -0.05>}

        // Right side of vertical bar
        triangle { <0.55, 1.1, 0>, <0.55, 0, 0>, <0.4, 0.95, -0.05> }
        triangle { <0.4, 0, -0.05>, <0.55, 0, 0>, <0.4, 0.95, -0.05> }
    }
}

#declare mid_vbar = union {
    box {                       // Top plate of vertical bar
        <0.15, 0, -0.05>,       // Near lower left
        <0.4, 0.7, -0.04>       // Far upper right
    }

    box {                       // Bottom plate
        <0, 0, 0>,
        <0.55, 0.85, 0>
    }

    mesh {
        // Left side of vertical bar
        triangle { <0, 0, 0>, <0, 0.85, 0>, <0.15, 0.7, -0.05> }
        triangle { <0, 0, 0>, <0.15, 0, -0.05>, <0.15, 0.7, -0.05> }

        // Top
        triangle { <0, 0.85, 0>, <0.55, 0.85, 0>, <0.15, 0.7, -0.05> }
        triangle { <0.15, 0.7, -0.05>, <0.55, 0.85, 0>, <0.4, 0.7, -0.05> }

        // Right side
        triangle { <0.4, 0, -0.05>, <0.55, 0.85, 0>, <0.4, 0.7, -0.05> }
        triangle { <0.4, 0, -0.05>, <0.55, 0.85, 0>, <0.55, 0, 0> }
    }
}

#declare o = difference {
    cone {
        <0, 0, -0.05>, 0.4      // Center and radius of top
        <0, 0, 0>, 0.55         // Center and radius of bottom
    }

    cone {
        <0, 0, -0.0501>, 0.15   // Center and radius of top
        <0, 0, 0.0001>, 0       // Center and radius of bottom
    }
}

#declare d =
    union {
        object { o }
        object { long_vbar }
    }

#declare b =
    union {
        object { o }
        object { long_vbar translate -0.55*x }
    }

#declare a =
    union {
        object { o }
        object { short_vbar }
    }

#declare n =
    union {
        difference {
                object { o }
                box {
                        <-0.5501, -0.5501, 0.0001>      // Near lower left
                        <0.5501, -0.0001, -0.0501>      // Far upper right
                }
        }

        object { short_vbar translate -0.55*x }
        object { short_vbar }
    }

#declare vertical_tail_section = union {
    box {                       // Top plate
        <0.15, -0.5501, -0.05>, // Near lower left
        <0.4, 0, -0.04>         // Far upper right
    }
    box {                       // Bottom plate
        <0, -0.5501, 0>,        // Near lower left
        <0.55, 0, 0>            // Far upper right
    }
    mesh {
        triangle {<0, -0.55, 0>, <0.15, -0.55, -0.05>, <0.15, -0.39, -0.05>}
        triangle { <0.4, -0.55, -0.05>, <0.4, 0, -0.05>, <0.55, 0, 0> }
        triangle { <0.4, -0.55, -0.05>, <0.55, -0.55, 0>, <0.55, 0, 0> }
    }
}

#declare horizontal_tail_section = union {
    box {                       // Top plate
        <-0.4, -0.95, -0.05>    // Near lower left
        <0.0001, -0.7, -0.04>   // Far upper right
    }
    box {                       // Bottom plate
        <-0.55, -1.1, 0>        // Near lower left
        <0.0001, -0.55, 0>      // Far upper right
    }
    mesh {
        // Top
        triangle { <-0.55, -0.55, 0>, <0, -0.55, 0>, <-0.4, -0.7, -0.05> }
        triangle { <0, -0.7, -0.05>, <0, -0.55, 0>, <-0.4, -0.7, -0.05> }
        // Left
        triangle { <-0.55, -1.1, 0>, <-0.55, -0.55, 0>, <-0.4, -0.7, -0.05>}
        triangle {<-0.55, -1.1, 0>,<-0.4, -0.95, -0.05>,<-0.4, -0.7, -0.05>}
        // Bottom
        triangle { <-0.55, -1.1, 0>, <-0.4, -0.95, -0.05>, <0, -1.1, 0> }
        triangle { <0, -0.95, -0.05>, <-0.4, -0.95, -0.05>, <0, -1.1, 0> }
    }
}

#declare tail_curve = difference {
    object { o }
    box {                               // Gets rid of top half
        <-0.5501, 0.0000001, -0.0501>,  // Near lower left
        <0.5501, 0.5501, 0.0001>        // Far upper right
    }
    box {                               // Gets rid of lower left quadrant
        <-0.5501, -0.55, -0.0501>       // Near lower left
        <0, 0.0001, 0.0001>             // Far upper right
    }
}

#declare g = union {
    object { o }
    object { vertical_tail_section }
    object { tail_curve translate -0.55*y }
    object { horizontal_tail_section }
}

#declare c =
    object { n rotate 90*z }

#declare small_u =    // 'u' seems to be reserved ;-)
    object { n rotate 180*z }

#declare dot =
    cone {
        <0, -0.275, -0.05>, 0.125
        <0, -0.275, 0>, 0.275
    }

#declare m =
    union {
        object { n translate -0.275*x }
        object { n translate 0.275*x }
    }

#declare e = union {
    object { c }

    box {                       // Top plate (no bottom plate needed)
        <-0.25, -0.25, -0.05>   // Near lower left
        <0.31, 0, 0>            // Far upper right
        rotate 45*z translate 0.105*y
    }

    mesh {      // This is kind of a cheat, but makes it look much cleaner
        triangle { <0.4, 0.15, -0.05>, <0.55, 0, 0>, <0.1, -0.15, -0.05> }
    }
}

#declare i =
    union {
        box {
                // Top plate
                <-0.125, -0.4, -0.05>   // Near lower left
                <0.125, 0.4, -0.04>     // Far upper right
        }
        box {
                // Bottom plate
                <-0.275, -0.55, 0>      // Near lower left
                <0.275, 0.55, 0>        // Far upper right
        }

        mesh {
                // Top edge
                triangle {<-0.125, 0.4, -0.05>, <-0.275, 0.55, 0>, <0.275, 0.55, 0>}
                triangle {<-0.125, 0.4, -0.05>,<0.125, 0.4, -0.05>,<0.275, 0.55, 0>}

                // Bottom edge
                triangle {<-0.125, -0.4, -0.05>,<-0.275, -0.55, 0>,<0.275, -0.55, 0>}
                triangle {<-0.125, -0.4, -0.05>,<0.125, -0.4, -0.05>,<0.275, -0.55, 0>}
                // Left edge
                triangle {<-0.125, 0.4, -0.05>,<-0.275, 0.55, 0>,<-0.275, -0.55, 0>}
                triangle {<-0.125, 0.4, -0.05>, <-0.125, -0.4, -0.05>, <-0.275, -0.55, 0>}
                // Right edge
                triangle {<0.125, 0.4, -0.05>,<0.275, 0.55, 0>,<0.275, -0.55, 0>}
                triangle {<0.125, 0.4, -0.05>,<0.125, -0.4, -0.05>,<0.275, -0.55, 0>}
        }

        // Dot
        object { dot translate 1.1*y }
    }

#declare diameter_bar =
    union {
        box {
                // Top plate
                <-0.4, -0.125, -0.05>   // Near lower left
                <0.4, 0.125, -0.04>     // Far upper right
        }

        box {
                // Bottom plate
                <-0.55, -0.275, 0>      // Near lower left
                <0.55, 0.275, 0>        // Far upper right
        }

        mesh {
                // Top edge
                triangle { <-0.4, 0.125, -0.05>,<-0.55, 0.275, 0>,<0.55, 0.275, 0> }
                triangle {<-0.4, 0.125, -0.05>,<0.4, 0.125, -0.05>,<0.55, 0.275, 0>}

                // Bottom edge
                triangle {<-0.4, -0.125, -0.05>,<-0.55, -0.275, 0>,<0.55, -0.275, 0>}
                triangle {<-0.4, -0.125, -0.05>,<0.4, -0.125, -0.05>,<0.55, -0.275, 0>}

                // Left edge
                triangle {<-0.55, 0.275, 0>,<-0.4, 0.125, -0.05>,<-0.55, -0.275, 0>}
                triangle {<-0.4, -0.125, -0.05>,<-0.4, 0.125, -0.05>,<-0.55, -0.275, 0>}

                // Right edge
                triangle {<0.4, 0.125, -0.05>,<0.55, 0.275, 0>,<0.55, -0.275, 0>}
                triangle {<0.4, 0.125, -0.05>,<0.4, -0.125, -0.05>,<0.55, -0.275, 0>}
        }
    }

#declare s_tail =
    union {
        box {
                <0.275, 0.15, -0.05>    // Near lower left
                <0.4, 0.4, -0.04>       // Far upper right
        }

        mesh {
                // Top edge
                triangle {<0.275, 0.4, -0.05>,<0.275, 0.55, 0>,<0.55, 0.55, 0>}
                triangle {<0.275, 0.4, -0.05>,<0.4, 0.4, -0.05>,<0.55, 0.55, 0>}

                // Outer edge
                triangle {<0.4, 0.4, -0.05>,<0.55, 0.55, 0>,<0.55, 0, 0>}
                triangle {<0.4, 0.4, -0.05>,<0.4, 0.15, -0.05>,<0.55, 0, 0>}

                // Bottom edge
                triangle {<0.275, 0.15, -0.05>,<0.4, 0.15, -0.05>,<0.55, 0, 0>}
                triangle {<0.275, 0.15, -0.05>,<0.275, 0, 0>,<0.55, 0, 0>}
        }
    }

#declare s =
    union {
        object { tail_curve translate -0.275*x }
        object { tail_curve rotate 180*z translate 0.275*x }

        object { s_tail }
        object { s_tail rotate 180*z }
    }

#declare small_v = union {
    polygon {   // Top plate
        7,      // Number of sides + 1
        <-0.4, 0.4>, <-0.15, 0.4>, <0, 0>,
        <0.15, 0.4>, <0.4, 0.4>, <0, -0.4>, <-0.4, 0.4>
        translate -0.05*z
    }

    mesh {
        // Bottom plate
        triangle { <-0.55, 0.55, 0>, <0.55, 0.55, 0>, <0, -0.55, 0> }
        // Top left edge
        triangle { <-0.4, 0.4, -0.05>, <-0.55, 0.55, 0>, <0, 0.55, 0> }
        triangle { <-0.4, 0.4, -0.05>, <-0.15, 0.4, -0.05>, <0, 0.55, 0> }
        // Top right edge
        triangle { <0.15, 0.4, -0.05>, <0, 0.55, 0>, <0.55, 0.55, 0> }
        triangle { <0.15, 0.4, -0.05>, <0.4, 0.4, -0.05>, <0.55, 0.55, 0> }
        // Inner left edge
        triangle { <0, 0.55, 0>, <-0.15, 0.4, -0.05>, <0, 0, -0.05> }
        // Inner right edge
        triangle { <0, 0.55, 0>, <0.15, 0.4, -0.05>, <0, 0, -0.05> }
        // Left edge
        triangle { <-0.55, 0.55, 0>, <-0.4, 0.4, -0.05>, <0, -0.55, 0> }
        triangle { <0, -0.4, -0.05>, <-0.4, 0.4, -0.05>, <0, -0.55, 0> }
        // Right edge
        triangle { <0.55, 0.55, 0>, <0.4, 0.4, -0.05>, <0, -0.55, 0> }
        triangle { <0, -0.4, -0.05>, <0.4, 0.4, -0.05>, <0, -0.55, 0> }
    }
}

#declare half_small_v = difference {
    object { small_v }

    box {                // Remove left half
        <-1, -1, -0.1>   // Near lower left
        <0, 1, 0.1>      // Far upper right
    }
}

#declare t_tail = union {
    box {                       // Top plate
        <0, -0.4, -0.05>        // Near lower left
        <0.125, -0.15, -0.04>   // Far upper right
    }

    box {                // Bottom plate
        <0, -0.55, 0>    // Near lower left
        <0.275, 0, 0>    // Far upper right
    }

    mesh {
        // Top edge
        triangle { <0, -0.15, -0.05>, <0, 0, 0>, <0.275, 0, 0> }
        triangle { <0, -0.15, -0.05>, <0.125, -0.15, -0.05>, <0.275, 0, 0> }
        // Right edge
        triangle { <0.125, -0.4, -0.05>, <0.125, -0.15, -0.05>, <0.275, 0, 0> }
        triangle { <0.125, -0.4, -0.05>, <0.275, -0.55, 0>, <0.275, 0, 0> }
        // Bottom edge
        triangle { <0.125, -0.4, -0.05>, <0.275, -0.55, 0>, <0, -0.4, -0.05> }
        triangle { <0, -0.55, 0>, <0.275, -0.55, 0>, <0, -0.4, -0.05> }
    }
    translate 0.275*x
}

#declare t_with_tail = union {    // looks nice w/tall letters, but not short ones
    object { long_vbar translate -0.275*x }
    object { tail_curve rotate -90*z translate 0.275*x }
    object { diameter_bar translate 0.425*y }
    object { t_tail }             // short_vbar almost works, but not quite
}

#declare small_t = union {        // 't' seems to be reserved
    object { long_vbar translate <-0.275, -0.2125, 0> }
    object { long_vbar translate -0.275*x rotate 180*z translate 0.55*y }
    object { diameter_bar translate 0.275*y }
}

#declare p = object { d rotate 180*z }

#declare r = union {
    object { tail_curve rotate 180*z translate 0.275*x }
    object { t_tail translate 0.55*y }
    object { short_vbar translate -0.275*x }
}

#declare l = union {
    object { long_vbar translate -0.275*x }
    object { long_vbar translate -0.275*x rotate 180*z translate 0.55*y }
}

#declare h = union {
    object { tail_curve rotate 90*z }
    object { short_vbar }
    object { l translate -0.275*x }

    // This will bridge the two pieces together
    box {
        <-0.15, 0.15, -0.05>      // Near lower left
        <0, 0.4, -0.05>           // Far upper right
    }
    mesh {
        // Top edge
        triangle { <-0.15, 0.4, -0.05>, <0, 0.4, -0.05>, <0, 0.55, 0> }
        // Bottom edge
        triangle { <-0.15, 0.15, -0.05>, <0, 0.15, -0.05>, <0, 0, 0> }
    }
}

#declare w = object { m rotate 180*z }

#declare small_y = union {
    object { small_u }
    object { vertical_tail_section }
    object { tail_curve translate -0.55*y }
    object { horizontal_tail_section }
}

#declare k = union {
    object { h }
    object { mid_vbar rotate -45*z translate <-0.4, 0.5, 0> }
}

#declare k2 = union {
    object { n }
    // Need vertical bar slightly shorter than usual to make dot flush
    object { long_vbar translate <-0.55, -0.05, 0> }
    object { dot translate <0.275, 1.05, 0> }
}

#declare k3 = union {
    object { l }
    object { half_small_v translate 0.15*x }
}

#declare k4 = union {
    object { h }
    object { mid_vbar rotate -90*z translate <-0.3, 0.8, 0> }
}

#declare k5 = union {
    object { h }
    object { small_u translate <0, 0.55, 0> }
}

#declare bobanddougdotcom = union {
    object { b }
    object { o translate 1.1*x }
    object { b translate 2.2*x }
    object { a translate 3.3*x }
    object { n translate 4.4*x }
    object { d translate 5.5*x }
    object { d translate 6.6*x }
    object { o translate 7.7*x }
    object { small_u translate 8.8*x }
    object { g translate 9.9*x }
    object { dot translate 10.725*x }
    object { c translate 11.5*x }
    object { o translate 12.6*x }
    object { m translate 13.975*x }
}

#declare sounds = union {
    object { s }
    object { o translate 1.1*x }
    object { small_u translate 2.2*x }
    object { n translate 3.3*x }
    object { d translate 4.4*x }
    object { s translate 5.5*x }
}

#declare movies = union {
    object { m }
    object { o translate 1.375*x }
    object { small_v translate 2.275*x }
    object { i translate 3.1*x }
    object { e translate 3.925*x }
    object { s translate 5.025*x }
}

#declare pictures = union {
    object { p translate -3.3*x }
    object { i translate -2.475*x }
    object { c translate -1.65*x }
    object { small_t translate -0.55*x }
    object { small_u translate 0.55*x }
    object { r translate 1.375*x }
    object { e translate 2.475*x }
    object { s translate 3.575*x }
}

#declare albums = union {
    object { a }
    object { l translate 0.825*x }
    object { b translate 1.675*x }
    object { small_u translate 2.775*x }
    object { m translate 4.15*x }
    object { s translate 5.525*x }
}

#declare the_stash = union {
    object { small_t }
    object { h translate 1.1*x }
    object { e translate 2.2*x }
    object { s translate 4.4*x }
    object { small_t translate 5.5*x }
    object { a translate 6.6*x }
    object { s translate 7.7*x }
    object { h translate 8.8*x }
}

#declare news = union {
    object { n }
    object { e translate 1.1*x }
    object { w translate 2.475*x }
    object { s translate 3.85*x }
}

#declare powered_by = union {
    object { p }
    object { o translate 1.1*x }
    object { w translate 2.475*x }
    object { e translate 3.85*x }
    object { r translate 4.675*x }
    object { e translate 5.775*x }
    object { d translate 6.875*x }

    object { b translate 8.525*x }
    object { small_y translate 9.625*x }
}

#declare erikniklasdotnet = union {
    object { e }
    object { r translate 0.825*x }
    object { i translate 1.65*x }
    object { k translate 2.5*x }
    object { n translate 3.6*x }
    object { i translate 4.425*x }
    object { k translate 5.25*x }
    object { l translate 6.075*x }
    object { a translate 6.9*x }
    object { s translate 8*x }
    object { dot translate 8.575*x }
    object { n translate 9.4*x }
    object { e translate 10.5*x }
    object { small_t translate 11.6*x }
}

object { erikniklasdotnet texture { Dull } rotate <15, 0, 0> }