//------------------------------------------------------------------------------Scenery #version 3.7 global_settings { assumed_gamma 2.2 adc_bailout 0.005 max_trace_level 50 charset utf8 ambient_light 0 /* radiosity { pretrace_start 0.08 pretrace_end 0.01 count 50 error_bound 0.1 recursion_limit 1 normal on brightness 0.1 always_sample yes gray_threshold 0.8 media on } */ } #include "functions.inc" #include "math.inc" #declare simple = false; #declare cuthalf = false; #declare axes = false; // Title: Color solid pigment include v1.2.3 // Author: Michael Horvath, http://isometricland.net // Created: 2008-06-22 // Updated: 2015-12-26 // This file is licensed under the terms of the CC-LGPL. #version 3.7 //------------------------------ // Functions & variables #declare CSolid_Offset = 0.000001; #declare CSolid_Munsell_Function = function(x,y,z) {sqrt(pow(x,2) + pow(z,2)) / cos(asin(abs(y)))} #declare CSolid_DblCone_Function = function {sqrt(pow(x,2) + pow(z,2)) / (1-abs(y))} #declare CSolid_Cone_Function = function {sqrt(pow(x,2) + pow(z,2))/y} //------------------------------ // HSL Cube #declare CSolid_HSLCube_Hue = pigment { gradient x color_map { [0/6 srgb <1,0,0,>] [1/6 srgb <1,1,0,>] [2/6 srgb <0,1,0,>] [3/6 srgb <0,1,1,>] [4/6 srgb <0,0,1,>] [5/6 srgb <1,0,1,>] [6/6 srgb <1,0,0,>] } } #declare CSolid_HSLCube_Saturation = pigment { gradient z pigment_map { [0 color srgb 1/2] [1 CSolid_HSLCube_Hue] } } #declare CSolid_HSLCube_Lightness = pigment { gradient y pigment_map { [0 color srgb 0] [1/2 CSolid_HSLCube_Saturation] [1 color srgb 1] } } #declare CSolid_HSLCube_Pigment = pigment { CSolid_HSLCube_Lightness scale (1 + CSolid_Offset) translate -CSolid_Offset/2 } //------------------------------ // HSL Cylinder #declare CSolid_HSLCylinder_Hue = pigment { function {-f_th(x,y,z)/pi/2} color_map { [0/6 srgb <1,0,0,>] [1/6 srgb <1,1,0,>] [2/6 srgb <0,1,0,>] [3/6 srgb <0,1,1,>] [4/6 srgb <0,0,1,>] [5/6 srgb <1,0,1,>] [6/6 srgb <1,0,0,>] } } #declare CSolid_HSLCylinder_Saturation = pigment { cylindrical pigment_map { [0 CSolid_HSLCylinder_Hue] [1 color srgb 1/2] } scale (1 + CSolid_Offset) } #declare CSolid_HSLCylinder_Lightness = pigment { gradient y pigment_map { [0 color srgb 0] [1/2 CSolid_HSLCylinder_Saturation] [1 color srgb 1] } scale (1 + CSolid_Offset) translate -y * CSolid_Offset/2 } #declare CSolid_HSLCylinder_Pigment = pigment {CSolid_HSLCylinder_Lightness} //------------------------------ // HSL Double-cone #declare CSolid_HSLDblCone_Hue = pigment { function {-f_th(x,y,z)/pi/2} color_map { [0/6 srgb <1,0,0,>] [1/6 srgb <1,1,0,>] [2/6 srgb <0,1,0,>] [3/6 srgb <0,1,1,>] [4/6 srgb <0,0,1,>] [5/6 srgb <1,0,1,>] [6/6 srgb <1,0,0,>] } } #declare CSolid_HSLDblCone_Saturation = pigment { function {CSolid_DblCone_Function(x,y,z)} pigment_map { [0 color srgb 1/2] [1 CSolid_HSLDblCone_Hue] } translate y scale y/2 scale (1 + CSolid_Offset) } #declare CSolid_HSLDblCone_Lightness = pigment { gradient y pigment_map { [0 color srgb 0] [1/2 CSolid_HSLDblCone_Saturation] [1 color srgb 1] } scale y * 2 translate -y scale (1 + CSolid_Offset) translate -y * CSolid_Offset/2 } #declare CSolid_HSLDblCone_Pigment = pigment {CSolid_HSLDblCone_Lightness} //------------------------------ // HSL Parametric sphere #declare CSolid_HSLSphere_Hue = pigment { function {-f_th(x,y,z)/pi/2} color_map { [0/6 srgb <1,0,0,>] [1/6 srgb <1,1,0,>] [2/6 srgb <0,1,0,>] [3/6 srgb <0,1,1,>] [4/6 srgb <0,0,1,>] [5/6 srgb <1,0,1,>] [6/6 srgb <1,0,0,>] } } #declare CSolid_HSLSphere_Saturation = pigment { function {f_r(x,y,z)} pigment_map { [0 color srgb 1/2] [1 CSolid_HSLSphere_Hue] } scale (1 + CSolid_Offset) } #declare CSolid_HSLSphere_Lightness = pigment { function {f_ph(x,y,z)/pi} pigment_map { [0 color srgb 1] [1/2 CSolid_HSLSphere_Saturation] [1 color srgb 0] } } #declare CSolid_HSLSphere_Pigment = pigment {CSolid_HSLSphere_Lightness} //------------------------------ // HSL Parametric sphere with hole #declare CSolid_HSLSphereHole_Hue = pigment { function {-f_th(x,y,z)/pi/2} color_map { [0/6 srgb <1,0,0,>] [1/6 srgb <1,1,0,>] [2/6 srgb <0,1,0,>] [3/6 srgb <0,1,1,>] [4/6 srgb <0,0,1,>] [5/6 srgb <1,0,1,>] [6/6 srgb <1,0,0,>] } } #declare CSolid_HSLSphereHole_Saturation = pigment { function {f_r(x,y,z) * 7/6 - 1/6} pigment_map { [0 color srgb 1/2] [1 CSolid_HSLSphereHole_Hue] } scale (1 + CSolid_Offset) } #declare CSolid_HSLSphereHole_Lightness = pigment { function {f_ph(x,y,z)/pi} pigment_map { [0 color srgb 1] [1/2 CSolid_HSLSphereHole_Saturation] [1 color srgb 0] } } #declare CSolid_HSLSphereHole_Pigment = pigment {CSolid_HSLSphereHole_Lightness} // hole only #declare CSolid_HSLHole_Saturation = pigment { color srgb 1/2 } #declare CSolid_HSLHole_Lightness = pigment { function {f_ph(x,y,z)/pi} pigment_map { [0 color srgb 1] [1/2 CSolid_HSLHole_Saturation] [1 color srgb 0] } } #declare CSolid_HSLHole_Pigment = pigment {CSolid_HSLHole_Lightness} //------------------------------ // HSL Munsell sphere #declare CSolid_HSLMunsell_Hue = pigment { function {-f_th(x,y,z)/pi/2} color_map { [0/6 srgb <1,0,0,>] [1/6 srgb <1,1,0,>] [2/6 srgb <0,1,0,>] [3/6 srgb <0,1,1,>] [4/6 srgb <0,0,1,>] [5/6 srgb <1,0,1,>] [6/6 srgb <1,0,0,>] } } #declare CSolid_HSLMunsell_Saturation = pigment { function {CSolid_Munsell_Function(x,y,z)} pigment_map { [0 color srgb 1/2] [1 CSolid_HSLMunsell_Hue] } translate y scale y/2 scale (1 + CSolid_Offset) } #declare CSolid_HSLMunsell_Lightness = pigment { gradient y pigment_map { [0 color srgb 0] [1/2 CSolid_HSLMunsell_Saturation] [1 color srgb 1] } scale y * 2 translate -y scale (1 + CSolid_Offset) translate -y * CSolid_Offset/2 } #declare CSolid_HSLMunsell_Pigment = pigment {CSolid_HSLMunsell_Lightness} //------------------------------ // HSV Cube #declare CSolid_HSVCube_Hue = pigment { gradient x color_map { [0/6 srgb <1,0,0,>] [1/6 srgb <1,1,0,>] [2/6 srgb <0,1,0,>] [3/6 srgb <0,1,1,>] [4/6 srgb <0,0,1,>] [5/6 srgb <1,0,1,>] [6/6 srgb <1,0,0,>] } } #declare CSolid_HSVCube_WhiteToHue = pigment { gradient z pigment_map { [0 color srgb 1] [1 CSolid_HSVCube_Hue] } } #declare CSolid_HSVCube_Value = pigment { gradient y pigment_map { [0 color srgb 0] [1 CSolid_HSVCube_WhiteToHue] } } #declare CSolid_HSVCube_Pigment = pigment { CSolid_HSVCube_Value scale (1 + CSolid_Offset) translate -CSolid_Offset/2 } //------------------------------ // HSV Cone #declare CSolid_HSVCone_Hue = pigment { function {-f_th(x,y,z)/pi/2} color_map { [0/6 srgb <1,0,0,>] [1/6 srgb <1,1,0,>] [2/6 srgb <0,1,0,>] [3/6 srgb <0,1,1,>] [4/6 srgb <0,0,1,>] [5/6 srgb <1,0,1,>] [6/6 srgb <1,0,0,>] } } #declare CSolid_HSVCone_WhiteToHue = pigment { function {CSolid_Cone_Function(x,y,z)} pigment_map { [0 color srgb 1] [1 CSolid_HSVCone_Hue] } scale (1 + CSolid_Offset) } #declare CSolid_HSVCone_Value = pigment { gradient y pigment_map { [0 color srgb 0] [1 CSolid_HSVCone_WhiteToHue] } scale (1 + CSolid_Offset) translate -y * CSolid_Offset/2 } #declare CSolid_HSVCone_Pigment = pigment {CSolid_HSVCone_Value} //------------------------------ // HSV Cylinder #declare CSolid_HSVCylinder_Hue = pigment { function {-f_th(x,y,z)/pi/2} color_map { [0/6 srgb <1,0,0,>] [1/6 srgb <1,1,0,>] [2/6 srgb <0,1,0,>] [3/6 srgb <0,1,1,>] [4/6 srgb <0,0,1,>] [5/6 srgb <1,0,1,>] [6/6 srgb <1,0,0,>] } } #declare CSolid_HSVCylinder_WhiteToHue = pigment { cylindrical pigment_map { [0 CSolid_HSVCylinder_Hue] [1 color srgb 1] } scale (1 + CSolid_Offset) } #declare CSolid_HSVCylinder_Value = pigment { gradient y pigment_map { [0 color srgb 0] [1 CSolid_HSVCylinder_WhiteToHue] } scale (1 + CSolid_Offset) translate -y * CSolid_Offset/2 } #declare CSolid_HSVCylinder_Pigment = pigment {CSolid_HSVCylinder_Value} //------------------------------ // HSV Parametric sphere #declare CSolid_HSVSphere_Hue = pigment { function {-f_th(x,y,z)/pi/2} color_map { [0/6 srgb <1,0,0,>] [1/6 srgb <1,1,0,>] [2/6 srgb <0,1,0,>] [3/6 srgb <0,1,1,>] [4/6 srgb <0,0,1,>] [5/6 srgb <1,0,1,>] [6/6 srgb <1,0,0,>] } } #declare CSolid_HSVSphere_WhiteToHue = pigment { function {f_r(x,y,z)} pigment_map { [0 color srgb 1] [1 CSolid_HSVSphere_Hue] } scale (1 + CSolid_Offset) } #declare CSolid_HSVSphere_Value = pigment { function {f_ph(x,y,z)/pi} pigment_map { [0 CSolid_HSVSphere_WhiteToHue] [1 color srgb 0] } } #declare CSolid_HSVSphere_Pigment = pigment {CSolid_HSVSphere_Value} //------------------------------ // HSV Munsell sphere #declare CSolid_HSVMunsell_Hue = pigment { function {-f_th(x,y,z)/pi/2} color_map { [0/6 srgb <1, 0, 0,>] [1/6 srgb <1, 1, 0,>] [2/6 srgb <0, 1, 0,>] [3/6 srgb <0, 1, 1,>] [4/6 srgb <0, 0, 1,>] [5/6 srgb <1, 0, 1,>] [6/6 srgb <1, 0, 0,>] } } #declare CSolid_HSVMunsell_WhiteToHue = pigment { function {CSolid_Munsell_Function(x,y,z)} pigment_map { [0 color srgb 1] [1 CSolid_HSVMunsell_Hue] } translate y scale y/2 scale (1 + CSolid_Offset) } #declare CSolid_HSVMunsell_Value = pigment { gradient y pigment_map { [0 color srgb 0] [1 CSolid_HSVMunsell_WhiteToHue] } scale y * 2 translate -y scale (1 + CSolid_Offset) translate -y * CSolid_Offset/2 } #declare CSolid_HSVMunsell_Pigment = pigment {CSolid_HSVMunsell_Value} //------------------------------ // RGB Cube #declare CSolid_RGBCube_Red = pigment { gradient x color_map { [0 srgb <0, 0, 0,>] [1 srgb <3, 0, 0,>] } } #declare CSolid_RGBCube_Green = pigment { gradient y color_map { [0 srgb <0, 0, 0,>] [1 srgb <0, 3, 0,>] } } #declare CSolid_RGBCube_Blue = pigment { gradient z color_map { [0 srgb <0, 0, 0,>] [1 srgb <0, 0, 3,>] } } #declare CSolid_RGBCube_Pigment = pigment { average pigment_map { [CSolid_RGBCube_Red] [CSolid_RGBCube_Green] [CSolid_RGBCube_Blue] } scale (1 + CSolid_Offset) translate -CSolid_Offset/2 } //------------------------------ // RGB Cylinder #declare CSolid_RGBCylinder_Red = pigment { function {-f_th(x,y,z)/pi/2} color_map { [0 srgb <0, 0, 0,>] [1 srgb <3, 0, 0,>] } } #declare CSolid_RGBCylinder_Green = pigment { cylindrical color_map { [0 srgb <0, 3, 0,>] [1 srgb <0, 0, 0,>] } } #declare CSolid_RGBCylinder_Blue = pigment { gradient y color_map { [0 srgb <0, 0, 0,>] [1 srgb <0, 0, 3,>] } scale (1 + CSolid_Offset) translate -y * CSolid_Offset/2 } #declare CSolid_RGBCylinder_Pigment = pigment { average pigment_map { [CSolid_RGBCylinder_Red] [CSolid_RGBCylinder_Green] [CSolid_RGBCylinder_Blue] } } //------------------------------ // RGB Parametric sphere #declare CSolid_RGBSphere_Red = pigment { function {-f_th(x,y,z)/pi/2} color_map { [0 srgb <0, 0, 0,>] [1 srgb <3, 0, 0,>] } } #declare CSolid_RGBSphere_Green = pigment { function {f_r(x,y,z)} color_map { [0 srgb <0, 0, 0,>] [1 srgb <0, 3, 0,>] } scale (1 + CSolid_Offset) } #declare CSolid_RGBSphere_Blue = pigment { function {f_ph(x,y,z)/pi} color_map { [0 srgb <0, 0, 3,>] [1 srgb <0, 0, 0,>] } } #declare CSolid_RGBSphere_Pigment = pigment { average pigment_map { [CSolid_RGBSphere_Red] [CSolid_RGBSphere_Green] [CSolid_RGBSphere_Blue] } scale (1 + CSolid_Offset) translate -CSolid_Offset/2 } //------------------------------ // RGB Munsell sphere // This one doesn't work for some reason. #declare CSolid_RGBMunsell_Red = pigment { function {-f_th(x,y,z)/pi/2} color_map { [0 color srgb 0] [1 color srgb x] } } #declare CSolid_RGBMunsell_Green = pigment { function {CSolid_Munsell_Function(x,y,z)} pigment_map { [0 color srgb 0] [1 color srgb y] } translate y scale y/2 scale (1 + CSolid_Offset) } #declare CSolid_RGBMunsell_Blue = pigment { gradient y color_map { [1 srgb 0] [0 srgb z] } scale y * 2 translate -y scale y * (1 + CSolid_Offset) translate -y * CSolid_Offset/2 } #declare CSolid_RGBMunsell_Pigment = pigment { average pigment_map { [CSolid_RGBMunsell_Red] [CSolid_RGBMunsell_Green] [CSolid_RGBMunsell_Blue] } } // Title: Shape grid macro v1.11 // Author: Michael Horvath // Homepage: http://www.geocities.com/Area51/Quadrant/3864/povray.htm // Created: 2008/06/22 // Last Updated: 2008/07/07 // This file is licensed under the terms of the CC-LGPL. #include "math.inc" #include "shapes.inc" #ifndef (SGrid_Debug) #declare SGrid_Debug = false; #end #macro SGrid_Cone_Macro ( SGrid_Cone_radii, // The number of radial divisions. (integer) SGrid_Cone_longt, // The number of longitudinal divisions. (integer) SGrid_Cone_latit, // The number of lattitudinal divisions. (integer) SGrid_Cone_radius, // The radius of each cone. (float) SGrid_Cone_height, // The height of each cone. (float) SGrid_Cone_center, // The center coordinates of the double-cone. (vector) SGrid_Cone_thickness, // The thickness of the grid lines. (float) SGrid_Cone_offset, // Determines whether the divisions are offset by half the amount. Sometimes necessary when doing cut-aways. (boolian) SGrid_Cone_endcap, // Determines whether borders are created at each end of the object. Ignored if the offset is turned on. (boolian) ) #local SGrid_Cone_bounds = cone {0, SGrid_Cone_radius, <0,SGrid_Cone_height,0,>, 0} union { #local SGrid_Cone_increment = 1/SGrid_Cone_radii; #local SGrid_Cone_i = 0; #local SGrid_Cone_start = 0; #if (SGrid_Cone_offset = on) #local SGrid_Cone_start = SGrid_Cone_increment/2; #end #while (SGrid_Cone_i < SGrid_Cone_radii) #local SGrid_Cone_value = SGrid_Cone_radius * (SGrid_Cone_start + SGrid_Cone_i * SGrid_Cone_increment); #local SGrid_Cone_angle = atan2d(SGrid_Cone_value, SGrid_Cone_height); #local SGrid_Cone_offsl = SGrid_Cone_thickness/2 * 1/cosd(SGrid_Cone_angle); #local SGrid_Cone_offsv = SGrid_Cone_thickness/2 * 1/cosd(90 - SGrid_Cone_angle); difference { cone {0, SGrid_Cone_value + SGrid_Cone_offsl, <0,SGrid_Cone_height+SGrid_Cone_offsv,0,>, 0} cone {0, SGrid_Cone_value - SGrid_Cone_offsl, <0,SGrid_Cone_height-SGrid_Cone_offsv,0,>, 0} bounded_by {SGrid_Cone_bounds} } #if (SGrid_Debug = true) #debug concat("cone_radii_value = ", str(SGrid_Cone_value, 0, -1),"\n") #end #local SGrid_Cone_i = SGrid_Cone_i + 1; #end #local SGrid_Cone_increment = 1/SGrid_Cone_longt; #local SGrid_Cone_i = 0; #local SGrid_Cone_start = 0; #if (SGrid_Cone_offset = on) #local SGrid_Cone_start = SGrid_Cone_increment/2; #end #while (SGrid_Cone_i < SGrid_Cone_longt) #local SGrid_Cone_value = 360 * (SGrid_Cone_start + SGrid_Cone_i * SGrid_Cone_increment); box { <2*SGrid_Cone_radius, 2*SGrid_Cone_radius, SGrid_Cone_thickness/2,>, <0, -2*SGrid_Cone_radius, -SGrid_Cone_thickness/2,> rotate y * SGrid_Cone_value bounded_by {SGrid_Cone_bounds} } #if (SGrid_Debug = true) #debug concat("cone_longt_value = ", str(SGrid_Cone_value, 0, -1),"\n") #end #local SGrid_Cone_i = SGrid_Cone_i + 1; #end #local SGrid_Cone_increment = 1/SGrid_Cone_latit; #local SGrid_Cone_i = 0; #if (SGrid_Cone_endcap = on) #local SGrid_Cone_start = 0; #local SGrid_Cone_finish = SGrid_Cone_radii + 1; #else #local SGrid_Cone_start = SGrid_Cone_increment; #local SGrid_Cone_finish = SGrid_Cone_latit - 1; #end #if (SGrid_Cone_offset = on) #local SGrid_Cone_start = SGrid_Cone_increment/2; #local SGrid_Cone_finish = SGrid_Cone_latit; #end #while (SGrid_Cone_i < SGrid_Cone_finish) #local SGrid_Cone_value = SGrid_Cone_height * (SGrid_Cone_start + SGrid_Cone_i * SGrid_Cone_increment); box { , <-SGrid_Cone_radius,-SGrid_Cone_thickness/2,-SGrid_Cone_radius,> bounded_by {SGrid_Cone_bounds} translate y * SGrid_Cone_value } #if (SGrid_Debug = true) #debug concat("cone_latit_value = ", str(SGrid_Cone_value, 0, -1),"\n") #end #local SGrid_Cone_i = SGrid_Cone_i + 1; #end translate SGrid_Cone_center } #end #macro SGrid_Cylinder_Macro ( SGrid_Cylinder_radii, // The number of radial divisions. (integer) SGrid_Cylinder_longt, // The number of longitudinal divisions. (integer) SGrid_Cylinder_latit, // The number of lattitudinal divisions. (integer) SGrid_Cylinder_radius, // The radius of the cylinder. (float) SGrid_Cylinder_height, // The height of the cylinder. (float) SGrid_Cylinder_center, // The center coordinates of the cylinder. (vector) SGrid_Cylinder_thickness, // The thickness of the grid lines. (float) SGrid_Cylinder_offset, // Determines whether the divisions are offset by half the amount. Sometimes necessary when doing cut-aways. (boolian) SGrid_Cylinder_endcap, // Determines whether borders are created at each end of the object. Ignored if the offset is turned on. (boolian) ) #local SGrid_Cylinder_bounds = cylinder {0, <0,SGrid_Cylinder_height,0,>, SGrid_Cylinder_radius} union { #local SGrid_Cylinder_increment = 1/SGrid_Cylinder_radii; #local SGrid_Cylinder_i = 0; #local SGrid_Cylinder_start = 0; #if (SGrid_Cylinder_offset = on) #local SGrid_Cylinder_start = SGrid_Cylinder_increment/2; #end #while (SGrid_Cylinder_i < SGrid_Cylinder_radii) #local SGrid_Cylinder_value = SGrid_Cylinder_radius * (SGrid_Cylinder_start + SGrid_Cylinder_i * SGrid_Cylinder_increment); difference { cylinder {0, y, SGrid_Cylinder_value + SGrid_Cylinder_thickness/2} cylinder {0, y, SGrid_Cylinder_value - SGrid_Cylinder_thickness/2} bounded_by {SGrid_Cylinder_bounds} } #if (SGrid_Debug = true) #debug concat("cylinder_radii_value = ", str(SGrid_Cylinder_value, 0, -1),"\n") #end #local SGrid_Cylinder_i = SGrid_Cylinder_i + 1; #end #local SGrid_Cylinder_increment = 1/SGrid_Cylinder_longt; #local SGrid_Cylinder_i = 0; #local SGrid_Cylinder_start = 0; #if (SGrid_Cylinder_offset = on) #local SGrid_Cylinder_start = SGrid_Cylinder_increment/2; #end #while (SGrid_Cylinder_i < SGrid_Cylinder_longt) #local SGrid_Cylinder_value = 360 * (SGrid_Cylinder_start + SGrid_Cylinder_i * SGrid_Cylinder_increment); box { <2*SGrid_Cylinder_radius, 2*SGrid_Cylinder_radius, SGrid_Cylinder_thickness/2,>, <0, -2*SGrid_Cylinder_radius, -SGrid_Cylinder_thickness/2,> rotate y * SGrid_Cylinder_value } #if (SGrid_Debug = true) #debug concat("cylinder_logt_value = ", str(SGrid_Cylinder_value, 0, -1),"\n") #end #local SGrid_Cylinder_i = SGrid_Cylinder_i + 1; #end #local SGrid_Cylinder_increment = 1/SGrid_Cylinder_latit; #local SGrid_Cylinder_i = 0; #if (SGrid_Cylinder_endcap = on) #local SGrid_Cylinder_start = 0; #local SGrid_Cylinder_finish = SGrid_Cylinder_latit + 1; #else #local SGrid_Cylinder_start = SGrid_Cylinder_increment; #local SGrid_Cylinder_finish = SGrid_Cylinder_latit - 1; #end #if (SGrid_Cylinder_offset = on) #local SGrid_Cylinder_start = SGrid_Cylinder_increment/2; #local SGrid_Cylinder_finish = SGrid_Cylinder_latit; #end #while (SGrid_Cylinder_i < SGrid_Cylinder_finish) #local SGrid_Cylinder_value = SGrid_Cylinder_height * (SGrid_Cylinder_start + SGrid_Cylinder_i * SGrid_Cylinder_increment); box { <-2*SGrid_Cylinder_radius, -SGrid_Cylinder_thickness/2, -2*SGrid_Cylinder_radius,>, <2*SGrid_Cylinder_radius, SGrid_Cylinder_thickness/2, 2*SGrid_Cylinder_radius,> translate y * SGrid_Cylinder_value bounded_by {SGrid_Cylinder_bounds} } #if (SGrid_Debug = true) #debug concat("cylinder_latit_value = ", str(SGrid_Cylinder_value, 0, -1),"\n") #end #local SGrid_Cylinder_i = SGrid_Cylinder_i + 1; #end translate SGrid_Cylinder_center } #end #macro SGrid_DblCone_Macro ( SGrid_DblCone_radii, // The number of radial divisions. (integer) SGrid_DblCone_longt, // The number of longitudinal divisions. (integer) SGrid_DblCone_latit, // The number of lattitudinal divisions. (integer) SGrid_DblCone_radius, // The radius of each cone. (float) SGrid_DblCone_height, // The height of each cone. (float) SGrid_DblCone_center, // The center coordinates of the double-cone. (vector) SGrid_DblCone_thickness, // The thickness of the grid lines. (float) SGrid_DblCone_offset, // Determines whether the divisions are offset by half the amount. Sometimes necessary when doing cut-aways. (boolian) SGrid_DblCone_endcap, // Determines whether borders are created at each end of the object. Ignored if the offset is turned on. (boolian) ) #local SGrid_DblCone_bounds = union { cone {0, SGrid_DblCone_radius, <0,+SGrid_DblCone_height,0,>, 0} cone {0, SGrid_DblCone_radius, <0,-SGrid_DblCone_height,0,>, 0} } union { #local SGrid_DblCone_increment = 1/SGrid_DblCone_radii; #local SGrid_DblCone_i = 0; #local SGrid_DblCone_start = 0; #if (SGrid_DblCone_offset = on) #local SGrid_DblCone_start = SGrid_DblCone_increment/2; #end #while (SGrid_DblCone_i < SGrid_DblCone_radii) #local SGrid_DblCone_value = SGrid_DblCone_radius * (SGrid_DblCone_start + SGrid_DblCone_i * SGrid_DblCone_increment); #local SGrid_DblCone_angle = atan2d(SGrid_DblCone_value, SGrid_DblCone_height); #local SGrid_DblCone_offsl = SGrid_DblCone_thickness/2 * 1/cosd(SGrid_DblCone_angle); #local SGrid_DblCone_offsv = SGrid_DblCone_thickness/2 * 1/cosd(90 - SGrid_DblCone_angle); difference { union { cone {0, SGrid_DblCone_value + SGrid_DblCone_offsl, <0,+SGrid_DblCone_height+SGrid_DblCone_offsv,0,>, 0} cone {0, SGrid_DblCone_value + SGrid_DblCone_offsl, <0,-SGrid_DblCone_height-SGrid_DblCone_offsv,0,>, 0} } union { cone {0, SGrid_DblCone_value - SGrid_DblCone_offsl, <0,+SGrid_DblCone_height-SGrid_DblCone_offsv,0,>, 0} cone {0, SGrid_DblCone_value - SGrid_DblCone_offsl, <0,-SGrid_DblCone_height+SGrid_DblCone_offsv,0,>, 0} } bounded_by {SGrid_DblCone_bounds} } #if (SGrid_Debug = true) #debug concat("radii_value = ", str(SGrid_DblCone_value, 0, -1),"\n") #end #local SGrid_DblCone_i = SGrid_DblCone_i + 1; #end #local SGrid_DblCone_increment = 1/SGrid_DblCone_longt; #local SGrid_DblCone_i = 0; #local SGrid_DblCone_start = 0; #if (SGrid_DblCone_offset = on) #local SGrid_DblCone_start = SGrid_DblCone_increment/2; #end #while (SGrid_DblCone_i < SGrid_DblCone_longt) #local SGrid_DblCone_value = 360 * (SGrid_DblCone_start + SGrid_DblCone_i * SGrid_DblCone_increment); box { <2*SGrid_DblCone_radius, 2*SGrid_DblCone_radius, SGrid_DblCone_thickness/2,>, <0, -2*SGrid_DblCone_radius, -SGrid_DblCone_thickness/2,> rotate y * SGrid_DblCone_value bounded_by {SGrid_DblCone_bounds} } #if (SGrid_Debug = true) #debug concat("longt_value = ", str(SGrid_DblCone_value, 0, -1),"\n") #end #local SGrid_DblCone_i = SGrid_DblCone_i + 1; #end #local SGrid_DblCone_increment = 1/SGrid_DblCone_latit; #local SGrid_DblCone_i = 0; #if (SGrid_DblCone_endcap = on) #local SGrid_DblCone_start = 0; #local SGrid_DblCone_finish = SGrid_DblCone_latit + 1; #else #local SGrid_DblCone_start = SGrid_DblCone_increment; #local SGrid_DblCone_finish = SGrid_DblCone_latit - 1; #end #if (SGrid_DblCone_offset = on) #local SGrid_DblCone_start = SGrid_DblCone_increment/2; #local SGrid_DblCone_finish = SGrid_DblCone_latit; #end #while (SGrid_DblCone_i < SGrid_DblCone_finish) #local SGrid_DblCone_value = -SGrid_DblCone_height + 2*SGrid_DblCone_height * (SGrid_DblCone_start + SGrid_DblCone_i * SGrid_DblCone_increment); box { , <-SGrid_DblCone_radius,-SGrid_DblCone_thickness/2,-SGrid_DblCone_radius,> bounded_by {SGrid_DblCone_bounds} translate y * SGrid_DblCone_value } #if (SGrid_Debug = true) #debug concat("lattt_value = ", str(SGrid_DblCone_value, 0, -1),"\n") #end #local SGrid_DblCone_i = SGrid_DblCone_i + 1; #end translate SGrid_DblCone_center } #end #macro SGrid_DblConeInv_Macro ( SGrid_DblConeInv_radii, // The number of radial divisions. (integer) SGrid_DblConeInv_longt, // The number of longitudinal divisions. (integer) SGrid_DblConeInv_latit, // The number of lattitudinal divisions. (integer) SGrid_DblConeInv_radius, // The radius of each cone. (float) SGrid_DblConeInv_height, // The height of each cone. (float) SGrid_DblConeInv_center, // The center coordinates of the double-cone. (vector) SGrid_DblConeInv_thickness, // The thickness of the grid lines. (float) SGrid_DblConeInv_offset, // Determines whether the divisions are offset by half the amount. Sometimes necessary when doing cut-aways. (boolian) SGrid_DblConeInv_endcap, // Determines whether borders are created at each end of the object. Ignored if the offset is turned on. (boolian) ) #local SGrid_DblConeInv_bounds = union { cone {0, 0, <0,+SGrid_DblConeInv_height,0,>, SGrid_DblConeInv_radius} cone {0, 0, <0,-SGrid_DblConeInv_height,0,>, SGrid_DblConeInv_radius} } union { #local SGrid_DblConeInv_increment = 1/SGrid_DblConeInv_radii; #local SGrid_DblConeInv_i = 0; #local SGrid_DblConeInv_start = 0; #if (SGrid_DblConeInv_offset = on) #local SGrid_DblConeInv_start = SGrid_DblConeInv_increment/2; #end #while (SGrid_DblConeInv_i < SGrid_DblConeInv_radii) #local SGrid_DblConeInv_value = SGrid_DblConeInv_radius * (SGrid_DblConeInv_start + SGrid_DblConeInv_i * SGrid_DblConeInv_increment); #local SGrid_DblConeInv_angle = atan2d(SGrid_DblConeInv_value, SGrid_DblConeInv_height); #local SGrid_DblConeInv_offsl = SGrid_DblConeInv_thickness/2 * 1/cosd(SGrid_DblConeInv_angle); #local SGrid_DblConeInv_offsv = SGrid_DblConeInv_thickness/2 * 1/cosd(90 - SGrid_DblConeInv_angle); difference { union { cone {<0,-SGrid_DblConeInv_offsv,0,>, 0, <0,+SGrid_DblConeInv_height,0,>, SGrid_DblConeInv_value + SGrid_DblConeInv_offsl} cone {<0,+SGrid_DblConeInv_offsv,0,>, 0, <0,-SGrid_DblConeInv_height,0,>, SGrid_DblConeInv_value + SGrid_DblConeInv_offsl} } union { cone {<0,+SGrid_DblConeInv_offsv,0,>, 0, <0,+SGrid_DblConeInv_height,0,>, SGrid_DblConeInv_value - SGrid_DblConeInv_offsl} cone {<0,-SGrid_DblConeInv_offsv,0,>, 0, <0,-SGrid_DblConeInv_height,0,>, SGrid_DblConeInv_value - SGrid_DblConeInv_offsl} } bounded_by {SGrid_DblConeInv_bounds} } #if (SGrid_Debug = true) #debug concat("radii_value = ", str(SGrid_DblConeInv_value, 0, -1),"\n") #end #local SGrid_DblConeInv_i = SGrid_DblConeInv_i + 1; #end #local SGrid_DblConeInv_increment = 1/SGrid_DblConeInv_longt; #local SGrid_DblConeInv_i = 0; #local SGrid_DblConeInv_start = 0; #if (SGrid_DblConeInv_offset = on) #local SGrid_DblConeInv_start = SGrid_DblConeInv_increment/2; #end #while (SGrid_DblConeInv_i < SGrid_DblConeInv_longt) #local SGrid_DblConeInv_value = 360 * (SGrid_DblConeInv_start + SGrid_DblConeInv_i * SGrid_DblConeInv_increment); box { <2*SGrid_DblConeInv_radius, 2*SGrid_DblConeInv_radius, SGrid_DblConeInv_thickness/2,>, <0, -2*SGrid_DblConeInv_radius, -SGrid_DblConeInv_thickness/2,> rotate y * SGrid_DblConeInv_value bounded_by {SGrid_DblConeInv_bounds} } #if (SGrid_Debug = true) #debug concat("longt_value = ", str(SGrid_DblConeInv_value, 0, -1),"\n") #end #local SGrid_DblConeInv_i = SGrid_DblConeInv_i + 1; #end #local SGrid_DblConeInv_increment = 1/SGrid_DblConeInv_latit; #local SGrid_DblConeInv_i = 0; #if (SGrid_DblConeInv_endcap = on) #local SGrid_DblConeInv_start = 0; #local SGrid_DblConeInv_finish = SGrid_DblConeInv_latit + 1; #else #local SGrid_DblConeInv_start = SGrid_DblConeInv_increment; #local SGrid_DblConeInv_finish = SGrid_DblConeInv_latit - 1; #end #if (SGrid_DblConeInv_offset = on) #local SGrid_DblConeInv_start = SGrid_DblConeInv_increment/2; #local SGrid_DblConeInv_finish = SGrid_DblConeInv_latit; #end #while (SGrid_DblConeInv_i < SGrid_DblConeInv_finish) #local SGrid_DblConeInv_value = -SGrid_DblConeInv_height + 2*SGrid_DblConeInv_height * (SGrid_DblConeInv_start + SGrid_DblConeInv_i * SGrid_DblConeInv_increment); box { , <-SGrid_DblConeInv_radius,-SGrid_DblConeInv_thickness/2,-SGrid_DblConeInv_radius,> bounded_by {SGrid_DblConeInv_bounds} translate y * SGrid_DblConeInv_value } #if (SGrid_Debug = true) #debug concat("lattt_value = ", str(SGrid_DblConeInv_value, 0, -1),"\n") #end #local SGrid_DblConeInv_i = SGrid_DblConeInv_i + 1; #end translate SGrid_DblConeInv_center } #end #macro SGrid_Sphere_Macro ( SGrid_Sphere_radii, // The number of radial divisions. (integer) SGrid_Sphere_longt, // The number of longitudinal divisions. (integer) SGrid_Sphere_latit, // The number of lattitudinal divisions. (integer) SGrid_Sphere_radius, // The radius of the sphere. (float) SGrid_Sphere_center, // The center coordinates of the sphere. (vector) SGrid_Sphere_thickness, // The thickness of the grid lines. (float) SGrid_Sphere_offset, // Determines whether the divisions are offset by half the amount. Sometimes necessary when doing cut-aways. (boolian) SGrid_Sphere_endcap, // Determines whether borders are created at each end of the object. Ignored if the offset is turned on. (boolian) ) #local SGrid_Sphere_bounds = sphere {0, SGrid_Sphere_radius} union { #local SGrid_Sphere_increment = 1/SGrid_Sphere_radii; #local SGrid_Sphere_i = 0; #local SGrid_Sphere_start = 0; #if (SGrid_Sphere_offset = on) #local SGrid_Sphere_start = SGrid_Sphere_increment/2; #end #while (SGrid_Sphere_i < SGrid_Sphere_radii) #local SGrid_Sphere_value = SGrid_Sphere_radius * (SGrid_Sphere_start + SGrid_Sphere_i * SGrid_Sphere_increment); difference { sphere {0, SGrid_Sphere_value + SGrid_Sphere_thickness/2} sphere {0, SGrid_Sphere_value - SGrid_Sphere_thickness/2} bounded_by {SGrid_Sphere_bounds} } #if (SGrid_Debug = true) #debug concat("radii_value = ", str(SGrid_Sphere_value, 0, -1),"\n") #end #local SGrid_Sphere_i = SGrid_Sphere_i + 1; #end #local SGrid_Sphere_increment = 1/SGrid_Sphere_longt; #local SGrid_Sphere_i = 0; #local SGrid_Sphere_start = 0; #if (SGrid_Sphere_offset = on) #local SGrid_Sphere_start = SGrid_Sphere_increment/2; #end #while (SGrid_Sphere_i < SGrid_Sphere_longt) #local SGrid_Sphere_value = 360 * (SGrid_Sphere_start + SGrid_Sphere_i * SGrid_Sphere_increment); box { <2*SGrid_Sphere_radius, 2*SGrid_Sphere_radius, SGrid_Sphere_thickness/2,>, <0, -2*SGrid_Sphere_radius, -SGrid_Sphere_thickness/2,> rotate y * SGrid_Sphere_value bounded_by {SGrid_Sphere_bounds} } #if (SGrid_Debug = true) #debug concat("longt_value = ", str(SGrid_Sphere_value, 0, -1),"\n") #end #local SGrid_Sphere_i = SGrid_Sphere_i + 1; #end #local SGrid_Sphere_increment = 1/SGrid_Sphere_latit; #local SGrid_Sphere_i = 0; #if (SGrid_Sphere_endcap = on) #local SGrid_Sphere_start = 0; #local SGrid_Sphere_finish = SGrid_Sphere_latit + 1; #local SGrid_Sphere_center_gap = 0; #else #local SGrid_Sphere_start = SGrid_Sphere_increment; #local SGrid_Sphere_finish = SGrid_Sphere_latit - 1; #end #if (SGrid_Sphere_offset = on) #local SGrid_Sphere_start = SGrid_Sphere_increment/2; #local SGrid_Sphere_finish = SGrid_Sphere_latit; #end #while (SGrid_Sphere_i < SGrid_Sphere_finish) #local SGrid_Sphere_value = 180 * (SGrid_Sphere_start + SGrid_Sphere_i * SGrid_Sphere_increment); #if (SGrid_Sphere_i < (SGrid_Sphere_finish - 1)/2) difference { cone { 0, 0, 2*SGrid_Sphere_radius*y, 2*SGrid_Sphere_radius*abs(tand(SGrid_Sphere_value)) translate SGrid_Sphere_radius*-y * 1/abs(sind(SGrid_Sphere_value)) * SGrid_Sphere_thickness/2 } cone { 0, 0, 2*SGrid_Sphere_radius*y, 2*SGrid_Sphere_radius*abs(tand(SGrid_Sphere_value)) translate SGrid_Sphere_radius*y * 1/abs(sind(SGrid_Sphere_value)) * SGrid_Sphere_thickness/2 } bounded_by {SGrid_Sphere_bounds} } #elseif (SGrid_Sphere_i = (SGrid_Sphere_finish - 1)/2) cylinder { <0,-SGrid_Sphere_thickness/2,0,>, <0,+SGrid_Sphere_thickness/2,0,>, 2*SGrid_Sphere_radius bounded_by {SGrid_Sphere_bounds} } #else difference { cone { 0, 0, 2*SGrid_Sphere_radius*-y, 2*SGrid_Sphere_radius*abs(tand(SGrid_Sphere_value)) translate SGrid_Sphere_radius*y * 1/abs(sind(SGrid_Sphere_value)) * SGrid_Sphere_thickness/2 } cone { 0, 0, 2*SGrid_Sphere_radius*-y, 2*SGrid_Sphere_radius*abs(tand(SGrid_Sphere_value)) translate SGrid_Sphere_radius*-y * 1/abs(sind(SGrid_Sphere_value)) * SGrid_Sphere_thickness/2 } bounded_by {SGrid_Sphere_bounds} } #end #if (SGrid_Debug = true) #debug concat("lattt_value = ", str(SGrid_Sphere_value, 0, -1),"\n") #end #local SGrid_Sphere_i = SGrid_Sphere_i + 1; #end translate SGrid_Sphere_center } #end #macro SGrid_Munsell_Macro ( SGrid_Munsell_radii, // The number of radial divisions. (integer) SGrid_Munsell_longt, // The number of longitudinal divisions. (integer) SGrid_Munsell_latit, // The number of lattitudinal divisions. (integer) SGrid_Munsell_radius, // The radius of the sphere. (float) SGrid_Munsell_center, // The center coordinates of the sphere. (vector) SGrid_Munsell_thickness, // The thickness of the grid lines. (float) SGrid_Munsell_offset, // Determines whether the divisions are offset by half the amount. Sometimes necessary when doing cut-aways. (boolian) SGrid_Munsell_endcap, // Determines whether borders are created at each end of the object. Ignored if the offset is turned on. (boolian) ) #local SGrid_Munsell_bounds = sphere {0, SGrid_Munsell_radius} union { #local SGrid_Munsell_increment = 1/SGrid_Munsell_radii; #local SGrid_Munsell_i = 0; #local SGrid_Munsell_start = 0; #if (SGrid_Munsell_offset = on) #local SGrid_Munsell_start = SGrid_Munsell_increment/2; #end #while (SGrid_Munsell_i < SGrid_Munsell_radii) #local SGrid_Munsell_value = SGrid_Munsell_radius * (SGrid_Munsell_start + SGrid_Munsell_i * SGrid_Munsell_increment); difference { object {Spheroid(0, )} object {Spheroid(0, )} bounded_by {SGrid_Munsell_bounds} } #if (SGrid_Debug = true) #debug concat("radii_value = ", str(SGrid_Munsell_value, 0, -1),"\n") #end #local SGrid_Munsell_i = SGrid_Munsell_i + 1; #end #local SGrid_Munsell_increment = 1/SGrid_Munsell_longt; #local SGrid_Munsell_i = 0; #local SGrid_Munsell_start = 0; #if (SGrid_Munsell_offset = on) #local SGrid_Munsell_start = SGrid_Munsell_increment/2; #end #while (SGrid_Munsell_i < SGrid_Munsell_longt) #local SGrid_Munsell_value = 360 * (SGrid_Munsell_start + SGrid_Munsell_i * SGrid_Munsell_increment); box { <2*SGrid_Munsell_radius, 2*SGrid_Munsell_radius, SGrid_Munsell_thickness/2,>, <0, -2*SGrid_Munsell_radius, -SGrid_Munsell_thickness/2,> bounded_by {SGrid_Munsell_bounds} rotate y * SGrid_Munsell_value } #if (SGrid_Debug = true) #debug concat("longt_value = ", str(SGrid_Munsell_value, 0, -1),"\n") #end #local SGrid_Munsell_i = SGrid_Munsell_i + 1; #end #local SGrid_Munsell_increment = 1/SGrid_Munsell_latit; #local SGrid_Munsell_i = 0; #if (SGrid_Munsell_endcap = on) #local SGrid_Munsell_start = 0; #local SGrid_Munsell_finish = SGrid_Munsell_latit + 1; #else #local SGrid_Munsell_start = SGrid_Munsell_increment; #local SGrid_Munsell_finish = SGrid_Munsell_latit - 1; #end #if (SGrid_Munsell_offset = on) #local SGrid_Munsell_start = SGrid_Munsell_increment/2; #local SGrid_Munsell_finish = SGrid_Munsell_latit; #end #while (SGrid_Munsell_i < SGrid_Munsell_finish) #local SGrid_Munsell_value = -SGrid_Munsell_radius + 2*SGrid_Munsell_radius*(SGrid_Munsell_start + SGrid_Munsell_i * SGrid_Munsell_increment); box { , <-SGrid_Munsell_radius,-SGrid_Munsell_thickness/2,-SGrid_Munsell_radius,> bounded_by {SGrid_Munsell_bounds} translate y * SGrid_Munsell_value } #if (SGrid_Debug = true) #debug concat("lattt_value = ", str(SGrid_Munsell_value, 0, -1),"\n") #end #local SGrid_Munsell_i = SGrid_Munsell_i + 1; #end translate SGrid_Munsell_center } #end #macro SGrid_Cube_Macro ( SGrid_Cube_sectors, // The number of sections along each axis. (integer vector) SGrid_Cube_width, // The width of the cuboid along each axis. (float vector) SGrid_Cube_corner, // The coordinates of the bottom corner. (float vector) SGrid_Cube_thickness, // The thickness of the grid lines. (float) SGrid_Cube_offset, // Determines whether the divisions are offset by half the amount. Sometimes necessary when doing cut-aways. (boolian) SGrid_Cube_endcap, // Determines whether borders are created at each end of the object. Ignored if the offset is turned on. (boolian) ) #local SGrid_Cube_bounds = box {0, SGrid_Cube_width} union { #local SGrid_Cube_increment = 1/SGrid_Cube_sectors.x; #local SGrid_Cube_i = 0; #local SGrid_Cube_start = 0; #if (SGrid_Cube_endcap = on) #local SGrid_Cube_start = 0; #local SGrid_Cube_finish = SGrid_Cube_sectors.x + 1; #else #local SGrid_Cube_start = SGrid_Cube_increment; #local SGrid_Cube_finish = SGrid_Cube_sectors.x - 1; #end #if (SGrid_Cube_offset = on) #local SGrid_Cube_start = SGrid_Cube_increment/2; #local SGrid_Cube_finish = SGrid_Cube_sectors.x; #end #while (SGrid_Cube_i < SGrid_Cube_finish) #local SGrid_Cube_value = SGrid_Cube_width.x * (SGrid_Cube_start + SGrid_Cube_i * SGrid_Cube_increment); box { <-SGrid_Cube_thickness/2, +2*SGrid_Cube_width.y, +2*SGrid_Cube_width.z,>, <+SGrid_Cube_thickness/2, -1*SGrid_Cube_width.y, -1*SGrid_Cube_width.z,> translate x * SGrid_Cube_value bounded_by {SGrid_Cube_bounds} } #if (SGrid_Debug = true) #debug concat("sectorx_value = ", str(SGrid_Cube_value, 0, -1),"\n") #end #local SGrid_Cube_i = SGrid_Cube_i + 1; #end #local SGrid_Cube_increment = 1/SGrid_Cube_sectors.y; #local SGrid_Cube_i = 0; #local SGrid_Cube_start = 0; #if (SGrid_Cube_endcap = on) #local SGrid_Cube_start = 0; #local SGrid_Cube_finish = SGrid_Cube_sectors.y + 1; #else #local SGrid_Cube_start = SGrid_Cube_increment; #local SGrid_Cube_finish = SGrid_Cube_sectors.y - 1; #end #if (SGrid_Cube_offset = on) #local SGrid_Cube_start = SGrid_Cube_increment/2; #local SGrid_Cube_finish = SGrid_Cube_sectors.y; #end #while (SGrid_Cube_i < SGrid_Cube_finish) #local SGrid_Cube_value = SGrid_Cube_width.y * (SGrid_Cube_start + SGrid_Cube_i * SGrid_Cube_increment); box { <+2*SGrid_Cube_width.x, -SGrid_Cube_thickness/2, +2*SGrid_Cube_width.z,>, <-1*SGrid_Cube_width.x, +SGrid_Cube_thickness/2, -1*SGrid_Cube_width.z,> translate y * SGrid_Cube_value bounded_by {SGrid_Cube_bounds} } #if (SGrid_Debug = true) #debug concat("sectory_value = ", str(SGrid_Cube_value, 0, -1),"\n") #end #local SGrid_Cube_i = SGrid_Cube_i + 1; #end #local SGrid_Cube_increment = 1/SGrid_Cube_sectors.z; #local SGrid_Cube_i = 0; #local SGrid_Cube_start = 0; #if (SGrid_Cube_endcap = on) #local SGrid_Cube_start = 0; #local SGrid_Cube_finish = SGrid_Cube_sectors.z + 1; #else #local SGrid_Cube_start = SGrid_Cube_increment; #local SGrid_Cube_finish = SGrid_Cube_sectors.z - 1; #end #if (SGrid_Cube_offset = on) #local SGrid_Cube_start = SGrid_Cube_increment/2; #local SGrid_Cube_finish = SGrid_Cube_sectors.z; #end #while (SGrid_Cube_i < SGrid_Cube_finish) #local SGrid_Cube_value = SGrid_Cube_width.z * (SGrid_Cube_start + SGrid_Cube_i * SGrid_Cube_increment); box { <+2*SGrid_Cube_width.x, +2*SGrid_Cube_width.y, -SGrid_Cube_thickness/2,>, <-1*SGrid_Cube_width.x, -1*SGrid_Cube_width.y, +SGrid_Cube_thickness/2,> translate z * SGrid_Cube_value bounded_by {SGrid_Cube_bounds} } #if (SGrid_Debug = true) #debug concat("sectorz_value = ", str(SGrid_Cube_value, 0, -1),"\n") #end #local SGrid_Cube_i = SGrid_Cube_i + 1; #end translate SGrid_Cube_corner } #end default { finish {ambient 1 diffuse 1} } background {color srgb 3/4} light_source { <-1,+1,+1,> * 100 color srgb 1 parallel shadowless } light_source { <-1,+1,-1,> * 100 color srgb 1 parallel shadowless } /* sky_sphere { pigment { gradient y color_map {[0.0 rgb <0.6,0.7,1.0>][0.7 rgb <0.0,0.1,0.8>]} } } */ camera { #local CameraDistance = 10; #local ScreenArea = 2; #local AspectRatio = image_width/image_height; // orthographic location -z*CameraDistance direction +z*CameraDistance right +x*ScreenArea*AspectRatio up +y*ScreenArea // rotate +x*asind(tand(30)) // rotate +y*45 rotate +x*30 rotate +y*60 } //------------------------------------------------------------------------------CSG objects #declare Color_solid = object { SGrid_Cylinder_Macro ( 6, // CylinderGrid_radii, The number of radial divisions. (integer) //radii, The number of radial divisions. (integer) 12, // CylinderGrid_longt, The number of longitudinal divisions. (integer) //longt, The number of longitudinal divisions. (integer) 6, // CylinderGrid_lattt, The number of lattitudinal divisions. (integer) //lattt, The number of lattitudinal divisions. (integer) 1, // CylinderGrid_radius, The radius of the sphere. (float) //ObjectRadius, The radius of the sphere. (float) 1, // CylinderGrid_height, The height of the cylinder. (float) 0, // CylinderGrid_center, The center coordinates of the sphere. (vector) //ObjectCenter, The center coordinates of the sphere. (vector) 0.01, // CylinderGrid_thickness, The thickness of the grid lines. (float) //LineThickness, The thickness of the grid lines. (float) off, // CylinderGrid_offset, Determines whether the divisions are offset by half the amount (sometimes necessary when doing cut-aways at intervals matching the grid's divisions). (boolian)//OffsetBool Determines whether the divisions are offset by half the amount (sometimes necessary when doing cut-aways at intervals matching the grid's divisions). (boolian) on, ) } difference { cylinder {0, +y, 1} intersection { plane {x, 0 rotate y * 0} // plane {-y, 0 Axis_Rotate_Trans(x-z, 0)} plane {z, 0 rotate y * 0} } #if (simple = false) object {Color_solid} #end texture { pigment {CSolid_HSVCylinder_Pigment} } translate -y * 1/2 } #if (simple = false) polygon { 4, <0, 0,>, <1, 0,>, <1, 1,>, <0, 1,> pigment {image_map {png "CSolid_Hue_Round.png"}} translate <-0.5, -0.5> scale 8/3 rotate +x * 90 rotate -y * 30 translate -y * 1/10 } polygon { 4, <0, 0,>, <1, 0,>, <1, 1,>, <0, 1,> pigment {image_map {png "CSolid_Saturation_Straight.png"}} translate <-0.5, -0.5> scale 8/3 translate -z * 0.000001 rotate +z * 45 rotate +y * 90 } polygon { 4, <0, 0,>, <1, 0,>, <1, 1,>, <0, 1,> pigment {image_map {png "CSolid_Value_Straight.png"}} translate <-0.5, -0.5> scale 8/3 // translate -z * 0.000001 rotate +y * 75 } #if (axes) #include "Axes_macro.inc" // the coordinate grid and axes Axes_Macro ( 10, // Axes_axesSize, The distance from the origin to one of the grid's edges. (float) 1, // Axes_majUnit, The size of each large-unit square. (float) 10, // Axes_minUnit, The number of small-unit squares that make up a large-unit square. (integer) 0.0005, // Axes_thickRatio, The thickness of the grid lines (as a factor of axesSize). (float) off, // Axes_aBool, Turns the axes on/off. (boolian) on, // Axes_mBool, Turns the minor units on/off. (boolian) off, // Axes_xBool, Turns the plane perpendicular to the x-axis on/off. (boolian) on, // Axes_yBool, Turns the plane perpendicular to the y-axis on/off. (boolian) off // Axes_zBool, Turns the plane perpendicular to the z-axis on/off. (boolian) ) object { Axes_Object translate -0.000001 translate -y/2 } #end #end