Fixed bugs in list_set, list_remove, list_insert that were revealed by

adding degenerate case tests.  List_set was broken for minlen
nonzero (no tests).  Added seed to shuffle.  Fixed bounds check error
in rounded_prism.
This commit is contained in:
Adrian Mariano
2020-12-31 09:32:47 -05:00
parent 5269b26703
commit e0ac4d0c1b
3 changed files with 34 additions and 14 deletions

View File

@@ -1768,7 +1768,7 @@ function rounded_prism(bottom, top, joint_bot, joint_top, joint_sides, k_bot, k_
len(top[0])==2 ? path3d(top,height/2) :
top,
bottom = len(bottom[0])==2 ? path3d(bottom,-height/2) : bottom,
jssingleok = (is_num(joint_sides) && joint_sides > 0) || (is_vector(joint_sides,2) && joint_sides[0]>=0 && joint_sides[1]>=0),
jssingleok = (is_num(joint_sides) && joint_sides >= 0) || (is_vector(joint_sides,2) && joint_sides[0]>=0 && joint_sides[1]>=0),
jsvecok = is_list(joint_sides) && len(joint_sides)==N && []==[for(entry=joint_sides) if (!(is_num(entry) || is_vector(entry,2))) entry]
)
assert(is_num(joint_top) || is_vector(joint_top,2))