mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-15 08:59:40 +00:00
Compare commits
10 commits
5029ee4af9
...
a0f0fe0819
Author | SHA1 | Date | |
---|---|---|---|
|
a0f0fe0819 | ||
|
cbe55c8514 | ||
|
bbf4bc38c0 | ||
|
ab2d381034 | ||
|
606b6acde2 | ||
|
94583da672 | ||
|
802059f2cb | ||
|
ccccd39160 | ||
|
0f6a321568 | ||
|
73a8033316 |
1 changed files with 19 additions and 23 deletions
|
@ -3729,7 +3729,7 @@ function _attach_transform(anchor, spin, orient, geom, p) =
|
||||||
spin=default(spin,0),
|
spin=default(spin,0),
|
||||||
orient=default(orient,UP),
|
orient=default(orient,UP),
|
||||||
two_d = _attach_geom_2d(geom),
|
two_d = _attach_geom_2d(geom),
|
||||||
m = ($attach_to != undef) ? // $attach_to is the attachment point on this object
|
m = is_def($attach_to) ? // $attach_to is the attachment point on this object
|
||||||
( // which will attach to the parent
|
( // which will attach to the parent
|
||||||
let(
|
let(
|
||||||
anch = _find_anchor($attach_to, geom),
|
anch = _find_anchor($attach_to, geom),
|
||||||
|
@ -3739,7 +3739,6 @@ function _attach_transform(anchor, spin, orient, geom, p) =
|
||||||
: _find_anchor(_make_anchor_legal($anchor_override,geom),geom)[1]
|
: _find_anchor(_make_anchor_legal($anchor_override,geom),geom)[1]
|
||||||
)
|
)
|
||||||
two_d?
|
two_d?
|
||||||
assert(is_num(spin))
|
|
||||||
affine3d_zrot(spin)
|
affine3d_zrot(spin)
|
||||||
* rot(to=FWD, from=point3d(anch[2]))
|
* rot(to=FWD, from=point3d(anch[2]))
|
||||||
* affine3d_translate(point3d(-pos))
|
* affine3d_translate(point3d(-pos))
|
||||||
|
@ -3756,17 +3755,14 @@ function _attach_transform(anchor, spin, orient, geom, p) =
|
||||||
: _make_anchor_legal(rot(spin, from=UP,to=orient,reverse=true,p=$attach_alignment),geom),
|
: _make_anchor_legal(rot(spin, from=UP,to=orient,reverse=true,p=$attach_alignment),geom),
|
||||||
pos = _find_anchor(anchor, geom)[1]
|
pos = _find_anchor(anchor, geom)[1]
|
||||||
)
|
)
|
||||||
two_d?
|
two_d? affine3d_zrot(spin) * affine3d_translate(point3d(-pos))
|
||||||
assert(is_num(spin))
|
|
||||||
affine3d_zrot(spin) * affine3d_translate(point3d(-pos))
|
|
||||||
:
|
:
|
||||||
let(
|
let(
|
||||||
axis = vector_axis(UP,orient), // Returns BACK if orient is UP
|
axis = vector_axis(UP,orient), // Returns BACK if orient is UP
|
||||||
ang = vector_angle(UP,orient)
|
ang = vector_angle(UP,orient)
|
||||||
)
|
)
|
||||||
affine3d_rot_by_axis(axis,ang)
|
affine3d_rot_by_axis(axis,ang)
|
||||||
* ( is_num(spin)? affine3d_zrot(spin)
|
* affine3d_zrot(spin)
|
||||||
: affine3d_zrot(spin.z) * affine3d_yrot(spin.y) * affine3d_xrot(spin.x))
|
|
||||||
* affine3d_translate(point3d(-pos))
|
* affine3d_translate(point3d(-pos))
|
||||||
)
|
)
|
||||||
is_undef(p)? m
|
is_undef(p)? m
|
||||||
|
|
Loading…
Reference in a new issue