1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-09-01 11:22:36 +02:00

Added bezier_join().

Moved path_length() from sweep.scad to maths.scad.
This commit is contained in:
Chris Palmer
2022-02-23 11:53:02 +00:00
parent 76aa613093
commit 42fccc1afb
6 changed files with 39 additions and 5 deletions

View File

@@ -177,10 +177,6 @@ module sweep(path, profile, loop = false, twist = 0, convexity = 1) { //! Draw a
polyhedron(points = mesh[0], faces = mesh[1], convexity = convexity);
}
function path_length(path, i = 0, length = 0) = //! Calculated the length along a path
i >= len(path) - 1 ? length
: path_length(path, i + 1, length + norm(path[i + 1] - path[i]));
function circle_points(r = 1, z = 0, dir = -1) = //! Generate the points of a circle, setting z makes a single turn spiral
let(sides = r2sides(r))
[for(i = [0 : sides - 1]) let(a = dir * i * 360 / sides) [r * cos(a), r * sin(a), z * i / sides]];