From 8c2502dbf827413bc51165d3dcbf31e0f42f80f8 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 20 Feb 2021 04:50:18 +0000 Subject: [PATCH 1/6] Bump release version. --- version.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.scad b/version.scad index aa90602..2234cd5 100644 --- a/version.scad +++ b/version.scad @@ -6,7 +6,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,562]; +BOSL_VERSION = [2,0,563]; // Section: BOSL Library Version Functions From 852eed292d7cf889a76dca6e58287747cf94b739 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Sat, 20 Feb 2021 11:45:10 -0500 Subject: [PATCH 2/6] doc fixes and bug fixes for undef --- regions.scad | 4 +++- rounding.scad | 14 ++++++++------ skin.scad | 9 ++++----- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/regions.scad b/regions.scad index 7eee696..15aa560 100644 --- a/regions.scad +++ b/regions.scad @@ -700,7 +700,9 @@ function offset( outsidecorner = len(sharpcorners)==2 ? [false,false] : [for(i=[0:len(goodsegs)-1]) - let(prevseg=select(goodsegs,i-1)) + let(prevseg=select(goodsegs,i-1)) + i==0 && !closed ? false // In open case first entry is bogus + : (goodsegs[i][1]-goodsegs[i][0]) * (goodsegs[i][0]-sharpcorners[i]) > 0 && (prevseg[1]-prevseg[0]) * (sharpcorners[i]-prevseg[1]) > 0 ], diff --git a/rounding.scad b/rounding.scad index d77caa5..f3a94a5 100644 --- a/rounding.scad +++ b/rounding.scad @@ -375,9 +375,11 @@ function _rounding_offsets(edgespec,z_dir=1) = r = struct_val(edgespec,"r"), cut = struct_val(edgespec,"cut"), k = struct_val(edgespec,"k"), - radius = in_list(edgetype,["circle","teardrop"])? - (is_def(cut) ? cut/(sqrt(2)-1) : r) : - edgetype=="chamfer"? first_defined([sqrt(2)*cut,r]) : undef, + radius = in_list(edgetype,["circle","teardrop"]) + ? (is_def(cut) ? cut/(sqrt(2)-1) : r) + :edgetype=="chamfer" + ? (is_def(cut) ? sqrt(2)*cut : r) + : undef, chamf_angle = struct_val(edgespec, "angle"), cheight = struct_val(edgespec, "chamfer_height"), cwidth = struct_val(edgespec, "chamfer_width"), @@ -785,9 +787,9 @@ function _path_join(paths,joint,k=0.5,i=0,result=[],relocate=true,closed=false) // triangle = [[0,0],[10,0],[5,10]]; // offset_sweep(triangle, height=6, bottom = os_circle(r=-2),steps=16,offset_maxstep=0.01); // Example: Here is the star chamfered at the top with a teardrop rounding at the bottom. Check out the rounded corners on the chamfer. Note that a very small value of `offset_maxstep` is needed to keep these round. Observe how the rounded star points vanish at the bottom in the teardrop: the number of vertices does not remain constant from layer to layer. -// star = star(5, r=22, ir=13); -// rounded_star = round_corners(star, cut=flatten(repeat([.5,0],5)), $fn=24); -// offset_sweep(rounded_star, height=20, bottom=os_teardrop(r=4), top=os_chamfer(width=4,offset_maxstep=.1)); +// star = star(5, r=22, ir=13); +// rounded_star = round_corners(star, cut=flatten(repeat([.5,0],5)), $fn=24); +// offset_sweep(rounded_star, height=20, bottom=os_teardrop(r=4), top=os_chamfer(width=4,offset_maxstep=.1)); // Example: We round a cube using the continous curvature rounding profile. But note that the corners are not smooth because the curved square collapses into a square with corners. When a collapse like this occurs, we cannot turn `check_valid` off. // square = square(1); // rsquare = round_corners(square, method="smooth", cut=0.1, k=0.7, $fn=36); diff --git a/skin.scad b/skin.scad index e8faf66..0351317 100644 --- a/skin.scad +++ b/skin.scad @@ -802,8 +802,7 @@ function associate_vertices(polygons, split, curpoly=0) = curpoly==len(polygons)-1 ? polygons : let( polylen = len(polygons[curpoly]), - cursplit = force_list(split[curpoly]), - fdsa= echo(cursplit=cursplit) + cursplit = force_list(split[curpoly]) ) assert(len(split)==len(polygons)-1,str(split,"Split list length mismatch: it has length ", len(split)," but must have length ",len(polygons)-1)) assert(polylen<=len(polygons[curpoly+1]),str("Polygon ",curpoly," has more vertices than the next one.")) @@ -1143,7 +1142,7 @@ module sweep(shape, transforms, closed=false, caps, convexity=10, // ushape = [[-10, 0],[-10, 10],[ -7, 10],[ -7, 2],[ 7, 2],[ 7, 7],[ 10, 7],[ 10, 0]]; // path_sweep(ushape, knot_path, closed=true, method="natural"); // Example: knot with twist. Note if you twist it the other direction the center section untwists because of the natural twist there. Also compare to the "incremental" method which has less twist in the center. -// function knot(a,b,t) = // rolling knot +// function knot(a,b,t) = // rolling knot // [ a * cos (3 * t) / (1 - b* sin (2 *t)), // a * sin( 3 * t) / (1 - b* sin (2 *t)), // 1.8 * b * cos (2 * t) /(1 - b* sin (2 *t))]; @@ -1169,7 +1168,7 @@ module sweep(shape, transforms, closed=false, caps, convexity=10, // points = 50; // points per loop // R = 400; r = 150; // Torus size // p = 2; q = 5; // Knot parameters -// %torus(r=R,r2=r); +// %torus(r_maj=R,r_min=r); // k = max(p,q) / gcd(p,q) * points; // knot_path = [ for (i=[0:k-1]) knot(360*i/k/gcd(p,q),R,r,p,q) ]; // path_sweep(rot(90,p=ushape),knot_path, method="natural", closed=true); @@ -1186,7 +1185,7 @@ module sweep(shape, transforms, closed=false, caps, convexity=10, // points = 50; // points per loop // R = 400; r = 150; // Torus size // p = 2; q = 5; // Knot parameters -// %torus(r=R,r2=r); +// %torus(r_maj=R,r_min=r); // k = max(p,q) / gcd(p,q) * points; // knot_path = [ for (i=[0:k-1]) knot(360*i/k/gcd(p,q),R,r,p,q) ]; // normals = [ for (i=[0:k-1]) knot_normal(360*i/k/gcd(p,q),R,r,p,q) ]; From 2b7b0b531baea198da7fff2018ef136c857bef08 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Sat, 20 Feb 2021 16:03:49 -0500 Subject: [PATCH 3/6] bug fix for UTS heads --- screws.scad | 86 +++++++++++++++++++++++++++-------------------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/screws.scad b/screws.scad index 9f66a85..bd503a4 100644 --- a/screws.scad +++ b/screws.scad @@ -307,7 +307,9 @@ function _screw_info_english(diam, threadcount, head, thread, drive) = [2, [ 3, 1.5, undef, undef, undef]], ], entry = struct_val(UTS_socket, diam), - hexdepth = is_def(entry[3]) ? entry[3] : if_def(diam) ? diam/2 : undef, + hexdepth = is_def(entry[3]) ? entry[3] + : is_def(diam) ? diam/2 + : undef, drive_size = drive=="hex" ? [["drive_size",inch*entry[1]], ["drive_depth",inch*hexdepth]] : drive=="torx" ? [["drive_size",entry[2]],["drive_depth",inch*entry[4]]] : [] ) @@ -854,47 +856,47 @@ module screw_head(screw_info,details=false) { // screw("M5", head="hex", length=12); // } // Example: Demonstration of all head types for UTS screws (using pitch zero for fast preview) -// xdistribute(spacing=15){ -// ydistribute(spacing=15){ -// screw("1/4", thread=0,length=8, anchor=TOP, head="none", drive="hex"); -// screw("1/4", thread=0,length=8, anchor=TOP, head="none", drive="torx"); -// screw("1/4", thread=0,length=8, anchor=TOP, head="none"); -// } -// screw("1/4", thread=0, length=8, anchor=TOP, head="hex"); -// ydistribute(spacing=15){ -// screw("1/4", thread=0,length=8, anchor=TOP, head="socket", drive="hex"); -// screw("1/4", thread=0,length=8, anchor=TOP, head="socket", drive="torx"); -// screw("1/4", thread=0,length=8, anchor=TOP, head="socket"); -// } -// ydistribute(spacing=15){ -// screw("1/4", thread=0,length=8, anchor=TOP, head="button", drive="hex"); -// screw("1/4", thread=0,length=8, anchor=TOP, head="button", drive="torx"); -// screw("1/4", thread=0,length=8, anchor=TOP, head="button"); -// } -// ydistribute(spacing=15){ -// screw("1/4", thread=0,length=8, anchor=TOP, head="round", drive="slot"); -// screw("1/4", thread=0,length=8, anchor=TOP, head="round", drive="phillips"); -// screw("1/4", thread=0,length=8, anchor=TOP, head="round"); -// } -// ydistribute(spacing=15){ -// screw("1/4", thread=0,length=8, anchor=TOP, head="fillister", drive="slot"); -// screw("1/4", thread=0,length=8, anchor=TOP, head="fillister", drive="phillips"); -// screw("1/4", thread=0,length=8, anchor=TOP, head="fillister"); -// } -// ydistribute(spacing=15){ -// screw("1/4", thread=0,length=8, anchor=TOP, head="flat", drive="slot"); -// screw("1/4", thread=0,length=8, anchor=TOP, head="flat", drive="phillips"); -// screw("1/4", thread=0,length=8, anchor=TOP, head="flat", drive="hex"); -// screw("1/4", thread=0,length=8, anchor=TOP, head="flat", drive="torx"); -// screw("1/4", thread=0,length=8, anchor=TOP, head="flat large"); -// screw("1/4", thread=0,length=8, anchor=TOP, head="flat small"); -// } -// ydistribute(spacing=15){ -// screw("1/4", thread=0,length=8, anchor=TOP, head="flat undercut", drive="slot"); -// screw("1/4", thread=0,length=8, anchor=TOP, head="flat undercut", drive="phillips"); -// screw("1/4", thread=0,length=8, anchor=TOP, head="flat undercut"); -// } -// } + xdistribute(spacing=15){ + ydistribute(spacing=15){ + screw("1/4", thread=0,length=8, anchor=TOP, head="none", drive="hex"); + screw("1/4", thread=0,length=8, anchor=TOP, head="none", drive="torx"); + screw("1/4", thread=0,length=8, anchor=TOP, head="none"); + } + screw("1/4", thread=0, length=8, anchor=TOP, head="hex"); + ydistribute(spacing=15){ + screw("1/4", thread=0,length=8, anchor=TOP, head="socket", drive="hex"); + screw("1/4", thread=0,length=8, anchor=TOP, head="socket", drive="torx"); + screw("1/4", thread=0,length=8, anchor=TOP, head="socket"); + } + ydistribute(spacing=15){ + screw("1/4", thread=0,length=8, anchor=TOP, head="button", drive="hex"); + screw("1/4", thread=0,length=8, anchor=TOP, head="button", drive="torx"); + screw("1/4", thread=0,length=8, anchor=TOP, head="button"); + } + ydistribute(spacing=15){ + screw("1/4", thread=0,length=8, anchor=TOP, head="round", drive="slot"); + screw("1/4", thread=0,length=8, anchor=TOP, head="round", drive="phillips"); + screw("1/4", thread=0,length=8, anchor=TOP, head="round"); + } + ydistribute(spacing=15){ + screw("1/4", thread=0,length=8, anchor=TOP, head="fillister", drive="slot"); + screw("1/4", thread=0,length=8, anchor=TOP, head="fillister", drive="phillips"); + screw("1/4", thread=0,length=8, anchor=TOP, head="fillister"); + } + ydistribute(spacing=15){ + screw("1/4", thread=0,length=8, anchor=TOP, head="flat", drive="slot"); + screw("1/4", thread=0,length=8, anchor=TOP, head="flat", drive="phillips"); + screw("1/4", thread=0,length=8, anchor=TOP, head="flat", drive="hex"); + screw("1/4", thread=0,length=8, anchor=TOP, head="flat", drive="torx"); + screw("1/4", thread=0,length=8, anchor=TOP, head="flat large"); + screw("1/4", thread=0,length=8, anchor=TOP, head="flat small"); + } + ydistribute(spacing=15){ + screw("1/4", thread=0,length=8, anchor=TOP, head="flat undercut", drive="slot"); + screw("1/4", thread=0,length=8, anchor=TOP, head="flat undercut", drive="phillips"); + screw("1/4", thread=0,length=8, anchor=TOP, head="flat undercut"); + } + } // Example: Demonstration of all head types for metric screws without threading. // xdistribute(spacing=15){ // ydistribute(spacing=15){ From 5c230a450d8f610b037ee7e5954ba51176579e55 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 20 Feb 2021 21:10:11 +0000 Subject: [PATCH 4/6] Bump release version. --- version.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.scad b/version.scad index 2234cd5..787302d 100644 --- a/version.scad +++ b/version.scad @@ -6,7 +6,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,563]; +BOSL_VERSION = [2,0,564]; // Section: BOSL Library Version Functions From 016478e664ec103c795be35d07c1f8ba63f2f0c5 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Sat, 20 Feb 2021 17:06:02 -0500 Subject: [PATCH 5/6] recommend example --- screws.scad | 82 ++++++++++++++++++++++++++--------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/screws.scad b/screws.scad index bd503a4..68537c1 100644 --- a/screws.scad +++ b/screws.scad @@ -856,47 +856,47 @@ module screw_head(screw_info,details=false) { // screw("M5", head="hex", length=12); // } // Example: Demonstration of all head types for UTS screws (using pitch zero for fast preview) - xdistribute(spacing=15){ - ydistribute(spacing=15){ - screw("1/4", thread=0,length=8, anchor=TOP, head="none", drive="hex"); - screw("1/4", thread=0,length=8, anchor=TOP, head="none", drive="torx"); - screw("1/4", thread=0,length=8, anchor=TOP, head="none"); - } - screw("1/4", thread=0, length=8, anchor=TOP, head="hex"); - ydistribute(spacing=15){ - screw("1/4", thread=0,length=8, anchor=TOP, head="socket", drive="hex"); - screw("1/4", thread=0,length=8, anchor=TOP, head="socket", drive="torx"); - screw("1/4", thread=0,length=8, anchor=TOP, head="socket"); - } - ydistribute(spacing=15){ - screw("1/4", thread=0,length=8, anchor=TOP, head="button", drive="hex"); - screw("1/4", thread=0,length=8, anchor=TOP, head="button", drive="torx"); - screw("1/4", thread=0,length=8, anchor=TOP, head="button"); - } - ydistribute(spacing=15){ - screw("1/4", thread=0,length=8, anchor=TOP, head="round", drive="slot"); - screw("1/4", thread=0,length=8, anchor=TOP, head="round", drive="phillips"); - screw("1/4", thread=0,length=8, anchor=TOP, head="round"); - } - ydistribute(spacing=15){ - screw("1/4", thread=0,length=8, anchor=TOP, head="fillister", drive="slot"); - screw("1/4", thread=0,length=8, anchor=TOP, head="fillister", drive="phillips"); - screw("1/4", thread=0,length=8, anchor=TOP, head="fillister"); - } - ydistribute(spacing=15){ - screw("1/4", thread=0,length=8, anchor=TOP, head="flat", drive="slot"); - screw("1/4", thread=0,length=8, anchor=TOP, head="flat", drive="phillips"); - screw("1/4", thread=0,length=8, anchor=TOP, head="flat", drive="hex"); - screw("1/4", thread=0,length=8, anchor=TOP, head="flat", drive="torx"); - screw("1/4", thread=0,length=8, anchor=TOP, head="flat large"); - screw("1/4", thread=0,length=8, anchor=TOP, head="flat small"); - } - ydistribute(spacing=15){ - screw("1/4", thread=0,length=8, anchor=TOP, head="flat undercut", drive="slot"); - screw("1/4", thread=0,length=8, anchor=TOP, head="flat undercut", drive="phillips"); - screw("1/4", thread=0,length=8, anchor=TOP, head="flat undercut"); - } - } +// xdistribute(spacing=15){ +// ydistribute(spacing=15){ +// screw("1/4", thread=0,length=8, anchor=TOP, head="none", drive="hex"); +// screw("1/4", thread=0,length=8, anchor=TOP, head="none", drive="torx"); +// screw("1/4", thread=0,length=8, anchor=TOP, head="none"); +// } +// screw("1/4", thread=0, length=8, anchor=TOP, head="hex"); +// ydistribute(spacing=15){ +// screw("1/4", thread=0,length=8, anchor=TOP, head="socket", drive="hex"); +// screw("1/4", thread=0,length=8, anchor=TOP, head="socket", drive="torx"); +// screw("1/4", thread=0,length=8, anchor=TOP, head="socket"); +// } +// ydistribute(spacing=15){ +// screw("1/4", thread=0,length=8, anchor=TOP, head="button", drive="hex"); +// screw("1/4", thread=0,length=8, anchor=TOP, head="button", drive="torx"); +// screw("1/4", thread=0,length=8, anchor=TOP, head="button"); +// } +// ydistribute(spacing=15){ +// screw("1/4", thread=0,length=8, anchor=TOP, head="round", drive="slot"); +// screw("1/4", thread=0,length=8, anchor=TOP, head="round", drive="phillips"); +// screw("1/4", thread=0,length=8, anchor=TOP, head="round"); +// } +// ydistribute(spacing=15){ +// screw("1/4", thread=0,length=8, anchor=TOP, head="fillister", drive="slot"); +// screw("1/4", thread=0,length=8, anchor=TOP, head="fillister", drive="phillips"); +// screw("1/4", thread=0,length=8, anchor=TOP, head="fillister"); +// } +// ydistribute(spacing=15){ +// screw("1/4", thread=0,length=8, anchor=TOP, head="flat", drive="slot"); +// screw("1/4", thread=0,length=8, anchor=TOP, head="flat", drive="phillips"); +// screw("1/4", thread=0,length=8, anchor=TOP, head="flat", drive="hex"); +// screw("1/4", thread=0,length=8, anchor=TOP, head="flat", drive="torx"); +// screw("1/4", thread=0,length=8, anchor=TOP, head="flat large"); +// screw("1/4", thread=0,length=8, anchor=TOP, head="flat small"); +// } +// ydistribute(spacing=15){ +// screw("1/4", thread=0,length=8, anchor=TOP, head="flat undercut", drive="slot"); +// screw("1/4", thread=0,length=8, anchor=TOP, head="flat undercut", drive="phillips"); +// screw("1/4", thread=0,length=8, anchor=TOP, head="flat undercut"); +// } +// } // Example: Demonstration of all head types for metric screws without threading. // xdistribute(spacing=15){ // ydistribute(spacing=15){ From 29daba0696938f909ef1e90d67fd1f6108c6b3fc Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 21 Feb 2021 00:30:12 +0000 Subject: [PATCH 6/6] Bump release version. --- version.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.scad b/version.scad index 787302d..9907c2d 100644 --- a/version.scad +++ b/version.scad @@ -6,7 +6,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,564]; +BOSL_VERSION = [2,0,565]; // Section: BOSL Library Version Functions