File:Comparison oloid sphericon 3D.svg

Summary

Description
English: Comparison of an oloid (left) and sphericon (right) rendered in POV-Ray by CMG Lee. Move your mouse pointer over the SVG image to rotate the shapes. The POV-Ray and Python code are embedded in the SVG file.
Source Own work
Author Cmglee

POV-Ray source code

comparison_oloid_sphericon_3D.povcomparison_oloid_sphericon_3D.ini
#declare CLOCK = clock;
//#declare CLOCK            = 1;
#declare BEARING          = int(CLOCK / 8) * 45;
#declare ELEVATION        = mod(CLOCK,  8) * 45;
#declare RADIUS           = 2;
#declare N_VERTEX         = 16;

plane { <0,1,0> 0 pigment { rgb<1,1,1> } translate<0,-4,0> }
/*
plane { <0,1,0> 0 pigment { checker <0.8,0.8,0.8> rgb<1,1,1> }
translate<0,-2,0> }
union { /// axes
 cone { <-1,0,0> 0.5 <1,0,0> 0.1 pigment { rgb <1,0,0> } }
 cone { <0,-1,0> 0.5 <0,1,0> 0.1 pigment { rgb <0,1,0> } }
 cone { <0,0,-1> 0.5 <0,0,1> 0.1 pigment { rgb <0,0,1> } }
 scale 2
}
*/
#declare HALF_SEPARATIONS = array[2]{0  , RADIUS / sqrt(2)};
#declare CENTROID_X       = array[2]{4, -2};

#local I = 0;
#while (I < 2)

 #local HALF_SEPARATION = HALF_SEPARATIONS[I];
 #if (HALF_SEPARATION = 0)
  #local ANGLE_MAX = pi / 2;
  #local PEAK_X    = 0;
 #else
  #local ANGLE_MAX = acos(-RADIUS / (RADIUS + 2 * HALF_SEPARATION));
  #local PEAK_X    = RADIUS * RADIUS / (RADIUS + 2 * HALF_SEPARATION)
- HALF_SEPARATION;
 #end

 #local EIGHTH =
 union {
  #local T = 0;
  #while (T < N_VERTEX)
   #local T = T + 1;
   #local ANGLE_T   =  T      / N_VERTEX * ANGLE_MAX;
   #local ANGLE_T_1 = (T - 1) / N_VERTEX * ANGLE_MAX;
   triangle {
    < HALF_SEPARATION + RADIUS * cos(ANGLE_T  ), 0, RADIUS * sin(ANGLE_T  )>,
    < HALF_SEPARATION + RADIUS * cos(ANGLE_T_1), 0, RADIUS * sin(ANGLE_T_1)>,
    < PEAK_X, RADIUS * sin(ANGLE_MAX), 0>
    #if (mod(T / N_VERTEX * 8, 3) > 1)
     pigment { rgb<0.9,0.7,0.5> }
    #else
     pigment { rgb<0.7,0.6,0.5> }
    #end
   }
  #end
 }

 #local HALF =
 union {
  object { EIGHTH }
  object { EIGHTH scale<1, 1,-1> }
  object { EIGHTH scale<1,-1, 1> }
  object { EIGHTH scale<1,-1,-1> }
 }

 union {
  object { HALF }
  object { HALF scale<-1,1,1> rotate<90,0,0> }
  rotate    <0        ,BEARING,0            >
  rotate    <0,0      ,ELEVATION            >
  translate <0        ,0      ,CENTROID_X[I]>
 }

 #local I = I + 1;
#end

camera {
 right     x * image_width / image_height
 location  <20,0,0>
 look_at   <0,0,0>
 angle     30 * image_width / image_height
}

union {
 light_source {
  <10,10,0> color 0.5
  area_light <0,3,0>, <0,0,1>, 3, 3
  adaptive 1 circular
 }
}
global_settings { ambient_light rgb <9,9,9> }
background { color rgb <0.9,0.9,0.9> }
; POV-Ray animation ini file
;Antialias=Off
Antialias=On
Antialias_Threshold=0.1
Antialias_Depth=2

Input_File_Name="oloid.pov"

Initial_Frame=0
Final_Frame  =63
Initial_Clock=0
Final_Clock  =63

Cyclic_Animation=off
Pause_when_Done=off
Debug_File=on
Category:Oloid surface Category:Sphericon Category:Interactive 3D SVG Category:User:cmglee Category:Images with Povray source code

Licensing

I, the copyright holder of this work, hereby publish it under the following licenses:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Category:CC-BY-SA-3.0#Comparison%20oloid%20sphericon%203D.svg
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
Category:License migration redundant#Comparison%20oloid%20sphericon%203D.svgCategory:GFDL#Comparison%20oloid%20sphericon%203D.svg
You may select the license of your choice.
Category:Self-published work
Category:CC-BY-SA-3.0 Category:GFDL Category:Images with Povray source code Category:Interactive 3D SVG Category:License migration redundant Category:Oloid surface Category:Pages using deprecated source tags Category:Self-published work Category:Sphericon Category:User:cmglee