Make square() have compatable positional parameters with built-in.

This commit is contained in:
Revar Desmera 2020-03-04 20:19:21 -08:00
parent ee30513644
commit 9c350feb11
2 changed files with 4 additions and 4 deletions

View file

@ -43,7 +43,7 @@
// path = square([40,30], chamfer=5, anchor=FRONT, spin=30);
// stroke(path, closed=true);
// place_copies(path) color("blue") circle(d=2,$fn=8);
module square(size=1, rounding=0, chamfer=0, center, anchor, spin=0) {
module square(size=1, center, rounding=0, chamfer=0, anchor, spin=0) {
size = is_num(size)? [size,size] : point2d(size);
anchor = get_anchor(anchor, center, FRONT+LEFT, FRONT+LEFT);
pts = square(size=size, rounding=rounding, chamfer=chamfer, center=false);
@ -54,7 +54,7 @@ module square(size=1, rounding=0, chamfer=0, center, anchor, spin=0) {
}
function square(size=1, rounding=0, chamfer=0, center, anchor, spin=0) =
function square(size=1, center, rounding=0, chamfer=0, anchor, spin=0) =
assert(is_num(size) || is_vector(size))
assert(is_num(chamfer) || len(chamfer)==4)
assert(is_num(rounding) || len(rounding)==4)
@ -102,7 +102,7 @@ function square(size=1, rounding=0, chamfer=0, center, anchor, spin=0) =
// Function&Module: circle()
// Usage:
// circle(r|d, [anchor])
// circle(r|d, [realign], [circum])
// Description:
// When called as a module, creates a 2D polygon that approximates a circle of the given size.
// When called as a function, returns a 2D list of points (path) for a polygon that approximates a circle of the given size.

View file

@ -8,7 +8,7 @@
//////////////////////////////////////////////////////////////////////
BOSL_VERSION = [2,0,153];
BOSL_VERSION = [2,0,154];
// Section: BOSL Library Version Functions