From c4aa61fc20547e9183bf6f4ca174e970f77180f3 Mon Sep 17 00:00:00 2001 From: Garth Minette Date: Sun, 26 Dec 2021 18:39:10 -0800 Subject: [PATCH] Fixed orient() for 2D dir= --- attachments.scad | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/attachments.scad b/attachments.scad index 018297c..b8c0b67 100644 --- a/attachments.scad +++ b/attachments.scad @@ -429,7 +429,9 @@ module orient(dir, anchor, spin) { assert(is_vector(dir)); spin = default(spin, 0); assert(is_finite(spin)); - rot(spin, from=UP, to=dir) children(); + two_d = _attach_geom_2d($parent_geom); + fromvec = two_d? BACK : UP; + rot(spin, from=fromvec, to=dir) children(); } else { assert(dir==undef, "Only one of dir= or anchor= may be given to orient()"); assert($parent_geom != undef, "No parent to orient from!");