diff --git a/arrays.scad b/arrays.scad index 289ce24..eea3ffe 100644 --- a/arrays.scad +++ b/arrays.scad @@ -180,8 +180,7 @@ function reverse(list) = function list_rotate(list,n=1) = assert(is_list(list)||is_string(list)) assert(is_num(n)) - let(n = posmod(n,len(list))) - n==0? list : concat(select(list,n,-1), select(list,0,n-1)); + select(list,n,n+len(list)-1); // Function: deduplicate() diff --git a/geometry.scad b/geometry.scad index 059b516..0f2f46a 100644 --- a/geometry.scad +++ b/geometry.scad @@ -926,10 +926,7 @@ function polygon_area(vertices) = // Example: // polygon_shift([[3,4], [8,2], [0,2], [-4,0]], 2); // Returns [[0,2], [-4,0], [3,4], [8,2]] function polygon_shift(poly, i) = - assert(i