From 00af3d6eca4c3dd5cd64d73e7f8befff324f1307 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Sat, 18 Mar 2023 21:39:13 -0400 Subject: [PATCH 1/3] fix trapezoid anchoring to eliminate special case for zero length edges that made it inconsistent with other anchors --- attachments.scad | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/attachments.scad b/attachments.scad index fd3eab8..e8a2c50 100644 --- a/attachments.scad +++ b/attachments.scad @@ -755,6 +755,13 @@ module tag_scope(scope){ // Attachable objects should be tagged using {{tag()}} // and non-attachable objects with {{force_tag()}}. // . +// Remember when using tagged operations with that the operations don't happen in hierarchical order, since +// the point of tags is to break the hierarchy. If you tag an object with a keep tag, nothing will be +// subtracted from it, no matter where it appears because kept objects are unioned in at the end. +// If you want a child of an object tagged with a remove tag to stay in the model it may be +// better to give it a tag that is not a remove tag or a keep tag. Such an object *will* be subject to +// subtractions from other remove-tagged objects. +// . // For a step-by-step explanation of attachments, see the [[Attachments Tutorial|Tutorial-Attachments]]. // Arguments: // remove = String containing space delimited set of tag names of children to difference away. Default: `"remove"` @@ -2662,19 +2669,9 @@ function _find_anchor(anchor, geom) = pos = default(override[0],point2d(cp) + lerp(frpt, bkpt, u) + point2d(offset)), svec = point3d(line_normal(bkpt,frpt)*anchor.x), vec = is_def(override[1]) ? override[1] - : - anchor.y < 0? ( - anchor.x == 0? FWD : - size.x == 0? unit(-[shift,size.y], FWD) : - unit((point3d(svec) + FWD) / 2, FWD) - ) : - anchor.y == 0? ( anchor.x == 0? BACK : svec ) : - ( // anchor.y > 0 - anchor.x == 0? BACK : - size2 == 0? unit([shift,size.y], BACK) : - unit((point3d(svec) + BACK) / 2, BACK) - - ) + : anchor.y == 0? ( anchor.x == 0? BACK : svec ) + : anchor.x == 0? [0,anchor.y,0] + : unit((svec + [0,anchor.y,0]) / 2, [0,anchor.y,0]), ) [anchor, pos, vec, 0] ) : type == "ellipse"? ( //r let( From d871d02bdfd161d8f544d7411fe99fc191896433 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Sat, 18 Mar 2023 21:41:40 -0400 Subject: [PATCH 2/3] fix extra comma --- attachments.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attachments.scad b/attachments.scad index e8a2c50..6b4026c 100644 --- a/attachments.scad +++ b/attachments.scad @@ -2671,7 +2671,7 @@ function _find_anchor(anchor, geom) = vec = is_def(override[1]) ? override[1] : anchor.y == 0? ( anchor.x == 0? BACK : svec ) : anchor.x == 0? [0,anchor.y,0] - : unit((svec + [0,anchor.y,0]) / 2, [0,anchor.y,0]), + : unit((svec + [0,anchor.y,0]) / 2, [0,anchor.y,0]) ) [anchor, pos, vec, 0] ) : type == "ellipse"? ( //r let( From be0dec0120b162cb790dcb3fbce9aadb7fde1c1e Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Mon, 20 Mar 2023 20:55:11 -0400 Subject: [PATCH 3/3] add see alsos --- shapes3d.scad | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shapes3d.scad b/shapes3d.scad index 79a237e..4516d81 100644 --- a/shapes3d.scad +++ b/shapes3d.scad @@ -120,6 +120,7 @@ function cube(size=1, center, anchor, spin=0, orient=UP) = // anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER` // spin = Rotate this many degrees around the Z axis. See [spin](attachments.scad#subsection-spin). Default: `0` // orient = Vector to rotate top towards. See [orient](attachments.scad#subsection-orient). Default: `UP` +// See Also: prismoid(), rounded_prism() // Example: Simple regular cube. // cuboid(40); // Example: Cube with minimum cornerpoint given. @@ -598,7 +599,7 @@ function cuboid( // spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0` // orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP` // -// See Also: rounded_prism() +// See Also: cuboid(), rounded_prism() // // Example: Rectangular Pyramid // prismoid([40,40], [0,0], h=20);