home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ray Tracing Box
/
RAY_CD.mdf
/
raytrace
/
_pov_dat
/
spark
/
spark.inc
< prev
next >
Wrap
Text File
|
1993-03-15
|
7KB
|
259 lines
/*
* SPARK.INC
*
* Spark plug, centered on <0 0 0>, and contained in the space
* from <-1.73 -0.39 -0.48> to <1.33 0.39 0.48 >, aligned along the X axis,
* with the spark end at +X, the terminal end at -X.
*
* This file REQUIRES the following include files:
*
* COLORS.INC POVRAY file
* SHAPES.INC "
* TEXTURES.INC "
*
* RIBCYL.INC included with this file
*
* RN9YC.GIF "
* MADEIN.GIF "
*
* Note: this object requires LOTS of memory. I set the Region
* setting with POVMOD.EXE to 8M.
*
* John Lowery
* 71075, 1401
*/
#declare Spark_Plug = composite {
// The connector (two metallic r=.125 blobbies spaced d=.125, and a disk
object {
intersection {
blob {
threshold 0.4
component 1.0 0.18 <-1.67 0 0>
component 1.0 0.18 <-1.47 0 0>
sturm
}
plane { <1.0 0.0 0.0> -1.73 inverse }
}
texture { Silver_Metal }
}
object {
intersection { Disk_X
scale <.03 .156 .156>
translate <-1.42 0 0>
}
texture { Silver_Metal }
}
// The insulator body
object {
// clip off 1/4 of the first rib
intersection
{
union { TwoRibSection }
plane { <1.0 0.0 0.0> -0.35 inverse }
}
bounded_by { box {<-0.5 -1 -1><0.5 1 1>} }
texture { Glossy color White }
scale <.188 .23 .23> // scale rib section to .188 len, .23 radius
// note: rib inside radius is 0.869, scales
// to 0.220, the same as the next cyl.
translate <-1.314 0 0>
}
object {
intersection { Disk_Y }
texture {
Glossy
image_map { 2 gif "rn9yc.gif" once interpolate 2 }
translate < 0 -.5 0 > // center image map on zero in Y
scale < 1 2 1 > // scale it to cover length == 2
}
rotate < 0 0 90 > // make it a cylinder in X
scale <.125 .22 .22> // scale disk to .250 len, .22 radius
translate <-1.095 0 0>
}
object {
intersection { // clip off 1/4 of the first rib
union { FourRibSection } // each rib is .25 unit long
plane { <1.0 0.0 0.0> -0.45 inverse }
}
bounded_by { box {<-0.5 -1.0 -1.0><0.5 1.0 1.0>} }
texture { Glossy color White }
scale <.375 .25 .25> // 2"dia x 1"len -> .5"dia x .375 len
translate <-0.83 0 0>
}
object {
intersection { Disk_X
scale <.10 .25 .25> // 2"dia x 2"len -> .5"dia x .2"len
translate <-.56 0 0>
}
texture { Glossy
color White
}
}
// The rounded junction between the insulator body and the hex nut
// ( one end of a small sphere )
object {
intersection {
sphere { < -0.125 0.0 0.0> .4375 }
plane { <1.0 0.0 0.0> -0.250 }
}
texture { Silver_Metal }
}
// The hex nut
// ( hex nut - a disk, cut by six planes
object {
intersection {
quadric { Cylinder_X }
// the ends
plane { <1.0 0.0 0.0> -1 inverse }
plane { <1.0 0.0 0.0> 1 }
// the sides
plane { <0.0 1.0 0.0> -0.90 inverse }
plane { <0.0 1.0 0.0> 0.90 }
plane { <0.0 -0.500 0.867> -0.90 inverse }
plane { <0.0 -0.500 0.867> 0.90 }
plane { <0.0 0.500 0.867> -0.90 inverse }
plane { <0.0 0.500 0.867> 0.90 }
scale <.11 .48 .48>
translate <-0.25 0 0>
}
texture { Silver_Metal }
}
// A metallic cylinder
object {
intersection { Disk_Y }
texture {
Silver_Metal
bump_map { 2 gif "madein.gif" bump_size -100 once interpolate 2.0 }
translate < 0 -.75 0 > // center bitmap on cylinder
scale < 1 1.25 1 > // make it cover length ==
}
rotate < 0 0 90 > // make it a cylinder in X
scale <.38 .41 .41>
translate <0 0 0>
}
// A metallic cylinder
//object { intersection { Disk_X
// scale <.38 .41 .41>
// translate <0 0 0>
// }
// texture { Silver_Metal }
//}
// The threaded cylinder
object {
difference {
union {
union { FourThreadSection
scale <.1145 .27 .27> // 2 long, 2 dia => .229 long, .54 dia
translate <.442 0 0>
}
union { FourThreadSection
scale <.1145 .27 .27> // 2 long, 2 dia => .229 long, .54 dia
translate <.671 0 0>
}
union { FourThreadSection
scale <.1145 .27 .27> // 2 long, 2 dia => .229 long, .54 dia
translate <.900 0 0>
}
intersection { Disk_X
scale <.05 .22 .22>
translate <1.03 0 0>
}
}
quadric { Cylinder_X
scale <1.0 .16 .16>
translate <0 0 0>
}
} // end difference
texture { Silver_Metal }
bounded_by {
intersection { Disk_X scale <0.5 0.28 0.28> translate <0.8125 0 0> }
}
}
// The copper washer
object {
difference {
intersection { Disk_X
scale <.03 .41 .41>
translate <.44 0 0>
}
quadric { Cylinder_X
scale <1.0 .30 .30>
translate <0 0 0>
}
}
texture { Copper_Texture }
}
// The center terminal insulator
object {
intersection {
quadric { QCone_X }
// clips cone at r=0.09 and r=0.13
box { <-.13 -0.15 -0.15> <-.09 0.15 0.15> }
scale <25 1 1> // stretch the .04 cone segment to 1
translate <3.4 0 0 > // translate from tip at x=-2.25 to x=1.19
}
texture { Dull
color White
}
}
// The center terminal
object {
intersection { Disk_X
scale < .13 .05 .05 >
translate < 1.1 0 0 >
}
texture { Silver_Metal }
}
// The ground terminal
object {
union {
box {<0.13 0 -0.06> <0.18 0.08 0.06>}
box {<-.08 -0.18 -0.06> <0 -0.13 0.06>}
intersection {
difference {
intersection { Disk_Z scale< .18 .18 .06>}
quadric { Cylinder_Z scale< .13 .13 1>}
}
box { <0 -0.5 -.1> < 1 0 .1> }
} // end intersection
} // end union
translate < 1.15 -0.03 0>
texture { Silver_Metal }
}
// A spark. The center terminal ends at x=1.23, ground terminal begins
// at x=1.28. The spark touches both.
//object { light_source { <1.25 0 0> color red 0.9 green 0.9 blue 1.0 }}
//object {
// sphere { <1.25 0 0> 0.06 }
// texture { Dull color White alpha 0.8 }
//}
} // end composite Spark_Plug