mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-04 03:09:45 +00:00
Merge pull request #769 from revarbat/revert-768-revarbat_dev
Revert "Reverted X^Y syntax to pow(X,Y)"
This commit is contained in:
commit
1b47016633
2 changed files with 12 additions and 12 deletions
20
beziers.scad
20
beziers.scad
|
@ -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.
|
||||
|
|
|
@ -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 ? []
|
||||
|
|
Loading…
Reference in a new issue