/ src / curve.scad
curve.scad
 1  /**
 2  * crystal_ball.scad
 3  *
 4  * @copyright Justin Lin, 2020
 5  * @license https://opensource.org/licenses/lgpl-3.0.html
 6  *
 7  * @see https://openhome.cc/eGossip/OpenSCAD/lib3x-curve.html
 8  *
 9  **/ 
10  
11  use <_impl/_catmull_rom_spline.scad>
12  
13  function curve(t_step, points, tightness = 0) = 
14      let(leng = len(points))
15      [
16          each [
17              for(i = [0:leng - 4])
18              let(pts = _catmull_rom_spline_4pts(t_step, [for(j = [i:i + 3]) points[j]], tightness))
19                  for(i = [0:len(pts) - 2]) pts[i]    
20          ],
21          points[leng - 2]
22      ];