Advertisement
Guest User

the center of the world

a guest
Dec 6th, 2017
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. wwrad=40; // Radius of the Planet
  2. wrad=wwrad/40; // Radius of the Spot
  3. wradp=wwrad-wrad/2; // Distance of the Spot from the center
  4. wres=100; // Resolution of the Spot
  5. latx=43.260918; lonx=-2.938764; // position of bilbao
  6. slice_size=.3;
  7.  
  8. // create slices from a figure
  9. module slice(rad=5, dist=1.5, size=1){
  10.     for(i=[-rad:dist:rad]){
  11.         intersection(){
  12.             translate([0,i,0]){
  13.                 cube(size=[rad*2, size, rad*2], center=true);
  14.             };
  15.             children();
  16.         };
  17.     };
  18. };
  19.  
  20. union(){
  21.     // earth low-res surfice
  22.     difference(){
  23.         rotate(a=[0,0,270]){
  24.             import("geody_earthmap.stl", convexity=5);
  25.         };
  26.         sphere(r=wwrad-.5, $fn=wres);
  27.     };
  28.  
  29.     //// radial torus from bilbao
  30.     rotate([(latx + 44),-(latx+3),360]){
  31.         union(){
  32.             slice(rad=wwrad, dist=1.5, size=slice_size)difference(){
  33.                 sphere(r=wwrad, $fn=wres);
  34.                 translate([0,0,.5]){
  35.                     sphere(r=wwrad-1, $fn=wres);
  36.                 };
  37.             };
  38.             rotate(a=[0, 180, 180])intersection(){
  39.                 cube(size=[wwrad*2, slice_size, wwrad*2], center=true);
  40.                 difference(){
  41.                     sphere(r=wwrad, $fn=wres);
  42.                     sphere(r=wwrad-1, $fn=wres);
  43.                 };
  44.             };
  45.         };
  46.     };
  47.  
  48.  
  49.     // make stronger globe
  50.         rotate(a=[lonx, latx,0]){
  51.             intersection(){
  52.               cube(size=[wwrad*2, slice_size, wwrad*2], center=true);    
  53.               difference(){
  54.                     sphere(r=wwrad, $fn=wres);
  55.                     sphere(r=wwrad-1, $fn=wres);
  56.                };
  57.             };
  58.         };
  59.  
  60.     // bilbao dot in the surface
  61.     translate(
  62.         [(-wradp)*cos(latx)*cos(lonx), // rotation over the globe
  63.          (-wradp)*cos(latx)*sin(lonx),
  64.           wradp*sin(latx)]
  65.         ){
  66.             sphere(r=wrad, $fn=wres, center=true);
  67.     };
  68. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement