mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
fix attachments for linear_sweep
This commit is contained in:
parent
bca6d69796
commit
c0dbbdba73
1 changed files with 9 additions and 2 deletions
|
@ -3467,9 +3467,16 @@ function _find_anchor(anchor, geom) =
|
||||||
let(
|
let(
|
||||||
newrgn = apply(mat, rgn),
|
newrgn = apply(mat, rgn),
|
||||||
newgeom = attach_geom(two_d=true, region=newrgn, extent=type=="extrusion_extent", cp=cp),
|
newgeom = attach_geom(two_d=true, region=newrgn, extent=type=="extrusion_extent", cp=cp),
|
||||||
|
topmat = anchor.z!=0 ? []
|
||||||
|
: move(shift)*scale(scale)*zrot(-twist),
|
||||||
|
topgeom = anchor.z!=0? []
|
||||||
|
: attach_geom(two_d=true, region=apply(topmat,rgn), extent=type=="extrusion_extent", cp=cp),
|
||||||
|
top2d = anchor.z!=0? []
|
||||||
|
: _find_anchor(anchor_xy, topgeom),
|
||||||
result2d = _find_anchor(anchor_xy, newgeom),
|
result2d = _find_anchor(anchor_xy, newgeom),
|
||||||
pos = point3d(result2d[1], anchor.z*L/2),
|
pos = point3d(result2d[1], anchor.z*L/2),
|
||||||
vec = unit(point3d(result2d[2], anchor.z),UP),
|
vec = anchor.z==0? rot(from=UP,to=point3d(top2d[1],L/2)-point3d(result2d[1]),p=point3d(result2d[2]))
|
||||||
|
: unit(point3d(result2d[2], anchor.z),UP),
|
||||||
oang = atan2(vec.y,vec.x) + 90
|
oang = atan2(vec.y,vec.x) + 90
|
||||||
)
|
)
|
||||||
[anchor, pos, vec, oang]
|
[anchor, pos, vec, oang]
|
||||||
|
|
Loading…
Reference in a new issue