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

1 line
61 KiB
JavaScript
Raw Normal View History

2018-07-16 15:21:26 +00:00
var freesewing_patterns_brian=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=22)}([function(t,e,r){"use strict";var n=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.preRender=function(e,r){t.prototype.preRender.call(this,e,r),r.style+="\n path { fill: none; stroke: #000000; stroke-opacity:1; stroke-width: 0.5; stroke-miterlimit:4; stroke-dashoffset:0; stroke-linecap:round; stroke-linejoin:round; }\n path.hidden { fill: none; stroke: none; }\n "},e}(r(6).Theme);e.Sample=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){this.list=[]}return t.prototype.add=function(t,e){return this.list.push({name:t,value:e}),this},t.prototype.render=function(){for(var t="",e=0,r=this.list;e<r.length;e++){var n=r[e];t+=" "+n.name+'="'+n.value+'"'}return t},t}();e.Attributes=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(7),i=r(1),o=function(){function t(t,e){return this.attributes=new i.Attributes,this.x=n.round(t),this.y=n.round(e),this}return t.prototype.dist=function(t){var e=this.x-t.x,r=this.y-t.y;return n.round(Math.sqrt(Math.pow(e,2)+Math.pow(r,2)))},t.prototype.slope=function(t){return(t.y-this.y)/(t.x-this.x)},t.prototype.dx=function(t){return t.x-this.x},t.prototype.dy=function(t){return t.y-this.y},t.prototype.angle=function(t){for(var e=Math.atan2(-1*this.dy(t),this.dx(t));e<0;)e+=2*Math.PI;return n.rad2deg(e)},t.prototype.rotate=function(e,r){var i=this.dist(r),o=this.angle(r);return new t(r.x+i*Math.cos(n.deg2rad(o+e))*-1,r.y+i*Math.sin(n.deg2rad(o+e)))},t.prototype.copy=function(){return new t(this.x,this.y)},t.prototype.equals=function(t){return this.x===t.x&&this.y===t.y},t.prototype.flipX=function(e){return new t(e.x+this.dx(e),e.y)},t.prototype.flipY=function(e){return new t(e.x,e.y+this.dy(e))},t.prototype.shift=function(t,e){var r=this.copy();return r.x+=e,r.rotate(t,this)},t.prototype.shiftTowards=function(t,e){return this.shift(this.angle(t),e)},t.prototype.shiftFractionTowards=function(t,e){return this.shiftTowards(t,this.dist(t)*e)},t.prototype.shiftOutwards=function(t,e){return this.shiftTowards(t,this.dist(t)+e)},t}();e.Point=o},function(t,e,r){"use strict";var n=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(21),o=r(20),s=n(r(19)),a=function(){function t(t){this.svg=new o.Svg,this.themes=s.default,this.values={},this.settings={mode:"draft",units:"metric"},this.config=t,this.parts={};for(var e=0,r=t.parts;e<r.length;e++){var n=r[e];this.parts[n]=new i.Part(n)}this.options={};for(var a=0,c=t.options;a<c.length;a++){var l=c[a];"percentage"===l.type?this.options[l.id]=l.val/100:this.options[l.id]=l.val}return this}return t.prototype.draft=function(){throw Error("You have to implement the draft()