//#include "colors.inc" //#include "textures.inc" //NOT NEEDED WHEN USED AS AN INCLUDE FILE #declare blade = difference { #declare magicbox = box { <-.1,0,-.1> <.1,-3,.1> rotate 45*y} union { object {magicbox} intersection { object {magicbox translate -.5*x rotate 60*z} object {magicbox translate .5*x rotate -60*z} scale <.8,4,1> translate y*1.1 } intersection { object {magicbox translate <0,1,0> rotate 30*z } object {magicbox translate <0,1,0> rotate -30*z } object {magicbox} translate -3*y } } merge { sphere {< 0, -.5, sqrt(.08)/2> .08} sphere {< 0, -3, sqrt(.08)/2> .08} cylinder {< 0, -.5, sqrt(.08)/2> < 0, -3, sqrt(.08)/2> .08} sphere {< 0, -.5, -sqrt(.08)/2> .08} sphere {< 0, -3, -sqrt(.08)/2> .08} cylinder {< 0, -.5, -sqrt(.08)/2> < 0, -3, -sqrt(.08)/2> .08} } scale <1.3,1,.3> texture{pigment{color rgb .5} finish {reflection .7}} } #declare n = 4 #declare th = 180/n #declare s = sin(radians(th))/(1+sin(radians(th))) #declare l = s/tan(radians(th)) #declare h = sin(radians(th)) #declare firstsplice = intersection { cylinder { 0 .1*z 1 } //This is the large circle, of radius R, and R happens to equal 1 plane {y h} // This is the first planar cut, which is D units away from the center ^ plane {(-1*y) h} plane {(-1*x) (-1*l)} } #declare fourthsplice = difference { object {firstsplice} //Commenting here would be redundant cylinder { s-.00001} // The bottom circle... } #declare gms = merge { object{fourthsplice} //Whew, all that work's paying off... cylinder{ s} // SHOULD be a mirror image of the bottom circle over x axis... } #declare counter = 0 #declare metaphysicmerge = merge { #while (n >= counter) object {gms rotate z*((360/n)*counter) } #declare counter = counter + 1 #end } #declare centerstar = intersection { cylinder {0 .1*z 1-s} difference { cylinder {-.1*z .2*z 1} object{ metaphysicmerge translate -.05*z scale <1,1,100> } } } #declare darq = union { sphere {<-.12,0,0> .01} sphere {<.12,0,0> .01} } #declare diamondbox = box { (-.5),(.5) rotate 45*z scale } #declare hilt = union { union { union{cylinder {<0,0,0> <0,1.1,0> .12 } // braiding #declare twx = 300 #declare n = 0 #while (n < twx) #declare n = n+1 object { darq rotate y*(n*3*360/twx) translate y*1.1*(n/twx) } #end object {diamondbox scale <.18,.18,.24> translate y*1.1 texture{pigment{color rgb .4} finish {phong .2 reflection .03}}} scale <1,1,.3> } //sphere {<0,1.1,0> .15} union { cylinder { 0 <-.7,0,0> .1 } cylinder { 0 <.7,0,0> .1 } //These boxes are wrong. //box { <.7,-.1,-.1>,<.7,.1,.1> } //box { <-.7,-.1,-.1>,<-.7,.1,.1> } union{ object {diamondbox scale <.15,.15,.2> translate <-.7,0,0>} object {diamondbox scale <.15,.15,.2> translate <.7,0,0>} texture{pigment{color rgb .4} finish {phong .2 reflection .03}} } //sphere { <-.7,-.2,0> .13 } //sphere { <.7,-.2,0> .13 } scale <1,1,.3> } texture {pigment {color rgb .4} finish {phong .3 reflection .3}} } object { diamondbox scale <.35,.28,.03> translate -.3*sqrt(.08)*.5*z texture{pigment{color rgb <.6,.6,.6>} finish {reflection .7}} } //gem sphere {0 .2 texture{pigment{color rgb <.65,.7,.85>} finish {phong .3 reflection .5}} scale <1,1,.55>} } #declare sword = union { object {hilt} object {blade scale <.9,1.3,.8>} // finish {phong 1 reflection 1} } /* //USEFUL ONLY FOR EDITING THE OBJECT!!! //sphere {0 100 texture{Shadow_Clouds scale 8} clipped_by {plane {z 0}}} object {sword rotate 30*y} light_source { <3,3,-3> color White rotate y*90 } camera { location <0,-2,-8> look_at <0,-2,0> } */ // WILBURY TWIST!