another double anchor assignment

This commit is contained in:
Adrian Mariano 2022-02-12 21:46:12 -05:00
parent e3624e0b2f
commit 47bc457db0

View file

@ -2014,16 +2014,14 @@ function _find_anchor(anchor, geom) =
) [anchor, pos, vec, 0] ) [anchor, pos, vec, 0]
) : type == "circle"? ( //r ) : type == "circle"? ( //r
let( let(
anchor = _force_anchor_2d(anchor), anchor = unit(_force_anchor_2d(anchor),[0,0]),
rr = geom[1], r = force_list(geom[1],2),
r = is_num(rr)? [rr,rr] : point2d(rr),
pos = approx(anchor.x,0) ? [0,sign(anchor.y)*r.y] pos = approx(anchor.x,0) ? [0,sign(anchor.y)*r.y]
: let( : let(
m = anchor.y/anchor.x, m = anchor.y/anchor.x,
px = sign(anchor.x) * sqrt(1/(1/sqr(r.x) + m*m/sqr(r.y))) px = sign(anchor.x) * sqrt(1/(1/sqr(r.x) + m*m/sqr(r.y)))
) )
[px,m*px], [px,m*px],
anchor = unit(anchor,[0,0]),
vec = unit([r.y/r.x*pos.x, r.x/r.y*pos.y]) vec = unit([r.y/r.x*pos.x, r.x/r.y*pos.y])
) [anchor, point2d(cp+offset)+pos, vec, 0] ) [anchor, point2d(cp+offset)+pos, vec, 0]
) : type == "rgn_isect"? ( //region ) : type == "rgn_isect"? ( //region