change to remove ninther

This commit is contained in:
Adrian Mariano 2021-10-21 16:10:36 -04:00
parent 9e4d46eecf
commit 247939fec6
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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] ]
)