fix attach() bug

This commit is contained in:
Adrian Mariano 2024-05-28 19:12:27 -04:00
parent 04437cc6a0
commit 0f39f10dba
2 changed files with 5 additions and 1 deletions

View file

@ -916,7 +916,7 @@ module attach(parent, child, overlap, align, spin=0, norot, inset=0, shiftout=0,
anchor_data = _find_anchor(anchor, $parent_geom);
anchor_pos = anchor_data[1];
anchor_dir = factor*anchor_data[2];
anchor_spin = !inside || anchor_data[3]==0 ? anchor_data[3] : 180+anchor_data[3];
anchor_spin = !inside || anchor==TOP || anchor==BOT ? anchor_data[3] : 180+anchor_data[3];
$anchor=anchor;
for(align_ind = idx(align_list)){
align = is_undef(align_list[align_ind]) ? undef

View file

@ -130,6 +130,10 @@ function cube(size=1, center, anchor, spin=0, orient=UP) =
// orient = Vector to rotate top towards. See [orient](attachments.scad#subsection-orient). Default: `UP`
// Example: Simple regular cube.
// cuboid(40);
// Example: Cuboid with a corner at the origin
// cuboid(40, anchor=FRONT+LEFT+BOT);
// Example: Cuboid anchored on its right face
// cuboid(40, anchor=RIGHT);
// Example: Cube with minimum cornerpoint given.
// cuboid(20, p1=[10,0,0]);
// Example: Rectangular cube, with given X, Y, and Z sizes.