diff --git a/beziers.scad b/beziers.scad index 71689d8..9dccfa6 100644 --- a/beziers.scad +++ b/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. diff --git a/geometry.scad b/geometry.scad index 25ed8dd..e9762a6 100644 --- a/geometry.scad +++ b/geometry.scad @@ -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 ? [] diff --git a/shapes3d.scad b/shapes3d.scad index 26c893c..d2b6a62 100644 --- a/shapes3d.scad +++ b/shapes3d.scad @@ -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;