update with actual dimensions

This commit is contained in:
wardwouts 2024-06-16 11:06:39 +02:00
parent 1bfe2187d1
commit 3786b1ee9e
10 changed files with 54 additions and 35 deletions

View file

@ -0,0 +1,17 @@
// input : list of numbers
// output : sorted list of numbers
function quicksort(arr) = !(len(arr)>0) ? [] : let(
pivot = arr[floor(len(arr)/2)],
lesser = [ for (y = arr) if (y < pivot) y ],
equal = [ for (y = arr) if (y == pivot) y ],
greater = [ for (y = arr) if (y > pivot) y ]
) concat(
quicksort(lesser), equal, quicksort(greater)
);
module cuben(name, size){
cube(size=size, center=false);
// sizes should be ordered biggest to smallest
size_sorted=quicksort(size);
echo(str("#### ", name, ": " , size_sorted[2], "x", size_sorted[1], "x", size_sorted[0]));
};