From 579a3e5c99003589ec0697fb029e74b5bbd04f5f Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Wed, 2 Dec 2020 18:15:05 -0500 Subject: [PATCH 1/2] Fixed trapezohedron bug --- polyhedra.scad | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/polyhedra.scad b/polyhedra.scad index bdcd87ef..a4cf00e5 100644 --- a/polyhedra.scad +++ b/polyhedra.scad @@ -283,7 +283,7 @@ module regular_polyhedron( faces=undef, facetype=undef, hasfaces=undef, - side=1, + side=undef, ir=undef, mr=undef, or=undef, @@ -591,7 +591,7 @@ function regular_polyhedron_info( info=undef, name=undef, index=undef, type=undef, faces=undef, facetype=undef, - hasfaces=undef, side=1, + hasfaces=undef, side=undef, ir=undef, mr=undef, or=undef, r=undef, d=undef, anchor=[0,0,0], center=undef, @@ -602,7 +602,7 @@ function regular_polyhedron_info( argcount = num_defined([ir,mr,or,r,d]) ) assert(argcount<=1, "You must specify only one of 'ir', 'mr', 'or', 'r', and 'd'") - let( + let( ////////////////////// //Index values into the _polyhedra_ array // @@ -664,6 +664,7 @@ function regular_polyhedron_info( ) assert(valid_facedown,str("'facedown' set to ",facedown," but selected polygon only has faces with size(s) ",entry[facevertices])) let( + side = default(side,1), // This default setting must occur after _trapezohedron is called scalefactor = ( name=="trapezohedron" ? 1 : ( argcount == 0? side : @@ -730,7 +731,7 @@ function _stellate_faces(scalefactor,stellate,vertices,faces_normals) = function _trapezohedron(faces, r, side, longside, h, d) = assert(faces%2==0, "Must set 'faces' to an even number for trapezohedron") let( - r = get_radius(r=r, d=d, dflt=1), + r = get_radius(r=r, d=d), N = faces/2, parmcount = num_defined([r,side,longside,h]) ) From ae61174a87481e4e9bdb2735c0add6b2468adb6b Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Wed, 2 Dec 2020 18:25:13 -0500 Subject: [PATCH 2/2] fix test for yscale change --- tests/test_math.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_math.scad b/tests/test_math.scad index 1d9fee95..56f3ae2e 100644 --- a/tests/test_math.scad +++ b/tests/test_math.scad @@ -889,7 +889,7 @@ module test_deriv(){ [0.469846310393,-0.813797681349], [0.925416578398,0.163175911167], [0.696902572292,1.45914323952]]); - spent = yscale(8,pent); + spent = yscale(8,p=pent); lens = path_segment_lengths(spent,closed=true); assert_approx(deriv(spent, closed=true, h=lens), [[-0.0381285841663,0.998065839726],