1
0
Fork 0
freesewing/packages/brian/dist/browser/bundle.js

1 line
21 KiB
JavaScript
Raw Normal View History

2018-07-19 14:43:27 +00:00
var freesewing_patterns_brian=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=22)}([function(t,e,n){"use strict";var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),o=n(2),s=n(15),a=n(23),u=r(n(7));e.Freesewing=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.version="1.0.1",this.pattern=i.Pattern,this.point=o.Point,this.path=s.Path,this.snippet=a.Snippet,this.utils=u}},function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.list={}}return function(t,e,n){e&&r(t.prototype,e),n&&r(t,n)}(t,[{key:"add",value:function(t,e){return void 0===this.list[t]&&(this.list[t]=[]),this.list[t].push(e),this}},{key:"get",value:function(t){return this.list[t].join(" ")}},{key:"render",value:function(){var t="";for(var e in this.list){this.list;t+=" ".concat(e,'="').concat(this.list[e].join(" "),'"')}return t}}]),t}();e.Attributes=i},function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(7),o=n(1),s=function(){function t(e,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.attributes=new o.Attributes,this.x=i.round(e),this.y=i.round(n),this}return function(t,e,n){e&&r(t.prototype,e),n&&r(t,n)}(t,[{key:"dist",value:function(t){var e=this.x-t.x,n=this.y-t.y;return i.round(Math.sqrt(Math.pow(e,2)+Math.pow(n,2)))}},{key:"slope",value:function(t){return(t.y-this.y)/(t.x-this.x)}},{key:"dx",value:function(t){return t.x-this.x}},{key:"dy",value:function(t){return t.y-this.y}},{key:"angle",value:function(t){for(var e=Math.atan2(-1*this.dy(t),this.dx(t));e<0;)e+=2*Math.PI;return i.rad2deg(e)}},{key:"rotate",value:function(e,n){var r=this.dist(n),o=this.angle(n);return new t(n.x+r*Math.cos(i.deg2rad(o+e))*-1,n.y+r*Math.sin(i.deg2rad(o+e)))}},{key:"copy",value:function(){return new t(this.x,this.y)}},{key:"equals",value:function(t){return this.x===t.x&&this.y===t.y}},{key:"flipX",value:function(e){return new t(e.x+this.dx(e),e.y)}},{key:"flipY",value:function(e){return new t(e.x,e.y+this.dy(e))}},{key:"shift",value:function(t,e){var n=this.copy();return n.x+=e,n.rotate(t,this)}},{key:"shiftTowards",value:function(t,e){return this.shift(this.angle(t),e)}},{key:"shiftFractionTowards",value:function(t,e){return this.shiftTowards(t,this.dist(t)*e)}},{key:"shiftOutwards",value:function(t,e){return this.shiftTowards(t,this.dist(t)+e)}}]),t}();e.Point=s},function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!