Updated bezier code to support N-point beziers.

This commit is contained in:
Revar Desmera
2018-02-16 14:49:32 -08:00
parent 453ebcb83f
commit 2d9fa565b3
3 changed files with 62 additions and 48 deletions

View File

@@ -51,6 +51,10 @@ function quantup(x,y) = ceil(x/y)*y;
function segs(r) = $fn>0?($fn>3?$fn:3):(ceil(max(min(360.0/$fa,abs(r)*2*Cpi()/$fs),5)));
// Interpolate between two values or vectors. 0.0 <= u <= 1.0
function lerp(a,b,u) = (b-a)*u + a;
// Calculate hypotenuse length of 2D triangle.
function hypot(x,y) = sqrt(x*x+y*y);