diff --git a/debug.scad b/debug.scad index c2568c9b..a38a6900 100644 --- a/debug.scad +++ b/debug.scad @@ -301,6 +301,22 @@ module anchor_arrow(s=10, color=[0.333,0.333,1], flag=true, $tags="anchor-arrow" +// Module: anchor_arrow2d() +// Usage: +// anchor_arrow2d([s], [color], [flag]); +// Description: +// Show an anchor orientation arrow. +// Arguments: +// s = Length of the arrows. +// color = Color of the arrow. +// Example: +// anchor_arrow2d(s=20); +module anchor_arrow2d(s=15, color=[0.333,0.333,1], $tags="anchor-arrow") { + noop() stroke([[0,0],[0,s]], width=s/10, endcap1="butt", endcap2="arrow2"); +} + + + // Module: show_internal_anchors() // Usage: // show_internal_anchors() ... diff --git a/mutators.scad b/mutators.scad index f704bdc8..80b9752a 100644 --- a/mutators.scad +++ b/mutators.scad @@ -27,15 +27,15 @@ // translate([10,8,4]) cube(5); // translate([3,0,12]) cube(2); module bounding_box(excess=0) { - xs = excess>0? excess : 1; + xs = excess>.1? excess : 1; // a 3D approx. of the children projection on X axis module _xProjection() linear_extrude(xs, center=true) - hull() - projection() - rotate([90,0,0]) - linear_extrude(xs, center=true) - projection() + projection() + rotate([90,0,0]) + linear_extrude(xs, center=true) + projection() + hull() children(); // a bounding box with an offset of 1 in all axis @@ -50,13 +50,13 @@ module bounding_box(excess=0) { // offset children() (a cube) by -1 in all axis module _shrink_cube() { intersection() { - translate([ 1, 1, 1]) children(); - translate([-1,-1,-1]) children(); + translate((1-excess)*[ 1, 1, 1]) children(); + translate((1-excess)*[-1,-1,-1]) children(); } } render(convexity=2) - if (excess>0) { + if (excess>.1) { _oversize_bbox() children(); } else { _shrink_cube() _oversize_bbox() children(); @@ -674,7 +674,7 @@ module minkowski_difference() { bounding_box(excess=1) children(0); children(0); } - for (i=[1,1,$children-1]) children(i); + for (i=[1:1:$children-1]) children(i); } } } diff --git a/version.scad b/version.scad index 76088b4e..e533b27d 100644 --- a/version.scad +++ b/version.scad @@ -8,7 +8,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,480]; +BOSL_VERSION = [2,0,482]; // Section: BOSL Library Version Functions