//--- #version unofficial 3.8; // yuqk #if (file_exists("version.inc")) #include "version.inc" #end #if (!defined(Fork_yuqk)) #error "This POV-Ray SDL code requires the yuqk fork." #end global_settings { assumed_gamma 1 } #declare Grey50 = srgb <0.5,0.5,0.5>; background { Grey50*0.1 } #declare Camera00 = camera { perspective location <3,3,-3.001>*0.65 sky y angle 35 right x*(image_width/image_height) look_at <0,0,0> } #declare White = srgb <1,1,1>; #declare Light00 = light_source { <50,150,-250>, White } #declare Red = srgb <1,0,0>; #declare CylinderX = cylinder { -1*x, 1*x, 0.01 pigment { Red } } #declare Green = srgb <0,1,0>; #declare CylinderY = cylinder { -1*y, 1*y, 0.01 pigment { Green } } #declare Blue = srgb <0,0,1>; #declare CylinderZ = cylinder { -1*z, 1*z, 0.01 pigment { Blue } } #include "functions.inc" #declare Fn00 = function (x,y,z) { f_planar(f_npmod(x+1e5-0.02,0.05,1),0.02,1) } #declare Iso99 = isosurface { function { Fn00(x,y,z) } contained_by { box { <-0.6,-0.8,-0.8>,<0.6,0.8,0.8> } } threshold 0 accuracy 0.0005 max_gradient 5.1 } #declare Sph00 = sphere { 0, 0.7 } #declare Sph00_inside_only = object { // Spherical region, no surfaces Sph00 clipped_by{ sphere { 0, 0.7-1e-8 } } } #declare Box00 = box { <-1,-0.3,-0.3>, <+1,+0.3,+0.3> } #declare Int00 = intersection { // Octagonal shape, no caps object { Box00 } object { Box00 rotate x*45 } object { Sph00_inside_only } } #declare Sph00_caps = object { // Cap surfaces for octagonal Int00 Sph00 clipped_by{ Int00 scale 1+2e-8} } #declare MyShape = union { // Clean dual surfaces for interior{}s #if (0) object { Int00 pigment { rgb <0.25,0.17,0.42> } normal { micro 0.3 } } object { Sph00_caps pigment { rgb <0.11,0.27,0.12> } normal { micro 0.3 } } #else object { Int00 pigment { rgbt <0,0,0,1> } } object { Sph00_caps pigment { rgbt <0.11,0.27,0.12,0> } } hollow interior { media { samples 3 emission 2.0 density { rgb <.25,.17,.42> } } } #end bounded_by { box { <-0.7,-0.3,-0.3>, <+0.7,+0.3,+0.3> } } } //--- scene --- camera { Camera00 } light_source { Light00 } object { CylinderX } object { CylinderY } object { CylinderZ } object { MyShape } // object { Iso99 } object { Int00 clipped_by{ Iso99 } scale 1.0+5e-8 } sphere { <0,1,0.5>, 0.5 normal { micro 0.05 } finish { reflection { 0.3 } } } //--- #debug concat("min_extent = <",vstr(3, min_extent(MyShape),",",0,3),">\n") #debug concat("max_extent = <",vstr(3, max_extent(MyShape),",",0,3),">\n")