Removed deprecations.

This commit is contained in:
Revar Desmera 2019-04-18 21:16:10 -07:00
parent 4759f21b3b
commit 08711565e7
5 changed files with 27 additions and 472 deletions

View file

@ -889,9 +889,7 @@ function patch_scale(patch, v=[1,1,1], cp=[0,0,0]) = [for(row=patch) scale_point
// v = Vector axis to rotate round.
// cp = Centerpoint to rotate around.
function patch_rotate(patch, a=undef, v=undef, cp=[0,0,0]) =
v==undef?
[for(row=patch) rotate_points3d(row, a, cp)] :
[for(row=patch) rotate_points3d_around_axis(row, a, v, cp)];
[for(row=patch) rotate_points3d(row, v=a, axis=v, cp=cp)] :
// Function: patches_translate()

26
changes/REMOVED.txt Normal file
View file

@ -0,0 +1,26 @@
Cpi PI
hypot3 norm([x,y,z])
distance norm(p2-p1)
cdr slice(list, 1, -1)
wrap_range select()
vector2d_angle vector_angle()
vector3d_angle vector_angle()
rotate_points3d_around_axis rotate_points3d(pts, v=ang, axis=u, cp=cp)
cube2pt cuboid(p1, p2)
span_cube cuboid(p1, p2)
offsetcube cuboid(..., align)
chamfcube cuboid(..., chamfer, edges, trimcorners)
rrect cuboid(..., fillet, edges)
rcube cuboid(..., fillet)
trapezoid prismoid()
pyramid cyl(..., r2=0, $fn=N)
prism cyl(..., $fn=N)
chamferred_cylinder cyl(..., chamfer)
chamf_cyl cyl(..., chamfer)
filleted_cylinder cyl(..., fillet)
rcylinder cyl(..., fillet)
thinning_brace thinning_triangle(..., diagonly=true)
translate_copies place_copies()
line_of spread(p1, p2)
grid_of grid3d()

View file

@ -47,14 +47,6 @@ PHI = (1+sqrt(5))/2; // The golden ratio phi.
EPSILON = 1e-9; // A really small value useful in comparing FP numbers. ie: abs(a-b)<EPSILON
// Function: Cpi()
// Status: DEPRECATED, use `PI` instead.
// Description:
// Returns the value of pi.
function Cpi() = PI; // Deprecated! Use the variable PI instead.
// Section: Simple Calculations
// Function: quant()
@ -212,22 +204,6 @@ function lerp(a,b,u) = (1-u)*a + u*b;
function hypot(x,y,z=0) = norm([x,y,z]);
// Function: hypot3()
// Status: DEPRECATED, use `norm([x,y,z])` instead.
// Description: Calculate hypotenuse length of 3D triangle.
// Arguments:
// x = Length on the X axis.
// y = Length on the Y axis.
// z = Length on the Z axis.
function hypot3(x,y,z) = norm([x,y,z]);
// Function: distance()
// Status: DEPRECATED, use `norm(p2-p1)` instead. It's shorter.
// Description: Returns the distance between a pair of 2D or 3D points.
function distance(p1, p2) = norm(point3d(p2)-point3d(p1));
// Function: sinh()
// Description: Takes a value `x`, and returns the hyperbolic sine of it.
function sinh(x) = (exp(x)-exp(-x))/2;
@ -436,14 +412,6 @@ function count_true(l, nmax=undef, i=0, cnt=0) =
// Section: List/Array Operations
// Function: cdr()
// Status: DEPRECATED, use `slice(list,1,-1)` instead.
// Description: Returns all but the first item of a given array.
// Arguments:
// list = The list to get the tail of.
function cdr(list) = len(list)<=1? [] : [for (i=[1:len(list)-1]) list[i]];
// Function: replist()
// Usage:
// replist(val, n)
@ -498,23 +466,6 @@ function slice(arr,st,end) = let(
) (s==e)? [] : [for (i=[s:e-1]) if (e>s) arr[i]];
// Function: wrap_range()
// Status: DEPRECATED, use `select()` instead.
// Description:
// Returns a portion of a list, wrapping around past the beginning, if end<start.
// The first item is index 0. Negative indexes are counted back from the end.
// The last item is -1. If only the `start` index is given, returns just the value
// at that position.
// Usage:
// wrap_range(list,start)
// wrap_range(list,start,end)
// Arguments:
// list = The list to get the portion of.
// start = The index of the first item.
// end = The index of the last item.
function wrap_range(list, start, end=undef) = select(list,start,end);
// Function: select()
// Description:
// Returns a portion of a list, wrapping around past the beginning, if end<start.
@ -920,30 +871,6 @@ function vabs(v) = [for (x=v) abs(x)];
function normalize(v) = v/norm(v);
// Function: vector2d_angle()
// Status: DEPRECATED, use `vector_angle()` instead.
// Usage:
// vector2d_angle(v1,v2);
// Description:
// Returns angle in degrees between two 2D vectors.
// Arguments:
// v1 = First 2D vector.
// v2 = Second 2D vector.
function vector2d_angle(v1,v2) = vector_angle(v1,v2);
// Function: vector3d_angle()
// Status: DEPRECATED, use `vector_angle()` instead.
// Usage:
// vector3d_angle(v1,v2);
// Description:
// Returns angle in degrees between two 3D vectors.
// Arguments:
// v1 = First 3D vector.
// v2 = Second 3D vector.
function vector3d_angle(v1,v2) = vector_angle(v1,v2);
// Function: vector_angle()
// Usage:
// vector_angle(v1,v2);
@ -1104,22 +1031,6 @@ function rotate_points3d(pts, v=0, cp=[0,0,0], axis=undef, from=undef, to=undef,
// Function: rotate_points3d_around_axis()
// Status: DEPRECATED, use `rotate_points3d(pts, v=ang, axis=u, cp=cp)` instead.
// Usage:
// rotate_points3d_around_axis(pts, ang, u, [cp])
// Description:
// Rotates each 3D point in an array by a given amount, around a given centerpoint and axis.
// Arguments:
// pts = List of 3D points to rotate.
// ang = Angle to rotate by.
// u = Vector of the axis to rotate around.
// cp = 3D Centerpoint to rotate around.
function rotate_points3d_around_axis(pts, ang, u=[0,0,0], cp=[0,0,0]) = let(
m = matrix4_rot_by_axis(u, ang)
) [for (pt = pts) m*concat(point3d(pt)-cp, 0)+cp];
// Section: Coordinate Systems
// Function: polar_to_xy()

View file

@ -207,60 +207,6 @@ module cuboid(
// Module: cube2pt()
// Status: DEPRECATED, use `cuboid(p1,p2)` instead.
//
// Usage:
// cube2pt(p1,p2)
//
// Description:
// Creates a cube between two points.
//
// Arguments:
// p1 = Coordinate point of one cube corner.
// p2 = Coordinate point of opposite cube corner.
module cube2pt(p1,p2) {
deprecate("cube2pt()", "cuboid(p1,p2)");
cuboid(p1=p1, p2=p2) children();
}
// Module: span_cube()
//
// Description:
// Creates a cube that spans the X, Y, and Z ranges given.
//
// Arguments:
// xspan = [min, max] X axis range.
// yspan = [min, max] Y axis range.
// zspan = [min, max] Z axis range.
//
// Example:
// span_cube([0,15], [5,10], [0, 10]);
module span_cube(xspan, yspan, zspan) {
span = [xspan, yspan, zspan];
cuboid(p1=array_subindex(span,0), p2=array_subindex(span,1)) children();
}
// Module: offsetcube()
// Status: DEPRECATED, use `cuboid(..., align)` instead.
//
// Description:
// Makes a cube that is offset along the given vector by half the cube's size.
// For example, if `v=[-1,1,0]`, the cube's front right edge will be centered at the origin.
//
// Arguments:
// size = size of cube.
// v = vector to offset along.
module offsetcube(size=[1,1,1], v=[0,0,0]) {
deprecate("offsetcube()", "cuboid()");
cuboid(size=size, align=v) children();
}
// Module: leftcube()
//
// Description:
@ -357,67 +303,6 @@ module downcube(size=[1,1,1]) {siz = scalar_vec3(size); down(siz[2]/2) cube(size
module upcube(size=[1,1,1]) {siz = scalar_vec3(size); up(siz[2]/2) cube(size=size, center=true);}
// Module: chamfcube()
// Status: DEPRECATED, use `cuboid(..., chamfer, edges, trimcorners)` instead.
//
// Description:
// Makes a cube with chamfered edges.
//
// Arguments:
// size = Size of cube [X,Y,Z]. (Default: `[1,1,1]`)
// chamfer = Chamfer inset along axis. (Default: `0.25`)
// chamfaxes = Array [X,Y,Z] of boolean values to specify which axis edges should be chamfered.
// chamfcorners = Boolean to specify if corners should be flat chamferred.
module chamfcube(size=[1,1,1], chamfer=0.25, chamfaxes=[1,1,1], chamfcorners=false) {
deprecate("chamfcube()", "cuboid()");
cuboid(
size=size,
chamfer=chamfer,
trimcorners=chamfcorners,
edges = (
(chamfaxes[0]? EDGES_X_ALL : EDGES_NONE) +
(chamfaxes[1]? EDGES_Y_ALL : EDGES_NONE) +
(chamfaxes[2]? EDGES_Z_ALL : EDGES_NONE)
)
) children();
}
// Module: rrect()
// Status: DEPRECATED, use `cuboid(..., fillet, edges)` instead.
//
// Description:
// Makes a cube with rounded (filletted) vertical edges. The `r` size will be
// limited to a maximum of half the length of the shortest XY side.
//
// Arguments:
// size = Size of cube [X,Y,Z]. (Default: `[1,1,1]`)
// r = Radius of edge/corner rounding. (Default: `0.25`)
// center = If true, object will be centered. If false, sits on top of XY plane.
module rrect(size=[1,1,1], r=0.25, center=false) {
deprecate("rrect()", "cuboid()");
cuboid(size=size, fillet=r, edges=EDGES_Z_ALL, align=center? V_CENTER : V_UP) children();
}
// Module: rcube()
// Status: DEPRECATED, use `cuboid(..., fillet)` instead.
//
// Description:
// Makes a cube with rounded (filletted) edges and corners. The `r` size will be
// limited to a maximum of half the length of the shortest cube side.
//
// Arguments:
// size = Size of cube [X,Y,Z]. (Default: `[1,1,1]`)
// r = Radius of edge/corner rounding. (Default: `0.25`)
// center = If true, object will be centered. If false, sits on top of XY plane.
module rcube(size=[1,1,1], r=0.25, center=false) {
deprecate("rcube()", "cuboid()");
cuboid(size=size, fillet=r, align=center? V_CENTER : V_UP) children();
}
// Section: Prismoids
@ -495,29 +380,6 @@ module prismoid(
}
// Module: trapezoid()
// Status: DEPRECATED, use `prismoid()` instead.
//
// Description:
// Creates a rectangular prismoid shape.
//
// Usage:
// trapezoid(size1, size2, h, [shift], [orient], [align|center]);
//
// Arguments:
// size1 = [width, length] of the axis-negative end of the prism.
// size2 = [width, length] of the axis-positive end of the prism.
// h = Height of the prism.
// shift = [x, y] amount to shift the center of the top with respect to the center of the bottom.
// orient = Orientation of the prismoid. Use the `ORIENT_` constants from `constants.scad`. Default: `ORIENT_Z`.
// align = Alignment of the prismoid by the axis-negative (size1) end. Use the `V_` constants from `constants.scad`. Default: `V_UP`
// center = If given, overrides `align`. A true value sets `align=V_CENTER`, false sets `align=V_UP`.
module trapezoid(size1=[1,1], size2=[1,1], h=1, center=false) {
deprecate("trapezoid()", "prismoid()");
prismoid(size=size, size2=size2, h=h, center=center) children();
}
// Module: rounded_prismoid()
//
// Description:
@ -579,54 +441,6 @@ module rounded_prismoid(
// Module: pyramid()
// Status: DEPRECATED, use `cyl(, r2=0, $fn=N)` instead.
//
// Usage:
// pyramid(n, h, l|r|d, [circum]);
//
// Description:
// Creates a pyramidal prism with a given number of sides.
//
// Arguments:
// n = number of pyramid sides.
// h = height of the pyramid.
// l = length of one side of the pyramid. (optional)
// r = radius of the base of the pyramid. (optional)
// d = diameter of the base of the pyramid. (optional)
// circum = base circumscribes the circle of the given radius or diam.
module pyramid(n=4, h=1, l=1, r=undef, d=undef, circum=false)
{
deprecate("pyramid()", "cyl()");
radius = get_radius(r=r, d=d, dflt=l/2/sin(180/n));
cyl(r1=radius, r2=0, l=h, circum=circum, $fn=n, realign=true, align=ALIGN_POS) children();
}
// Module: prism()
// Status: DEPRECATED, use `cyl(..., $fn=N)` instead.
//
// Usage:
// prism(n, h, l|r|d, [circum]);
//
// Description:
// Creates a vertical prism with a given number of sides.
//
// Arguments:
// n = number of sides.
// h = height of the prism.
// l = length of one side of the prism. (optional)
// r = radius of the prism. (optional)
// d = diameter of the prism. (optional)
// circum = prism circumscribes the circle of the given radius or diam.
module prism(n=3, h=1, l=1, r=undef, d=undef, circum=false, center=false)
{
deprecate("prism()", "cyl()");
radius = get_radius(r=r, d=d, dflt=l/2/sin(180/n));
cyl(r=radius, l=h, circum=circum, $fn=n, realign=true, center=center) children();
}
// Module: right_triangle()
//
// Description:
@ -1058,101 +872,6 @@ module zcyl(l=undef, r=undef, d=undef, r1=undef, r2=undef, d1=undef, d2=undef, h
// Module: chamferred_cylinder()
// Status: DEPRECATED, use `cyl(..., chamfer)` instead.
//
// Usage:
// chamferred_cylinder(h, r|d, chamfer|chamfedge, [top], [bottom], [center])
//
// Description:
// Creates a cylinder with chamferred (bevelled) edges.
//
// Arguments:
// h = height of cylinder. (Default: 1.0)
// r = radius of cylinder. (Default: 1.0)
// d = diameter of cylinder. (use instead of r)
// chamfer = radial inset of the edge chamfer. (Default: 0.25)
// chamfedge = length of the chamfer edge. (Use instead of chamfer)
// top = boolean. If true, chamfer the top edges. (Default: True)
// bottom = boolean. If true, chamfer the bottom edges. (Default: True)
// center = boolean. If true, cylinder is centered. (Default: false)
module chamferred_cylinder(h=1, r=undef, d=undef, chamfer=0.25, chamfedge=undef, angle=45, center=false, top=true, bottom=true)
{
deprecate("chamf_cyl()` and `chamferred_cylinder()", "cyl()");
r = get_radius(r=r, d=d, dflt=1);
chamf = (chamfedge == undef)? chamfer : chamfedge * cos(angle);
cyl(l=h, r=r, chamfer1=bottom? chamf : 0, chamfer2=top? chamf : 0, chamfang=angle, center=center) children();
}
// Module: chamf_cyl()
// Status: DEPRECATED, use `cyl(..., chamfer)` instead.
//
// Usage:
// chamf_cyl(h, r|d, chamfer|chamfedge, [top], [bottom], [center])
//
// Description:
// Creates a cylinder with chamferred (bevelled) edges. Basically a shortcut of `chamferred_cylinder()`
//
// Arguments:
// h = height of cylinder. (Default: 1.0)
// r = radius of cylinder. (Default: 1.0)
// d = diameter of cylinder. (use instead of r)
// chamfer = radial inset of the edge chamfer. (Default: 0.25)
// chamfedge = length of the chamfer edge. (Use instead of chamfer)
// top = boolean. If true, chamfer the top edges. (Default: True)
// bottom = boolean. If true, chamfer the bottom edges. (Default: True)
// center = boolean. If true, cylinder is centered. (Default: false)
module chamf_cyl(h=1, r=undef, d=undef, chamfer=0.25, chamfedge=undef, angle=45, center=false, top=true, bottom=true)
chamferred_cylinder(h=h, r=r, d=d, chamfer=chamfer, chamfedge=chamfedge, angle=angle, center=center, top=top, bottom=bottom) children();
// Module: filleted_cylinder()
// Status: DEPRECATED, use `cyl(..., fillet)` instead.
//
// Usage:
// filleted_cylinder(h, r|d, fillet, [center]);
//
// Description:
// Creates a cylinder with filletted (rounded) ends.
//
// Arguments:
// h = height of cylinder. (Default: 1.0)
// r = radius of cylinder. (Default: 1.0)
// d = diameter of cylinder. (Use instead of r)
// fillet = radius of the edge filleting. (Default: 0.25)
// center = boolean. If true, cylinder is centered. (Default: false)
module filleted_cylinder(h=1, r=undef, d=undef, r1=undef, r2=undef, d1=undef, d2=undef, fillet=0.25, center=false) {
deprecate("filleted_cylinder()", "cyl()");
cyl(l=h, r=r, d=d, r1=r1, r2=r2, d1=d1, d2=d2, fillet=fillet, orient=ORIENT_Z, center=center) children();
}
// Module: rcylinder()
// Status: DEPRECATED, use `cyl(..., fillet)` instead.
//
// Usage:
// rcylinder(h, r|d, fillet, [center]);
//
// Description:
// Creates a cylinder with filletted (rounded) ends.
// Basically a shortcut for `filleted_cylinder()`.
//
// Arguments:
// h = height of cylinder. (Default: 1.0)
// r = radius of cylinder. (Default: 1.0)
// d = diameter of cylinder. (Use instead of r)
// fillet = radius of the edge filleting. (Default: 0.25)
// center = boolean. If true, cylinder is centered. (Default: false)
module rcylinder(h=1, r=1, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, fillet=0.25, center=false) {
deprecate("rcylinder()", "cyl(..., fillet)");
cyl(l=h, r=r, d=d, r1=r1, r2=r2, d1=d1, d2=d2, fillet=fillet, orient=ORIENT_Z, center=center) children();
}
// Module: tube()
//
// Description:
@ -1788,31 +1507,6 @@ module thinning_triangle(h=50, l=100, thick=5, ang=30, strut=5, wall=3, diagonly
}
// Module: thinning_brace()
// Status: DEPRECATED, use `thinning_triangle(..., diagonly=true)` instead.
//
// Description:
// Makes a triangular wall which thins to a smaller width in the center,
// with angled supports to prevent critical overhangs. Basically an alias
// of thinning_triangle(), with diagonly=true.
//
// Usage:
// thinning_brace(h, l, thick, [ang], [strut], [wall], [center])
//
// Arguments:
// h = height of wall.
// l = length of wall.
// thick = thickness of wall.
// ang = maximum overhang angle of diagonal brace.
// strut = the width of the diagonal brace.
// wall = the thickness of the thinned portion of the wall.
module thinning_brace(h=50, l=100, thick=5, ang=30, strut=5, wall=3, center=true)
{
deprecate("thinning_brace()", "thinning_triangle(..., diagonly=true)");
thinning_triangle(h=h, l=l, thick=thick, ang=ang, strut=strut, wall=wall, diagonly=true, center=center) children();
}
// Module: sparse_strut()
//
// Description:

View file

@ -604,51 +604,6 @@ module place_copies(a=[[0,0,0]])
}
// Module: translate_copies()
// Status: DEPRECATED, use `place_copies()` instead.
//
// Description:
// Makes copies of the given children at each of the given offsets.
//
// Usage:
// translate_copies(a) ...
//
// Arguments:
// a = array of XYZ offset vectors. Default [[0,0,0]]
//
// Side Effects:
// `$pos` is set to the relative centerpoint of each child copy, and can be used to modify each child individually.
module translate_copies(a=[[0,0,0]])
{
deprecate("translate_copies()", "place_copies()");
place_copies(a) children();
}
// Module: line_of()
// Status: DEPRECATED, use `spread(p1,p2)` instead
//
// Description:
// Evenly distributes n duplicate children along an XYZ line.
//
// Usage:
// line_of(p1, p2, [n]) ...
//
// Arguments:
// p1 = starting point of line. (Default: [0,0,0])
// p2 = ending point of line. (Default: [10,0,0])
// n = number of copies to distribute along the line. (Default: 2)
//
// Side Effects:
// `$pos` is set to the relative centerpoint of each child copy, and can be used to modify each child individually.
module line_of(p1=[0,0,0], p2=[10,0,0], n=2)
{
deprecate("line_of()", "spread()");
spread(p1=p1, p2=p2, n=n) children();
}
// Module: spread()
//
// Description:
@ -1172,35 +1127,6 @@ module grid3d(xa=[0], ya=[0], za=[0], n=undef, spacing=undef)
// Module: grid_of()
// Status: DEPRECATED, use `grid3d()` instead.
//
// Description:
// Makes a 3D grid of duplicate children.
//
// Usage:
// grid_of(n, spacing) ...
// grid_of(n=[Xn,Yn,Zn], spacing=[dX,dY,dZ]) ...
// grid_of([xa], [ya], [za]) ...
//
// Arguments:
// xa = array or range of X-axis values to offset by. (Default: [0])
// ya = array or range of Y-axis values to offset by. (Default: [0])
// za = array or range of Z-axis values to offset by. (Default: [0])
// n = Optional number of copies to have per axis.
// spacing = spacing of copies per axis. Use with `n`.
//
// Side Effect:
// `$pos` is set to the relative centerpoint of each child copy, and can be used to modify each child individually.
// `$idx` is set to the [Xidx,Yidx,Zidx] index values of each child copy, when using `count` and `n`.
module grid_of(xa=[0], ya=[0], za=[0], count=undef, spacing=undef)
{
deprecate("grid_of()", "grid3d()");
grid3d(xa=xa, ya=ya, za=za, n=count, spacing=spacing) children();
}
//////////////////////////////////////////////////////////////////////
// Section: Rotational Distributors
//////////////////////////////////////////////////////////////////////