From 34ce1c203f69a1d11d21fd9d9cf892046673de46 Mon Sep 17 00:00:00 2001 From: Garth Minette Date: Tue, 12 Jan 2021 00:01:03 -0800 Subject: [PATCH 1/2] Fixed named anchors for reuleaux_polygon() --- debug.scad | 1 - shapes2d.scad | 8 ++++++-- version.scad | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/debug.scad b/debug.scad index 9dbcf72..e4cd754 100644 --- a/debug.scad +++ b/debug.scad @@ -3,7 +3,6 @@ // Helpers to make debugging OpenScad code easier. // Includes: // include -// include ////////////////////////////////////////////////////////////////////// diff --git a/shapes2d.scad b/shapes2d.scad index baee3ff..18a4133 100644 --- a/shapes2d.scad +++ b/shapes2d.scad @@ -1608,13 +1608,17 @@ module supershape(step=0.5,m1=4,m2=undef,n1,n2=undef,n3=undef,a=1,b=undef, r=und // Examples(2D): // reuleaux_polygon(N=3, r=50); // reuleaux_polygon(N=5, d=100); +// Examples(2D): Standard vector anchors are based on extents +// reuleaux_polygon(N=3, d=50) show_anchors(custom=false); +// Examples(2D): Named anchors exist for the tips +// reuleaux_polygon(N=3, d=50) show_anchors(std=false); module reuleaux_polygon(N=3, r, d, anchor=CENTER, spin=0) { assert(N>=3 && (N%2)==1); r = get_radius(r=r, d=d, dflt=1); path = reuleaux_polygon(N=N, r=r); anchors = [ for (i = [0:1:N-1]) let( - ca = 360 - (i+0.5) * 360/N, + ca = 360 - i * 360/N, cp = polar_to_xy(r, ca) ) anchorpt(str("tip",i), cp, unit(cp,BACK), 0), ]; @@ -1641,7 +1645,7 @@ function reuleaux_polygon(N=3, r, d, anchor=CENTER, spin=0) = ], anchors = [ for (i = [0:1:N-1]) let( - ca = 360 - (i+0.5) * 360/N, + ca = 360 - i * 360/N, cp = polar_to_xy(r, ca) ) anchorpt(str("tip",i), cp, unit(cp,BACK), 0), ] diff --git a/version.scad b/version.scad index 014b31b..df74293 100644 --- a/version.scad +++ b/version.scad @@ -6,7 +6,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,523]; +BOSL_VERSION = [2,0,524]; // Section: BOSL Library Version Functions From a1755d0a370cae558bca74199c9d6d99422e82b8 Mon Sep 17 00:00:00 2001 From: Garth Minette Date: Tue, 12 Jan 2021 00:09:39 -0800 Subject: [PATCH 2/2] Docs usage correction for reuleaux_polygon() --- shapes2d.scad | 2 +- version.scad | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shapes2d.scad b/shapes2d.scad index 18a4133..35d1387 100644 --- a/shapes2d.scad +++ b/shapes2d.scad @@ -1593,7 +1593,7 @@ module supershape(step=0.5,m1=4,m2=undef,n1,n2=undef,n3=undef,a=1,b=undef, r=und // Function&Module: reuleaux_polygon() // Usage: As Module // reuleaux_polygon(N, r|d); -// Usage: As Module +// Usage: As Function // path = reuleaux_polygon(N, r|d); // Description: // Creates a 2D Reuleaux Polygon; a constant width shape that is not circular. diff --git a/version.scad b/version.scad index df74293..0f0b646 100644 --- a/version.scad +++ b/version.scad @@ -6,7 +6,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,524]; +BOSL_VERSION = [2,0,525]; // Section: BOSL Library Version Functions