diff --git a/rounding.scad b/rounding.scad index 6495889..ea5a977 100644 --- a/rounding.scad +++ b/rounding.scad @@ -365,7 +365,7 @@ include // Example(2D,Med,NoAxes): Specifying by corner index. Use {{list_set()}} to construct the full chamfer cut list. // path = star(47, ir=25, or=50); // long path, lots of corners // chamfind = [8, 28, 60]; // But only want 3 chamfers -// chamfcut = list_set([],chamfind,[10,13,15],minlen=len(path)-1); +// chamfcut = list_set([],chamfind,[10,13,15],minlen=len(path)); // rpath = round_corners(path, cut=chamfcut, method="chamfer"); // polygon(rpath); // Example(2D,Med,NoAxes): Two-pass to chamfer and round by index. Use {{repeat_entries()}} to correct for first pass chamfers. @@ -373,9 +373,9 @@ include // path = star(47, ir=32, or=65); // long path, lots of corners // chamfind = [8, 28, 60]; // But only want 3 chamfers // roundind = [7,9,27,29,59,61]; // And 6 roundovers -// chamfcut = list_set([],chamfind,[10,13,15],minlen=len(path)-1); -// roundcut = list_set([],roundind,repeat(8,6),minlen=len(path)-1); -// dups = list_set([], chamfind, repeat(2,len(chamfind)), dflt=1, minlen=len(path)-1); +// chamfcut = list_set([],chamfind,[10,13,15],minlen=len(path)); +// roundcut = list_set([],roundind,repeat(8,6),minlen=len(path)); +// dups = list_set([], chamfind, repeat(2,len(chamfind)), dflt=1, minlen=len(path)); // rpath1 = round_corners(path, cut=chamfcut, method="chamfer"); // rpath2 = round_corners(rpath1, cut=repeat_entries(roundcut,dups)); // polygon(rpath2); diff --git a/tests/test_lists.scad b/tests/test_lists.scad index 29ffa7d..63b33bc 100644 --- a/tests/test_lists.scad +++ b/tests/test_lists.scad @@ -169,6 +169,8 @@ module test_list_set() { assert_equal(list_set([1,2,3], [-2,5], [8,9],minlen=8,dflt=-1), [1,8,3,-1,-1,9,-1,-1]); assert_equal(list_set([1,2,3], [-2,5], [8,9],minlen=3,dflt=-1), [1,8,3,-1,-1,9]); assert_equal(list_set([1,2,3], [0],[4], minlen=5), [4,2,3,0,0]); + assert_equal(list_set([], 2,3), [0,0,3]); + assert_equal(list_set([], 2,3,minlen=5,dflt=1), [1,1,3,1,1]); } test_list_set(); @@ -209,7 +211,6 @@ module test_list_remove_values() { assert_equal(list_remove_values(test,99,all=true), test); assert_equal(list_remove_values(test,[99,100],all=true), test); assert_equal(list_remove_values(test,[99,100]), test); - } test_list_remove_values();