|
@@ -524,8 +524,8 @@ a,b,THREE.RGBFormat);a.needsUpdate=!0;return a}};THREE.SceneUtils={createMultiMa
|
|
|
c+d;l=b[a++]*c;r=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(r,t,i,l);if(h=f[f.length-1]){m=h.x;n=h.y;h=1;for(g=this.divisions;h<=g;h++){var u=h/g;THREE.Shape.Utils.b2(u,m,r,i);THREE.Shape.Utils.b2(u,n,t,l)}}break;case "b":if(i=b[a++]*c+d,l=b[a++]*c,r=b[a++]*c+d,t=b[a++]*-c,p=b[a++]*c+d,s=b[a++]*-c,e.bezierCurveTo(i,l,r,t,p,s),h=f[f.length-1]){m=h.x;n=h.y;h=1;for(g=this.divisions;h<=g;h++)u=h/g,THREE.Shape.Utils.b3(u,m,r,p,i),THREE.Shape.Utils.b3(u,n,t,s,l)}}}return{offset:q.ha*c,path:e}}}};
|
|
|
THREE.FontUtils.generateShapes=function(a,b){var b=b||{},c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",f=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(f=c.length;e<f;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
|
|
|
(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,h=0;h<b;f=h++)e+=a[f].x*a[h].y-a[h].x*a[f].y;return 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],h=[],g=[],i,k,l;if(0<b(a))for(k=0;k<e;k++)h[k]=k;else for(k=0;k<e;k++)h[k]=e-1-k;var m=2*e;for(k=e-1;2<e;){if(0>=m--){console.log("Warning, unable to triangulate polygon!");break}i=k;e<=i&&(i=0);k=i+1;e<=k&&(k=0);l=k+1;e<=l&&(l=0);var n;a:{var r=n=void 0,t=void 0,p=void 0,s=void 0,q=void 0,u=void 0,w=void 0,v=
|
|
|
-void 0,r=a[h[i]].x,t=a[h[i]].y,p=a[h[k]].x,s=a[h[k]].y,q=a[h[l]].x,u=a[h[l]].y;if(1E-10>(p-r)*(u-t)-(s-t)*(q-r))n=!1;else{var C=void 0,z=void 0,y=void 0,F=void 0,x=void 0,O=void 0,B=void 0,E=void 0,I=void 0,D=void 0,I=E=B=v=w=void 0,C=q-p,z=u-s,y=r-q,F=t-u,x=p-r,O=s-t;for(n=0;n<e;n++)if(!(n===i||n===k||n===l))if(w=a[h[n]].x,v=a[h[n]].y,B=w-r,E=v-t,I=w-p,D=v-s,w-=q,v-=u,I=C*D-z*I,B=x*E-O*B,E=y*v-F*w,0<=I&&0<=E&&0<=B){n=!1;break a}n=!0}}if(n){f.push([a[h[i]],a[h[k]],a[h[l]]]);g.push([h[i],h[k],h[l]]);
|
|
|
-i=k;for(l=k+1;l<e;i++,l++)h[i]=h[l];e--;m=2*e}}return d?g:f};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(a){a=this.getUtoTmapping(a);return this.getPoint(a)};THREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPoint(b/a));return c};THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPointAt(b/a));return c};
|
|
|
+void 0,r=a[h[i]].x,t=a[h[i]].y,p=a[h[k]].x,s=a[h[k]].y,q=a[h[l]].x,u=a[h[l]].y;if(1E-10>(p-r)*(u-t)-(s-t)*(q-r))n=!1;else{var C=void 0,z=void 0,y=void 0,F=void 0,x=void 0,O=void 0,B=void 0,E=void 0,I=void 0,D=void 0,I=E=B=v=w=void 0,C=q-p,z=u-s,y=r-q,F=t-u,x=p-r,O=s-t;for(n=0;n<e;n++)if(!(n===i||n===k||n===l))if(w=a[h[n]].x,v=a[h[n]].y,B=w-r,E=v-t,I=w-p,D=v-s,w-=q,v-=u,I=C*D-z*I,B=x*E-O*B,E=y*v-F*w,-1E-10<=I&&-1E-10<=E&&-1E-10<=B){n=!1;break a}n=!0}}if(n){f.push([a[h[i]],a[h[k]],a[h[l]]]);g.push([h[i],
|
|
|
+h[k],h[l]]);i=k;for(l=k+1;l<e;i++,l++)h[i]=h[l];e--;m=2*e}}return d?g:f};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(a){a=this.getUtoTmapping(a);return this.getPoint(a)};THREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPoint(b/a));return c};THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPointAt(b/a));return c};
|
|
|
THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]};THREE.Curve.prototype.getLengths=function(a){a||(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200);if(this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b=[],c,d=this.getPoint(0),e,f=0;b.push(0);for(e=1;e<=a;e++)c=this.getPoint(e/a),f+=c.distanceTo(d),b.push(f),d=c;return this.cacheArcLengths=b};
|
|
|
THREE.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0;this.getLengths()};THREE.Curve.prototype.getUtoTmapping=function(a,b){var c=this.getLengths(),d=0,e=c.length,f;f=b?b:a*c[e-1];for(var h=0,g=e-1,i;h<=g;)if(d=Math.floor(h+(g-h)/2),i=c[d]-f,0>i)h=d+1;else if(0<i)g=d-1;else{g=d;break}d=g;if(c[d]==f)return d/(e-1);h=c[d];return c=(d+(f-h)/(c[d+1]-h))/(e-1)};THREE.Curve.prototype.getTangent=function(a){var b=a-1E-4,a=a+1E-4;0>b&&(b=0);1<a&&(a=1);b=this.getPoint(b);return this.getPoint(a).clone().sub(b).normalize()};
|
|
|
THREE.Curve.prototype.getTangentAt=function(a){a=this.getUtoTmapping(a);return this.getTangent(a)};
|