/ src / experimental / ptf_c2sphere.scad
ptf_c2sphere.scad
 1  use <ptf/ptf_rotate.scad>
 2  
 3  function ptf_c2sphere(point, radius) = 
 4      let(
 5  	    za = atan2(point[1], point[0]),
 6  		ya = 90 * norm(point) / radius
 7  	)
 8  	ptf_rotate([radius * sin(ya), 0, radius * cos(ya)], za);
 9  
10  /*
11  use <experimental/tile_penrose3.scad>
12  use <experimental/ptf_c2sphere.scad>
13  
14  r_circle = 19;
15  points = [
16      for(r = [1:r_circle]) 
17  	    for(a = [0:30:330])
18              [r * cos(a), r * sin(a)]		
19  ];
20  
21  radius = 10;
22  for(p = points) {
23      #translate(p)
24  	    sphere(1);
25  		
26      translate(ptf_c2sphere(p, radius))
27  	    sphere(1);
28  }
29  */