mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-09 11:56:39 +02:00
Fixed named anchors for reuleaux_polygon()
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
// Helpers to make debugging OpenScad code easier.
|
// Helpers to make debugging OpenScad code easier.
|
||||||
// Includes:
|
// Includes:
|
||||||
// include <BOSL2/std.scad>
|
// include <BOSL2/std.scad>
|
||||||
// include <BOSL2/debug.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):
|
// Examples(2D):
|
||||||
// reuleaux_polygon(N=3, r=50);
|
// reuleaux_polygon(N=3, r=50);
|
||||||
// reuleaux_polygon(N=5, d=100);
|
// 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) {
|
module reuleaux_polygon(N=3, r, d, anchor=CENTER, spin=0) {
|
||||||
assert(N>=3 && (N%2)==1);
|
assert(N>=3 && (N%2)==1);
|
||||||
r = get_radius(r=r, d=d, dflt=1);
|
r = get_radius(r=r, d=d, dflt=1);
|
||||||
path = reuleaux_polygon(N=N, r=r);
|
path = reuleaux_polygon(N=N, r=r);
|
||||||
anchors = [
|
anchors = [
|
||||||
for (i = [0:1:N-1]) let(
|
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)
|
cp = polar_to_xy(r, ca)
|
||||||
) anchorpt(str("tip",i), cp, unit(cp,BACK), 0),
|
) 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 = [
|
anchors = [
|
||||||
for (i = [0:1:N-1]) let(
|
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)
|
cp = polar_to_xy(r, ca)
|
||||||
) anchorpt(str("tip",i), cp, unit(cp,BACK), 0),
|
) anchorpt(str("tip",i), cp, unit(cp,BACK), 0),
|
||||||
]
|
]
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
BOSL_VERSION = [2,0,523];
|
BOSL_VERSION = [2,0,524];
|
||||||
|
|
||||||
|
|
||||||
// Section: BOSL Library Version Functions
|
// Section: BOSL Library Version Functions
|
||||||
|
Reference in New Issue
Block a user