mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-02 00:00:28 +02:00
change to remove ninther
This commit is contained in:
@@ -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] ]
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user