This commit is contained in:
Adrian Mariano 2023-05-15 20:02:07 -04:00
parent bf97d1c5be
commit fcfa1568c0
2 changed files with 6 additions and 5 deletions

View file

@ -365,7 +365,7 @@ include <structs.scad>
// Example(2D,Med,NoAxes): Specifying by corner index. Use {{list_set()}} to construct the full chamfer cut list. // 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 // path = star(47, ir=25, or=50); // long path, lots of corners
// chamfind = [8, 28, 60]; // But only want 3 chamfers // 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"); // rpath = round_corners(path, cut=chamfcut, method="chamfer");
// polygon(rpath); // polygon(rpath);
// Example(2D,Med,NoAxes): Two-pass to chamfer and round by index. Use {{repeat_entries()}} to correct for first pass chamfers. // 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 <structs.scad>
// path = star(47, ir=32, or=65); // long path, lots of corners // path = star(47, ir=32, or=65); // long path, lots of corners
// chamfind = [8, 28, 60]; // But only want 3 chamfers // chamfind = [8, 28, 60]; // But only want 3 chamfers
// roundind = [7,9,27,29,59,61]; // And 6 roundovers // roundind = [7,9,27,29,59,61]; // And 6 roundovers
// chamfcut = list_set([],chamfind,[10,13,15],minlen=len(path)-1); // chamfcut = list_set([],chamfind,[10,13,15],minlen=len(path));
// roundcut = list_set([],roundind,repeat(8,6),minlen=len(path)-1); // roundcut = list_set([],roundind,repeat(8,6),minlen=len(path));
// dups = list_set([], chamfind, repeat(2,len(chamfind)), dflt=1, minlen=len(path)-1); // dups = list_set([], chamfind, repeat(2,len(chamfind)), dflt=1, minlen=len(path));
// rpath1 = round_corners(path, cut=chamfcut, method="chamfer"); // rpath1 = round_corners(path, cut=chamfcut, method="chamfer");
// rpath2 = round_corners(rpath1, cut=repeat_entries(roundcut,dups)); // rpath2 = round_corners(rpath1, cut=repeat_entries(roundcut,dups));
// polygon(rpath2); // polygon(rpath2);

View file

@ -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=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], [-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([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(); 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,all=true), test);
assert_equal(list_remove_values(test,[99,100],all=true), test); assert_equal(list_remove_values(test,[99,100],all=true), test);
assert_equal(list_remove_values(test,[99,100]), test); assert_equal(list_remove_values(test,[99,100]), test);
} }
test_list_remove_values(); test_list_remove_values();