POV-Ray : Newsgroups : povray.text.scene-files : Mika Diamond : Mika Diamond Server Time
28 Jun 2024 23:16:13 EDT (-0400)
  Mika Diamond  
From: Marc Champagne
Date: 24 Mar 2003 19:41:42
Message: <Xns9348C7FA18EC5POVMIKA@204.213.191.226>
I have double spaced each line, if any of the lines have wrapped around, 
unwrap them before running.


//**********************************************************

//

//  FILE : diamond.pov

//  SCENE: A diamond in it's best display of colors

//  DATE : Sept 2002  

//  EMAIL: marcch.AT.videotron.DOT.ca

//  Copyright 2002, Marc Champagne, Please ask!

//

//**********************************************************

 

#include "colors.inc"



/*******************/

/* SCENE QUALITIES */

/*******************/



#declare   PhotonCount = 9000;

#declare       Photons = yes;

#declare   Dispersions = yes;

#declare   Reflections = yes;

#declare          Iors = yes;

#declare     AreaLight = no;

#declare     FullScene = yes;



#declare  FilterAmount = .98;

#declare DiamondColor  = .98;



#declare    Dispersion = 1.02;

#declare           Ior = 2.417;





/*******************/

/* DEBUGGING STUFF */

/*******************/



#declare     DebugAxis = no;

#declare   DebugColors = no;

#declare  CrossSection = no;

#declare     DebugCuts = no;





/****************/

/* DIAMOND MATH */

/****************/



#declare                      Diameter = 1;

#declare                        Radius = Diameter    / 2;

#declare                   CrownHeight = Diameter    * ( 16.2 / 100 );

#declare                   GirdleDepth = Diameter    * ( 01.0 / 100 );

#declare                 PavillonDepth = Diameter    * ( 43.1 / 100 );

#declare                  OverallDepth = CrownHeight + GirdleDepth + 
PavillonDepth;

#declare                    TableWidth = Diameter    * ( 53.0 / 100 );

#declare                   TableRadius = TableWidth  / 2;

#declare          CrownBazelFacetAngle = 34.50;

#declare           CrownStarFacetAngle = 20.00;  // Ideal = 15.00, unable 
to find exact specs for placing these facets

#declare    CrownUpperGirdleFacetAngle = 39.22;  // Ideal = 42.00, unable 
to find exact specs for placing these facets

#declare                   GirdleAngle = 90.00;

#declare PavillonLowerGirdleFacetAngle = 42.75;

#declare            PavillonFacetAngle = 40.75;





/*******************/

/* GLOBAL SETTINGS */

/*******************/



global_settings {

  

  #if ( Photons )

    photons { count PhotonCount

              //save_file "diamond.ph"

              //load_file "diamond.ph"

            }

  #end

  

  max_trace_level 60

}

  

  



/*******************/

/* DEBUG STUFF     */

/*******************/



#declare Size = .002;

#if ( DebugAxis )

  object { cylinder { < -300,    0,    0 >, < 300,    0,   0 >, Size } 
pigment { color <1,0,0> } no_shadow }

  object { cylinder { <    0, -300,    0 >, <   0,  300,   0 >, Size } 
pigment { color <0,1,0> } no_shadow }

  object { cylinder { <    0,    0, -300 >, <   0,    0, 300 >, Size } 
pigment { color <0,0,1> } no_shadow }

  

  object { cylinder { < -300, OverallDepth,    0 >, < 300, OverallDepth,   
0 >, Size } pigment { color <1,0,0> } no_shadow }

  object { cylinder { < -300, PavillonDepth,   0 >, < 300, PavillonDepth,  
0 >, Size } pigment { color <1,0,0> } no_shadow }

  object { cylinder { < -300, PavillonDepth+GirdleDepth,    0 >, < 300, 
PavillonDepth+GirdleDepth,   0 >, Size } pigment { color <1,0,0> } 
no_shadow }  

                                                                    

  object { cylinder { <   .5, -300,    0 >, <  .5,  300,   0 >, Size } 
pigment { color <0,1,0> } no_shadow }

  object { cylinder { <  -.5, -300,    0 >, < -.5,  300,   0 >, Size } 
pigment { color <0,1,0> } no_shadow }

  

  object { cylinder { <  -.265, -300,    0 >, < -.265,  300,   0 >, Size } 
pigment { color <0,1,0> } no_shadow }

  object { cylinder { <   .265, -300,    0 >, <  .265,  300,   0 >, Size } 
pigment { color <0,1,0> } no_shadow }

#end





/************************/

/* DIAMOND CONSTRUCTION */

/************************/



#if ( DebugCuts )

  #declare Cut   = union        { sphere { 0, .02 } sphere { -y*.02, .01 } 
pigment { rgb <1,0,0> } no_shadow }  

  #declare Stone = union        {

#else

  #declare Cut   = object       { plane  { y, 0.00 } }

  #declare Stone = intersection {

#end





/*******************/

/* TABLE           */

/*******************/



  object {  Cut                               

    translate y * OverallDepth                #if ( DebugColors ) pigment { 
rgb <0,1,1> } #end

  }





/***********************/

/* CROWN - STAR FACET  */

/***********************/



  #declare Faces = 8;  

  #declare  Turn = 0;

  #while ( Turn < Faces )

    object { Cut

      rotate    -z * CrownStarFacetAngle

      translate  x * TableRadius

      translate  y * ( OverallDepth - .0075 )     // Unable to find exact 
data for these facets

      rotate     y * 360 / Faces / 2

      rotate     y * 360 / Faces * Turn       #if ( DebugColors ) pigment { 
rgb <0,1,0> } #end

    }

    #declare Turn=Turn+1;

  #end

  

  

