#debug "Surfaces.inc: Loading...\n" #declare SurfacesAreLoaded=1; #ifndef(ElectronicsAreLoaded) #declare SurfacesAreAlone=1; #include "electronics.inc" #else #declare SurfacesAreAlone=0; #end // ------------------------------------------------------------------------------------------------ #macro PCBmemory() #declare T_PCBBoard = texture{pigment{color Gray20}} #declare T_PCBSurface = texture{pigment{color rgb<0.0, 0.2, 0.0>}} #declare T_PCBMask = texture{pigment{color rgb<0.0, 0.4, 0.0>}} #local mainX = 108.0; #local mainY = 25.4; #local mainZ = 1.3; #local EtchDepth = 0.1; #local Cutter= union{ cylinder{< 0.0, 5.4, -mainZ>, < 0.0, 5.4, mainZ>, 2.0} box{ <-2.0, -2.0, -mainZ>, < 2.0, 5.4, mainZ> } cylinder{< 3.5, 10.0, -mainZ>, < 3.5, 10.0, mainZ>, 1.5} cylinder{< 54.5, 0.0, -mainZ>, < 54.5, 0.0, mainZ>, 1.5} cylinder{<104.5, 10.0, -mainZ>, <106.5, 10.0, mainZ>, 1.5} } #local MainBoard= difference{ box{ < 0, 0, -(mainZ/2)+(2*EtchDepth)>, //the main board } cylinder{< 0.0, 5.4, -mainZ>, < 0.0, 5.4, mainZ>, 2.0} //the rounded top to the edge notch box{ <-2.0, -2.0, -mainZ>, < 2.0, 5.4, mainZ>} //the square bit of the edge notch cylinder{< 3.5, 10.0, -mainZ>, < 3.5, 10.0, mainZ>, 1.5} //the left hole cylinder{< 54.5, 0.0, -mainZ>, < 54.5, 0.0, mainZ>, 1.5} //the middle notch cylinder{<104.5, 10.0, -mainZ>, <106.5, 10.0, mainZ>, 1.5} //the right hole } #local Surface= difference{ box{ < 0, 0.1, -(mainZ/2)+(1*EtchDepth)>, //the surface } cylinder{< 3.5, 10.0, -mainZ>, < 3.5, 10.0, mainZ>, 1.9} //the left hole cylinder{< 54.5, 0.0, -mainZ>, < 54.5, 0.0, mainZ>, 1.9} //the middle notch cylinder{<104.5, 10.0, -mainZ>, <106.5, 10.0, mainZ>, 1.9} //the right hole cylinder{< 0.0, 5.4, -mainZ>, < 0.0, 5.4, mainZ>, 2.4} //the rounded top to the edge notch box{ < -2.0, -2.0, -mainZ>, < 2.4, 5.4, mainZ>} //the square bit of the edge notch box{ < -2.0, -2.0, -mainZ>, <110.0, 0.4, mainZ>} //make the bottom edge smaller box{ < -2.0, 25.0, -mainZ>, <110.0, 27.4, mainZ>} //make the top edge smaller box{ < -2.0, -2.0, -mainZ>, < 0.4, 27.4, mainZ>} //make the left edge smaller box{ <107.6, -2.0, -mainZ>, <110.0, 27.4, mainZ>} //make the right edge smaller } #local Mask= difference{ object{Surface scale 1.1*z} cylinder{< 3.5, 10.0, -mainZ>, < 3.5, 10.0, mainZ>, 2.2} //the left hole cylinder{< 54.5, 0.0, -mainZ>, < 54.5, 0.0, mainZ>, 2.2} //the middle notch cylinder{<104.5, 10.0, -mainZ>, <106.5, 10.0, mainZ>, 2.2} //the right hole cylinder{< 0.0, 5.4, -mainZ>, < 0.0, 5.4, mainZ>, 2.7} //the rounded top to the edge notch box{ < -2.0, -2.0, -mainZ>, < 2.7, 5.4, mainZ>} //the square bit of the edge notch box{ < -2.0, -2.0, -mainZ>, <110.0, 2.7, mainZ>} //make the bottom edge smaller box{ < -2.0, 24.7, -mainZ>, <110.0, 27.4, mainZ>} //make the top edge smaller box{ < -2.0, -2.0, -mainZ>, < 0.7, 27.4, mainZ>} //make the left edge smaller box{ <107.3, -2.0, -mainZ>, <110.0, 27.4, mainZ>} //make the right edge smaller box{< 50, 10, -mainZ>, < 60, 12, mainZ>} //take some holes out the mask } union{ object{MainBoard texture{T_PCBBoard}} object{Surface texture{T_PCBSurface}} object{Mask texture{T_PCBMask}} translate -mainX/2*x } #end // ------------------------------------------------------------------------------------------------ #if (SurfacesAreAlone=1) global_settings{ //ambient_light color White*2 assumed_gamma 1.0 max_trace_level 5 } #declare TSLookFrom = <-40, 30, -50>; #declare TSLookAt = < 0, 8, 0>; #declare TSLookAngle = 40; camera{ location TSLookFrom look_at TSLookAt angle TSLookAngle } light_source{ <0, 0, 0> // light's position (translated below) color rgb <1, 1, 1> // light's color translate <-30, 50, -30> } light_source{ <0, 0, 0> // light's position (translated below) color rgb <1, 1, 1> // light's color translate <90, 50, 20> } //plane{y, -1 texture{pigment{checker color rgb 1 color blue 1} finish{diffuse 0.8 ambient 0.1}}} //cylinder{<0, -100, 0>,<0, 100, 0>, 0.01 pigment{color Red}} cylinder{<-100, 0, 0>,<100, 0, 0>, 0.01 pigment{color Red}} cylinder{<0, 0, -100>,<0, 0, 100>, 0.01 pigment{color Red}} //object{Breadboard(1) translate 150*x} object{PCBmemory() translate<0, 0, 0> rotate 45*x} #end // ------------------------------------------------------------------------------------------------