From 814975afaf84991c0ecd6c23c455cfb7de34d43f Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Thu, 21 Oct 2021 16:12:11 -0400 Subject: [PATCH] use median in bt_tree --- vectors.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vectors.scad b/vectors.scad index d9cf79c..c57ebdd 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 = mean(projc), + median = median(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] ] )