From 5719439b052c355a084184b0020acb8c9acd6c01 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Tue, 30 Jan 2024 19:36:59 -0500 Subject: [PATCH] fix CENTER anchors for regions and vnfs to actually center --- attachments.scad | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/attachments.scad b/attachments.scad index c96e27b..671513f 100644 --- a/attachments.scad +++ b/attachments.scad @@ -3333,7 +3333,7 @@ function _find_anchor(anchor, geom) = ) [anchor, pos, vec, oang] ) : type == "vnf_isect"? ( //vnf let( vnf=geom[1] ) - approx(anchor,CTR)? [anchor, [0,0,0], UP, 0] : + approx(anchor,CTR)? [anchor, cp, UP, 0] : vnf==EMPTY_VNF? [anchor, [0,0,0], unit(anchor), 0] : let( eps = 1/2048, @@ -3383,7 +3383,7 @@ function _find_anchor(anchor, geom) = [anchor, pos, n, oang] ) : type == "vnf_extent"? ( //vnf let( vnf=geom[1] ) - approx(anchor,CTR)? [anchor, [0,0,0], UP, 0] : + approx(anchor,CTR)? [anchor, cp, UP, 0] : vnf==EMPTY_VNF? [anchor, [0,0,0], unit(anchor,UP), 0] : let( rpts = apply(rot(from=anchor, to=RIGHT) * move(point3d(-cp)), vnf[0]), @@ -3432,7 +3432,7 @@ function _find_anchor(anchor, geom) = anchor = _force_anchor_2d(anchor), rgn = force_region(move(-point2d(cp), p=geom[1])) ) - approx(anchor,[0,0])? [anchor, [0,0,0], BACK, 0] : + approx(anchor,[0,0])? [anchor, cp, BACK, 0] : let( isects = [ for (path=rgn, t=triplet(path,true)) let( @@ -3456,7 +3456,7 @@ function _find_anchor(anchor, geom) = ) [anchor, pos, vec, 0] ) : type == "rgn_extent"? ( //region let( anchor = _force_anchor_2d(anchor) ) - approx(anchor,[0,0])? [anchor, [0,0,0], BACK, 0] : + approx(anchor,[0,0])? [anchor, cp, BACK, 0] : let( rgn = force_region(geom[1]), rpts = rot(from=anchor, to=RIGHT, p=flatten(rgn)),