mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-04 00:37:53 +02:00
Fixed orient() for 2D dir=
This commit is contained in:
@@ -429,7 +429,9 @@ module orient(dir, anchor, spin) {
|
|||||||
assert(is_vector(dir));
|
assert(is_vector(dir));
|
||||||
spin = default(spin, 0);
|
spin = default(spin, 0);
|
||||||
assert(is_finite(spin));
|
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 {
|
} else {
|
||||||
assert(dir==undef, "Only one of dir= or anchor= may be given to orient()");
|
assert(dir==undef, "Only one of dir= or anchor= may be given to orient()");
|
||||||
assert($parent_geom != undef, "No parent to orient from!");
|
assert($parent_geom != undef, "No parent to orient from!");
|
||||||
|
Reference in New Issue
Block a user