mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-30 08:19:36 +00:00
change to remove ninther
This commit is contained in:
parent
9e4d46eecf
commit
247939fec6
2 changed files with 3 additions and 2 deletions
|
@ -1249,7 +1249,8 @@ function group_sort(list, idx) =
|
||||||
// small = list_smallest(list, k)
|
// small = list_smallest(list, k)
|
||||||
// Description:
|
// Description:
|
||||||
// Returns a set of the k smallest items in list in arbitrary order. The items must be
|
// 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:
|
// Arguments:
|
||||||
// list = list to process
|
// list = list to process
|
||||||
// k = number of items to return
|
// k = number of items to return
|
||||||
|
|
|
@ -494,7 +494,7 @@ function _bt_tree(points, ind, leafsize=25) =
|
||||||
pmc = mean(projc),
|
pmc = mean(projc),
|
||||||
pivot = min_index([for(p=projc) abs(p-pmc)]),
|
pivot = min_index([for(p=projc) abs(p-pmc)]),
|
||||||
radius = max([for(i=ind) norm(points[ind[pivot]]-points[i]) ]),
|
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] ],
|
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] ]
|
Rind = [for(i=idx(ind)) if(projc[i] >median && i!=pivot) ind[i] ]
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue