1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-09-24 21:41:33 +02:00
Files
dotSCAD/src/curve.scad
2021-02-24 21:09:54 +08:00

24 lines
594 B
OpenSCAD

/**
* crystal_ball.scad
*
* @copyright Justin Lin, 2020
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-curve.html
*
**/
use <_impl/_catmull_rom_spline.scad>;
function curve(t_step, points, tightness = 0) =
let(leng = len(points))
concat(
[
for(i = [0:leng - 4])
let(
pts = _catmull_rom_spline_4pts(t_step, [for(j = [i:i + 3]) points[j]], tightness)
)
for(i = [0:len(pts) - 2]) pts[i]
],
[points[leng - 2]]
);