mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
Removed bogus median function
This commit is contained in:
parent
e2817ae64d
commit
817bdffdef
2 changed files with 1 additions and 12 deletions
11
math.scad
11
math.scad
|
@ -641,17 +641,6 @@ function mean(v) =
|
||||||
sum(v)/len(v);
|
sum(v)/len(v);
|
||||||
|
|
||||||
|
|
||||||
// Function: median()
|
|
||||||
// Usage:
|
|
||||||
// x = median(v);
|
|
||||||
// Description:
|
|
||||||
// Given a list of numbers or vectors, finds the median value or midpoint.
|
|
||||||
// If passed a list of vectors, returns the vector of the median of each component.
|
|
||||||
function median(v) =
|
|
||||||
is_vector(v) ? (min(v)+max(v))/2 :
|
|
||||||
is_matrix(v) ? [for(ti=transpose(v)) (min(ti)+max(ti))/2 ]
|
|
||||||
: assert(false , "Invalid input.");
|
|
||||||
|
|
||||||
// Function: convolve()
|
// Function: convolve()
|
||||||
// Usage:
|
// Usage:
|
||||||
// x = convolve(p,q);
|
// x = convolve(p,q);
|
||||||
|
|
|
@ -339,7 +339,7 @@ function region_faces(region, transform, reverse=false, vnf=EMPTY_VNF) =
|
||||||
// linear_sweep(orgn,height=20,convexity=16) show_anchors();
|
// linear_sweep(orgn,height=20,convexity=16) show_anchors();
|
||||||
module linear_sweep(region, height=1, center, twist=0, scale=1, slices, maxseg, style="default", convexity, anchor_isect=false, anchor, spin=0, orient=UP) {
|
module linear_sweep(region, height=1, center, twist=0, scale=1, slices, maxseg, style="default", convexity, anchor_isect=false, anchor, spin=0, orient=UP) {
|
||||||
region = is_path(region)? [region] : region;
|
region = is_path(region)? [region] : region;
|
||||||
cp = median(flatten(region));
|
cp = mean(pointlist_bounds(flatten(region)));
|
||||||
anchor = get_anchor(anchor, center, "origin", "origin");
|
anchor = get_anchor(anchor, center, "origin", "origin");
|
||||||
vnf = linear_sweep(
|
vnf = linear_sweep(
|
||||||
region, height=height,
|
region, height=height,
|
||||||
|
|
Loading…
Reference in a new issue