/ src / hull_polyline2d.scad
hull_polyline2d.scad
 1  /**
 2  * hull_polyline2d.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-hull_polyline2d.html
 8  *
 9  **/
10  
11  module hull_polyline2d(points, width = 1) {
12      echo("`hull_polyline2d` is deprecated since 3.2. Use `polyline_join` instead.");
13      
14      half_width = width / 2;
15      leng = len(points);
16      
17      module hull_line2d(index) {
18          point1 = points[index - 1];
19          point2 = points[index];
20  
21          hull() {
22              translate(point1) 
23                  children();
24              translate(point2) 
25                  children();
26          }
27  
28          // hook for testing
29          test_hull_polyline2d_line_segment(index, point1, point2, half_width);
30      }
31  
32      for(i = [1:leng - 1]) {
33          hull_line2d(i)
34              circle(half_width);
35      }
36  }
37  
38  // override it to test
39  module test_hull_polyline2d_line_segment(index, point1, point2, radius) {
40  
41  }