From 17efb079d90f5bb8a8f9e5bd56c982cd5733e025 Mon Sep 17 00:00:00 2001 From: Garth Minette Date: Tue, 16 Mar 2021 14:46:11 -0700 Subject: [PATCH] Fixes for various example bugs. --- attachments.scad | 4 ++-- linear_bearings.scad | 2 +- masks.scad | 2 +- partitions.scad | 2 +- shapes2d.scad | 1 + 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/attachments.scad b/attachments.scad index c962f05..04d8a17 100644 --- a/attachments.scad +++ b/attachments.scad @@ -1072,8 +1072,8 @@ module attach(from, to, overlap, norot=false) // Example: // diff("mask") // cube([50,60,70],center=true) -// face_profile(TOP,except=TOP+LEFT) -// mask2d_roundover(r=10, inset=2); +// face_profile(TOP,r=10) +// mask2d_roundover(r=10); module face_profile(faces=[], r, d, convexity=10) { faces = is_vector(faces)? [faces] : faces; assert(all([for (face=faces) is_vector(face) && sum([for (x=face) x!=0? 1 : 0])==1]), "Vector in faces doesn't point at a face."); diff --git a/linear_bearings.scad b/linear_bearings.scad index 1fc5047..cd7b7d2 100644 --- a/linear_bearings.scad +++ b/linear_bearings.scad @@ -112,7 +112,7 @@ module linear_bearing_housing(d=15, l=24, tab=7, gap=5, wall=3, tabwall=5, screw up(tabh) { // Screwhole - fwd(ogap/2-2+0.01) screw(screwsize=screwsize*1.06, screwlen=ogap, headsize=screwsize*2, headlen=10, orient=FWD); + fwd(ogap/2-2+0.01) generic_screw(screwsize=screwsize*1.06, screwlen=ogap, headsize=screwsize*2, headlen=10, orient=FWD); // Nut holder back(ogap/2-2+0.01) metric_nut(size=screwsize, hole=false, anchor=BOTTOM, orient=BACK); diff --git a/masks.scad b/masks.scad index ba36ae7..406947d 100644 --- a/masks.scad +++ b/masks.scad @@ -841,7 +841,7 @@ module teardrop_corner_mask(r, angle, excess=0.1, d, anchor=CENTER, spin=0, orie r = get_radius(r=r, d=d, dflt=1); difference() { translate(-[1,1,1]*excess) cube(r+excess, center=false); - translate([1,1,1]*r) onion(r=r,maxang=angle,orient=DOWN); + translate([1,1,1]*r) onion(r=r, ang=angle, orient=DOWN); } } diff --git a/partitions.scad b/partitions.scad index 7ef55e7..2e516a0 100644 --- a/partitions.scad +++ b/partitions.scad @@ -128,7 +128,7 @@ module partition_cut_mask(l=100, h=100, cutsize=10, cutpath=undef, gap=0, spin=0 rot(from=UP,to=orient) { rotate(spin) { linear_extrude(height=h, convexity=10) { - stroke(path, width=$slop*2); + stroke(path, width=max(0.1, $slop*2)); } } } diff --git a/shapes2d.scad b/shapes2d.scad index a9b2d24..16cd306 100644 --- a/shapes2d.scad +++ b/shapes2d.scad @@ -168,6 +168,7 @@ module stroke( assert(is_num(width) || (is_vector(width) && len(width)==len(path))); width = is_num(width)? [for (x=path) width] : width; + assert(all([for (w=width) w>0])); endcap1 = first_defined([endcap1, endcaps, if(!closed) plots, "round"]); endcap2 = first_defined([endcap2, endcaps, plots, "round"]);