Revert "Reverted X^Y syntax to pow(X,Y)"

This commit is contained in:
Revar Desmera 2022-01-22 19:26:17 -08:00 committed by GitHub
parent 6abfe49fe1
commit 86a7766984
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 12 deletions

View file

@ -82,16 +82,16 @@ function bezier_points(curve, u) =
)
N==0 ? [for(uval=u)[1]*M] :
N==1 ? [for(uval=u)[1, uval]*M] :
N==2 ? [for(uval=u)[1, uval, uval*uval]*M] :
N==3 ? [for(uval=u)[1, uval, uval*uval, uval*uval*uval]*M] :
N==4 ? [for(uval=u)[1, uval, uval*uval, uval*uval*uval, pow(uval,4)]*M] :
N==5 ? [for(uval=u)[1, uval, uval*uval, uval*uval*uval, pow(uval,4), pow(uval,5)]*M] :
N==6 ? [for(uval=u)[1, uval, uval*uval, uval*uval*uval, pow(uval,4), pow(uval,5), pow(uval,6)]*M] :
N==7 ? [for(uval=u)[1, uval, uval*uval, uval*uval*uval, pow(uval,4), pow(uval,5), pow(uval,6), pow(uval,7)]*M] :
N==8 ? [for(uval=u)[1, uval, uval*uval, uval*uval*uval, pow(uval,4), pow(uval,5), pow(uval,6), pow(uval,7), pow(uval,8)]*M] :
N==9 ? [for(uval=u)[1, uval, uval*uval, uval*uval*uval, pow(uval,4), pow(uval,5), pow(uval,6), pow(uval,7), pow(uval,8), pow(uval,9)]*M] :
N==10? [for(uval=u)[1, uval, uval*uval, uval*uval*uval, pow(uval,4), pow(uval,5), pow(uval,6), pow(uval,7), pow(uval,8), pow(uval,9), pow(uval,10)]*M] :
/* N>=11 */ [for(uval=u)[for (i=[0:1:N]) pow(uval,i)]*M];
N==2 ? [for(uval=u)[1, uval, uval^2]*M] :
N==3 ? [for(uval=u)[1, uval, uval^2, uval^3]*M] :
N==4 ? [for(uval=u)[1, uval, uval^2, uval^3, uval^4]*M] :
N==5 ? [for(uval=u)[1, uval, uval^2, uval^3, uval^4, uval^5]*M] :
N==6 ? [for(uval=u)[1, uval, uval^2, uval^3, uval^4, uval^5,uval^6]*M] :
N==7 ? [for(uval=u)[1, uval, uval^2, uval^3, uval^4, uval^5,uval^6, uval^7]*M] :
N==8 ? [for(uval=u)[1, uval, uval^2, uval^3, uval^4, uval^5,uval^6, uval^7, uval^8]*M] :
N==9 ? [for(uval=u)[1, uval, uval^2, uval^3, uval^4, uval^5,uval^6, uval^7, uval^8, uval^9]*M] :
N==10? [for(uval=u)[1, uval, uval^2, uval^3, uval^4, uval^5,uval^6, uval^7, uval^8, uval^9, uval^10]*M] :
/* N>=11 */ [for(uval=u)[for (i=[0:1:N]) uval^i]*M];
// Not public.

View file

@ -1133,8 +1133,8 @@ function circle_circle_intersection(c1,r1,c2,r2,eps=EPSILON,d1,d2) =
d = norm(c2-c1),
a = (c2-c1)/d,
b = [-a.y,a.x],
L = (r1*r1-r2*r2+d*d)/2/d,
hsqr = r1*r1-L*L
L = (r1^2-r2^2+d^2)/2/d,
hsqr = r1^2-L^2
)
approx(hsqr,0,eps) ? [L*a+c1]
: hsqr<0 ? []

View file

@ -2141,6 +2141,7 @@ module text3d(text, h=1, size=10, font="Helvetica", halign, valign, spacing=1.0,
anch.z>0? TOP :
CENTER;
m = _attach_transform(base,spin,orient,geom);
echo(anchor=anchor, anch=anch, base=base);
multmatrix(m) {
$parent_anchor = anchor;
$parent_spin = spin;