diff --git a/arrays.scad b/arrays.scad index 0e3ab97..5c0e7e7 100644 --- a/arrays.scad +++ b/arrays.scad @@ -1249,7 +1249,8 @@ function group_sort(list, idx) = // small = list_smallest(list, k) // Description: // Returns a set of the k smallest items in list in arbitrary order. The items must be -// mutually comparable with native OpenSCAD comparison operations. +// mutually comparable with native OpenSCAD comparison operations. You will get "undefined operation" +// errors if you provide invalid input. // Arguments: // list = list to process // k = number of items to return diff --git a/vectors.scad b/vectors.scad index 4abdfe1..d9cf79c 100644 --- a/vectors.scad +++ b/vectors.scad @@ -494,7 +494,7 @@ function _bt_tree(points, ind, leafsize=25) = pmc = mean(projc), pivot = min_index([for(p=projc) abs(p-pmc)]), radius = max([for(i=ind) norm(points[ind[pivot]]-points[i]) ]), - median = ninther(projc), + median = mean(projc), Lind = [for(i=idx(ind)) if(projc[i]<=median && i!=pivot) ind[i] ], Rind = [for(i=idx(ind)) if(projc[i] >median && i!=pivot) ind[i] ] )