From 61db695210932ba46df7f41f68c9d0e624a9e333 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Wed, 20 Jan 2021 19:30:09 -0500 Subject: [PATCH 1/2] doc tweak for affine change path_spread to use affine3d_frame_map and fix bug when using n= option --- affine.scad | 4 ++-- paths.scad | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/affine.scad b/affine.scad index 666904e..ba16cac 100644 --- a/affine.scad +++ b/affine.scad @@ -266,10 +266,10 @@ function affine3d_rot_from_to(from, to) = // Function: affine3d_frame_map() // Usage: -// map = affine3d_frame_map(v1, v2, v3); +// map = affine3d_frame_map(v1, v2, v3, ); // map = affine3d_frame_map(x=VECTOR1, y=VECTOR2, ); // map = affine3d_frame_map(x=VECTOR1, z=VECTOR2, ); -// map = affine3d_frame_map(y=VECTOR1, y=VECTOR2, ); +// map = affine3d_frame_map(y=VECTOR1, z=VECTOR2, ); // Description: // Returns a transformation that maps one coordinate frame to another. You must specify two or // three of `x`, `y`, and `z`. The specified axes are mapped to the vectors you supplied. If you diff --git a/paths.scad b/paths.scad index 40322c6..c17de56 100644 --- a/paths.scad +++ b/paths.scad @@ -1186,7 +1186,7 @@ module path_spread(path, n, spacing, sp=undef, rotate_children=true, closed=fals if(planar) { rot(from=[0,1],to=cutlist[i][3]) children(); } else { - multmatrix(affine2d_to_3d(transpose([cutlist[i][2],cross(cutlist[i][3],cutlist[i][2]), cutlist[i][3]]))) + multmatrix(affine3d_frame_map(x=cutlist[i][2], z=cutlist[i][3])) children(); } } else { From 536a8715b596557fc71c40100f5718ddce2645af Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Wed, 20 Jan 2021 19:33:24 -0500 Subject: [PATCH 2/2] n= option bug fix --- paths.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paths.scad b/paths.scad index c17de56..9e7afcc 100644 --- a/paths.scad +++ b/paths.scad @@ -1172,7 +1172,7 @@ module path_spread(path, n, spacing, sp=undef, rotate_children=true, closed=fals sort([for(entry=ptlist) posmod(entry-listcenter,length)]) : [for(entry=ptlist) entry + length/2-listcenter ] ); - distOK = min(distances)>=0 && max(distances)<=length; + distOK = is_def(n) || (min(distances)>=0 && max(distances)<=length); assert(distOK,"Cannot fit all of the copies"); cutlist = path_cut(path, distances, closed, direction=true); planar = len(path[0])==2;