// Last edited on 2019-04-10 13:45:19 by stolfilocal #macro earth_layer_spheroid(r, f) // An oblate spheroid with equator on {X,Y} plane // equatorial radius {r} and relative polar flattening {f} sphere{ <0,0,0>, r scale <1,1,1-f> } #end #macro earth_layer(rmin, fmin, rmax, fmax, tx) // A shell between two oblate spheroids with equatorial // radii {rmin,rmax} and relative flattenings {fmin,fmax} // at the poles. #local shell = #if (rmin > 0) difference{ object{ earth_layer_spheroid(rmax, fmax) } object{ earth_layer_spheroid(rmin, fmin) } } #else object{ earth_layer_spheroid(rmax, fmax) } #end #local ang_slice = 30*(rmax - 6000)/6000; // Angle of slice #local slibox = box{ <0,0,0>, <10000,10000,10000> } #local slicer = union{ object{ slibox } object{ slibox translate 0.1*z rotate ang_slice*z } } difference{ object{ shell } object{ slicer } texture { tx } } #end