/* A Zinc Selenide Pechan prism of unity semi-aperture */

#declare UnitBox = box { -1,1 }
#declare Protex1 = texture { pigment { rgb<0.5,0.5,0.2> }
finish { ambient 0.3 diffuse 0.7 roughness 0.1 phong .6 phong_size 80 }
}

#declare Sx1 = 1.7071; #declare Sz1 = 1.7071;
#declare Tx1 = -1.7071; #declare Tz1 = 0.7071;
#declare Dx2 = 0.3826; #declare Dz2 = 0.9239;

#declare Pekan11 = intersection { object { UnitBox scale < Sx1,1,Sz1 > translate <Tx1,0,Tz1 > }
plane { <0,0,-1>, 0 rotate <0,45,0> translate <-0.5,0,-0.5> }
plane { <1,0,0>, -2.4142 inverse }
plane { <0,0,1 >,2.8282 rotate < 0,-45,0 > texture { Protex1 } }
clipped_by { plane { <0,0,1>,0 rotate <0,22.5,0> translate <Dx2,0,Dz2> } }
material { SeLens92 }
}

#declare Pekan12 =intersection { union { object { UnitBox texture { Mirror } }
object { UnitBox translate 2*z texture { Protex1 } }
scale <6,1,0.001>
rotate <0,22.5,0>
translate <Dx2,0,Dz2>
}
plane { <1,0,0>, 0 material { SeLens92 } }
plane { <1,0,0>,-2 material { SeLens92 } inverse }
}

#declare Pekan1 = union { object { Pekan11 }
object { Pekan12 }
}

#declare Sx2 = 1.7071; #declare Sz2 = 2.4142;
#declare Tx2 = -1.7071; #declare Tz2 = 0.0;
#declare Dx2 = 0.3826; #declare Dz2 = 0.9239;

#declare Pekan21 = intersection { object { UnitBox scale <Sx2,1,Sz2> translate <Tx2,0,Tz2> }
plane { <0,0,1>,0 rotate <0,45,0> translate <-0.5,0,-0.5> }
plane { <1,0,0>,-2.4142 inverse }
plane { <0,0,1>, 2.828 rotate <0,-135,0> texture { Protex1 } }
clipped_by { plane { <0,0,-1>,0 rotate <0,-22.5,0> translate <Dx2,0,-Dz2> } }
material { SeLens92 }
}


#declare Pekan22 = intersection { union { object { UnitBox texture { Mirror } }
object { UnitBox translate < 0, 0, -2 > texture { Protex1 } }
scale <6,1,0.001>
rotate <0,-22.5,0>
translate < Dx2,0,-Dz2>
}
plane { <1,0,0>,-2 material { SeLens92 } inverse }
plane { <1,0,0>, 0 material { SeLens92 } }
}

#declare Pekan2 = union { object { Pekan21 }
object { Pekan22 }
}

#declare Pekan = union { object { Pekan1 translate -z*0.1}
object { Pekan2 translate z*0.1 }
}