/ src / sphere_spiral_extrude.scad
sphere_spiral_extrude.scad
 1  /**
 2  * sphere_spiral_extrude.scad
 3  *
 4  * @copyright Justin Lin, 2017
 5  * @license https://opensource.org/licenses/lgpl-3.0.html
 6  *
 7  * @see https://openhome.cc/eGossip/OpenSCAD/lib3x-sphere_spiral_extrude.html
 8  *
 9  **/
10  
11  use <cross_sections.scad>
12  use <sphere_spiral.scad>
13  use <sweep.scad>
14  
15  module sphere_spiral_extrude(shape_pts, radius, za_step, 
16                               z_circles = 1, begin_angle = 0, end_angle = 0, vt_dir = "SPI_DOWN", rt_dir = "CT_CLK", 
17                               twist = 0, scale = 1.0, triangles = "SOLID") {
18  
19      points_angles = sphere_spiral(
20          radius = radius, 
21          za_step = za_step,  
22          z_circles = z_circles, 
23          begin_angle = begin_angle, 
24          end_angle = end_angle,
25          vt_dir = vt_dir,
26          rt_dir = rt_dir
27      );
28  
29      vr_clk = [vt_dir == "SPI_DOWN" ? 90 : -90, 0, rt_dir == "CT_CLK" ? 0 : 180];
30      points = [for(pa = points_angles) pa[0]];
31      angles = [for(pa = points_angles) pa[1] + vr_clk];
32  
33      sections = cross_sections(
34          shape_pts, points, angles, twist = twist, scale = scale
35      );
36  
37      sweep(
38          sections, 
39          triangles
40      );
41  
42      // testing hook
43      test_sphere_spiral_extrude(sections);
44  }
45  
46  // override it to test
47  module test_sphere_spiral_extrude(sections) {
48  
49  }