mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
Fixed 2D attachments issue That rotated shapes vertically.
This commit is contained in:
parent
62e8e517fd
commit
9d84c33af6
4 changed files with 10 additions and 6 deletions
|
@ -275,8 +275,8 @@ module orient_and_anchor(
|
||||||
hidden = any([for (tag=tags) in_list(tag, h_tags)]);
|
hidden = any([for (tag=tags) in_list(tag, h_tags)]);
|
||||||
if ($attach_to != undef) {
|
if ($attach_to != undef) {
|
||||||
anch = find_anchor($attach_to, size.z, size, size2=size2, shift=shift, offset=offset, anchors=anchors, geometry=geometry, two_d=two_d);
|
anch = find_anchor($attach_to, size.z, size, size2=size2, shift=shift, offset=offset, anchors=anchors, geometry=geometry, two_d=two_d);
|
||||||
ang = vector_angle(anch[2], DOWN);
|
ang = vector_angle(anch[2], two_d? BACK : DOWN);
|
||||||
axis = vector_axis(anch[2], DOWN);
|
axis = two_d? UP : vector_axis(anch[2], DOWN);
|
||||||
ang2 = (anch[2]==UP || anch[2]==DOWN)? 0 : 180-anch[3];
|
ang2 = (anch[2]==UP || anch[2]==DOWN)? 0 : 180-anch[3];
|
||||||
axis2 = rotate_points3d([axis],[0,0,ang2])[0];
|
axis2 = rotate_points3d([axis],[0,0,ang2])[0];
|
||||||
$attach_to = undef;
|
$attach_to = undef;
|
||||||
|
|
|
@ -136,7 +136,7 @@ function circle(r, d, realign=false, circum=false, anchor=CENTER, spin=0) =
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Section: Primitive Shapes
|
// Section: Primitive 3D Shapes
|
||||||
|
|
||||||
|
|
||||||
// Module: cube()
|
// Module: cube()
|
||||||
|
|
|
@ -781,8 +781,12 @@ function trapezoid(h, w1, w2, anchor=CENTER, spin=0) =
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
module trapezoid(h, w1, w2, anchor=CENTER, spin=0)
|
module trapezoid(h, w1, w2, anchor=CENTER, spin=0) {
|
||||||
polygon(trapezoid(h=h, w1=w1, w2=w2, anchor=anchor, spin=spin));
|
orient_and_anchor([w1,h,0], size2=[w2,h], UP, anchor, spin=spin, two_d=true, chain=true) {
|
||||||
|
polygon(trapezoid(h=h, w1=w1, w2=w2));
|
||||||
|
children();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Function&Module: teardrop2d()
|
// Function&Module: teardrop2d()
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
BOSL_VERSION = [2,0,86];
|
BOSL_VERSION = [2,0,87];
|
||||||
|
|
||||||
|
|
||||||
// Section: BOSL Library Version Functions
|
// Section: BOSL Library Version Functions
|
||||||
|
|
Loading…
Reference in a new issue