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

1 line
20 KiB
JavaScript
Raw Normal View History

var freesewing_patterns_brian=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.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 o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));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 o=n(3),i=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=o.Pattern,this.point=i.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 o=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 this.list.push({name:t,value:e}),this}},{key:"render",value:function(){var t="",e=!0,n=!1,r=void 0;try{for(var o,i=this.list[Symbol.iterator]();!(e=(o=i.next()).done);e=!0){var s=o.value;t+=" ".concat(s.name,'="').concat(s.value,'"')}}catch(t){n=!0,r=t}finally{try{e||null==i.return||i.return()}finally{if(n)throw r}}return t}}]),t}();e.Attributes=o},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 o=n(7),i=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 i.Attributes,this.x=o.round(e),this.y=o.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 o.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 o.rad2deg(e)}},{key:"rotate",value:function(e,n){var r=this.dist(n),i=this.angle(n);return new t(n.x+r*Math.cos(o.deg2rad(i+e))*-1,n.y+r*Math.sin(o.deg2rad(i+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.enu