mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-31 21:11:55 +02:00
Simplified list_rotate() and polygon_shift()
This commit is contained in:
@@ -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<len(poly))
|
||||
let(
|
||||
poly = cleanup_path(poly)
|
||||
) select(poly,i,i+len(poly)-1);
|
||||
list_rotate(cleanup_path(poly), i);
|
||||
|
||||
|
||||
// Function: polygon_shift_to_closest_point()
|
||||
|
Reference in New Issue
Block a user