/************************/

/* CROWN - BAZEL FACET  */

/************************/



  #declare Faces = 8;  

  #declare  Turn = 0;

  #while ( Turn < Faces )

    object { Cut

      rotate    -z * CrownBazelFacetAngle

      translate  x * Radius

      translate  y * ( PavillonDepth + GirdleDepth )

      rotate     y * 360 / Faces * Turn       #if ( DebugColors ) pigment { 
rgb <1,0,0> } #end

    }

    #declare Turn=Turn+1;

  #end





/******************************/

/* CROWN - UPPER GIRDLE FACET */

/******************************/



  #declare Faces = 16;  

  #declare  Turn = 0 ;

  #while ( Turn < Faces )

    object { Cut

      rotate    -z * CrownUpperGirdleFacetAngle

      translate  x * ( Radius -.01 )

      translate  y * ( PavillonDepth + GirdleDepth )

      rotate     y * 360 / Faces / 2

      rotate     y * 360 / Faces * Turn       #if ( DebugColors ) pigment { 
rgb <1,0,1> } #end

    }

    #declare Turn=Turn+1;

  #end





/*******************/

/* GIRDLE          */

/*******************/



  #declare Faces=32;  

  #declare Turn=0;

  #while (Turn<Faces)

    object { Cut

      rotate    -z * GirdleAngle      

      translate  x * ( Radius - .01 )

      rotate     y * 360 / Faces * Turn       #if ( DebugColors ) pigment { 
rgb <1,1,0> } #end

      translate  y * PavillonDepth    // not needed, only used for visual 
when Debug is ON

    }

    #declare Turn=Turn+1;

  #end





/*********************************/

/* PAVILLON - LOWER GIRDLE FACET */

/*********************************/



  #declare Faces = 16;  

  #declare  Turn = 0;

  #while ( Turn < Faces )

    object { Cut

      rotate    -z * ( ( 90 - PavillonLowerGirdleFacetAngle ) + 90 )

      rotate     y * 360 / Faces * Turn

      rotate     y * 360 / Faces / 2          #if ( DebugColors ) pigment { 
rgb <0,1,.5> } #end

      translate -y * .0225

    }

    #declare Turn=Turn+1;

  #end



/*********************/

/* PAVILLON - FACET  */

/*********************/



  #declare Faces = 8;  

  #declare  Turn = 0;

  #while ( Turn < Faces )

    object { Cut

      rotate     z * ( ( 90 - PavillonFacetAngle ) + 90 )

      rotate     y * 360 / Faces * Turn       #if ( DebugColors ) pigment { 
rgb <1,1,1> } #end

    }

    #declare Turn=Turn+1;

  #end



/*******************/

/* CULET           */

/*******************/



  object { Cut

    rotate     z * 180

    translate  y * .02

  }





/*******************/

/* DEBUG           */

/*******************/



  #if ( CrossSection ) object { Cut rotate -x*90 pigment { rgb <1,1,1> } } 
#end

  

} 





/************************/

/* DIAMOND'S PROPERTIES */

/************************/



#declare Diamond = object {



  Stone



  pigment  { rgb        DiamondColor

             filter     FilterAmount

           }

  finish   { ambient    0.1

             diffuse    0.4

             specular   0.8

             roughness  0.003

             phong      1

             phong_size 300

             #if ( Reflections ) reflection { 0.2, 0.1  fresnel  metallic }  
#end

           }

  interior { #if ( Iors )                  ior        Ior                             
  
#end

             #if ( Photons & Dispersions ) dispersion Dispersion  
dispersion_samples 10  #end

                }

                 

  #if ( Photons ) photons { target 1 refraction on reflection on } #end

        

  bounded_by {

    box { < -Radius-.1,    OverallDepth+.1, -Radius-.1 >,

          <  Radius+.1,                -.1,  Radius+.1 >

        }

  }

  

}





/***********************/

/* THE COMPLETED SCENE */

/***********************/



camera {

  location   < 0, 2, -4 > 

  look_at    < 0, 0, 0 >

  direction  z

}



#if ( FullScene )

  

  light_source { < -5, 30, -10 >, rgb 1      

                 #if ( AreaLight ) area_light x*4, y*4, 2, 2  adaptive 1  
jitter #end

                 parallel

                 point_at <0,0,0>

               }



  box          { <-15,-1,-15>, <15,0,15>

                 pigment { rgb <.3,.4,.5> }

                 finish  { ambient .3 diffuse .4 }

                 #if ( Photons ) photons { target 1 refraction off 
reflection off } #end

               }

               

#else



  light_source { < 25, 50, -100 >, White } 

  

#end



object { Diamond  rotate     z * PavillonFacetAngle   // Make it lean on 
its side (crown facing -x)

                  translate -x * 1

       }

object { Diamond  rotate    -x * PavillonFacetAngle   // Make it lean on 
its side (crown facing -z)

       }       

object { Diamond  rotate     x * PavillonFacetAngle   // Make it lean on 
its side (crown facing +z)

                  translate  x * 1.2

       }       

//**********************************************************


-- 
(MIKA) Marc Champagne
marcch.AT.videotron.DOT.ca
Montreal, CANADA


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.