diff --git a/packages/brian/config/config.js b/packages/brian/config/config.js index 6b88fa7a9eb..8121ba8889d 100644 --- a/packages/brian/config/config.js +++ b/packages/brian/config/config.js @@ -1,9 +1,9 @@ /** Pattern parts */ module.exports = { parts: [ - "backBlock", - "frontBlock", - "_sleeveBlock" + "back", + "front", + "_sleeve" ], measurements: [ "bicepsCircumference", @@ -37,7 +37,7 @@ module.exports = { // Percentages { "id": "acrossBackFactor", "val": 96, "type": "percentage", "min": 93, "max": 99 }, - { "id": "armholeDepthFactor", "val": 50, "type": "percentage", "min": 50, "max": 65 }, + { "id": "armholeDepthFactor", "val": 50, "type": "percentage", "min": 35, "max": 65 }, { "id": "sleevecapHeightFactor", "val": 55, "type": "percentage", "min": 35, "max": 75 } ] }; diff --git a/packages/brian/dist/browser/bundle.js b/packages/brian/dist/browser/bundle.js index eb0b0cb6956..49853b0f327 100644 --- a/packages/brian/dist/browser/bundle.js +++ b/packages/brian/dist/browser/bundle.js @@ -1 +1 @@ -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;n0){var p=!0,d=!1,v=void 0;try{for(var y,m=e.options[Symbol.iterator]();!(p=(y=m.next()).done);p=!0){var b=y.value;"percentage"===b.type?this.options[b.id]=b.val/100:this.options[b.id]=b.val}}catch(t){d=!0,v=t}finally{try{p||null==m.return||m.return()}finally{if(d)throw v}}}return this}return function(t,e,n){e&&r(t.prototype,e),n&&r(t,n)}(t,[{key:"draft",value:function(){throw Error("You have to implement the draft() method in your Pattern instance.")}},{key:"render",value:function(){return this.hooks.attach("preRenderSvg",this.svg),this.hooks.attach("postRenderSvg",this.svg),this.svg.render(this)}},{key:"on",value:function(t,e){void 0===this.hooks._hooks[t]&&(this.hooks._hooks[t]=[]),this.hooks._hooks[t].push(e)}},{key:"loadPlugin",value:function(t){var e=!0,n=!1,r=void 0;try{for(var o,i=this.hooks.all[Symbol.iterator]();!(e=(o=i.next()).done);e=!0){var s=o.value;"function"==typeof t[s]&&this.on(s,t[s])}}catch(t){n=!0,r=t}finally{try{e||null==i.return||i.return()}finally{if(n)throw r}}}}]),t}();e.Pattern=c},,,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2);function o(t){return Math.round(100*t)/100}function i(t,e,n,o){var i=t.slope(e),s=n.slope(o);if(i===s)return!1;if(t.x===e.x)return new r.Point(t.x,s*t.x+(n.y-s*n.x));if(n.x===o.x)return new r.Point(n.x,i*n.x+(t.y-i*t.x));if(t.x>e.x){var a=t.copy();t=e.copy(),e=a}if(n.x>o.x){var u=n.copy();n=o.copy(),o=u}var c=t.y-i*t.x,l=(n.y-s*n.x-c)/(i-s),h=i*l+c;return new r.Point(l,h)}e.round=o,e.rad2deg=function(t){return 57.29577951308232*t},e.deg2rad=function(t){return t/57.29577951308232},e.beamsCross=i,e.linesCross=function(t,e,n,r){var s=i(t,e,n,r);if(s){var a=t.dist(e),u=n.dist(r),c=t.dist(s)+s.dist(e),l=n.dist(s)+s.dist(r);if(o(a)==o(c)&&o(u)==o(l))return s}return!1}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=new(n(0).Freesewing);e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(n(8));n(3);var o={draft:function(t){!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var e=t.settings.measurements||{},n=t.options,o=(t.values,t.parts.backBlock.points),i=t.parts.backBlock.paths,s=(t.parts.backBlock.snippets,r.default);o.cbNeck=new s.point(0,n.backNeckCutout),o.cbShoulder=new s.point(0,o.cbNeck.y+(e.shoulderSlope-n.shoulderSlopeReduction)/2),o.cbArmhole=new s.point(0,o.cbShoulder.y+(e.bicepsCircumference+n.bicepsEase)*n.armholeDepthFactor),o.cbWaist=new s.point(0,e.centerBackNeckToWaist+n.backNeckCutout),o.cbHips=new s.point(0,o.cbWaist.y+e.naturalWaistToHip),o.armhole=new s.point(e.chestCircumference/4+n.chestEase/4,o.cbArmhole.y),o.waist=new s.point(o.armhole.x,o.cbWaist.y),o.hips=new s.point(o.armhole.x,o.cbHips.y),o.neck=new s.point(e.neckCircumference/n.collarFactor,0),o.shoulder=new s.point(e.shoulderToShoulder/2+n.shoulderEase/2,o.cbShoulder.y),o.armholePitch=new s.point(e.shoulderToShoulder*n.acrossBackFactor/2,o.armhole.y/2-o.shoulder.y/2),o._tmp1=new s.point(o.armholePitch.x,o.armhole.y),o._tmp2=o._tmp1.shift(45,10),o._tmp3=s.utils.beamsCross(o._tmp1,o._tmp2,o.armhole,o.armholePitch),o.armholeHollow=o._tmp1.shiftFractionTowards(o._tmp3,.5),o.armholeCp1=o.armhole.shift(180,o._tmp1.dx(o.armhole)/4),o.armholeCp2=o.armholeHollow.shift(-45,o.armholeHollow.dy(o.armhole)/2),o.armholeHollowCp1=o.armholeHollow.shift(135,o.armholePitch.dx(o.armholeHollow)),o.armholeHollowCp2=o.armholePitch.shift(-90,o.armholePitch.dy(o.armholeHollow)/2),o.armholePitchCp1=o.armholePitch.shift(90,o.shoulder.dy(o.armholePitch)/2),o.armholePitchCp2=o.shoulder.shiftTowards(o.neck,10),console.log(o.shoulder.shiftTowards(o.neck,10)),console.log(o.shoulder.shiftTowards(o.neck,10).rotate(o.shoulder,90)),i.seam=(new s.path).move(o.cbShoulder).line(o.cbHips).line(o.hips).line(o.armhole).curve(o.armholeCp1,o.armholeCp2,o.armholeHollow).curve(o.armholeHollowCp1,o.armholeHollowCp2,o.armholePitch).curve(o.neck,o.shoulder,o.armholePitch).close(),o.gridAnchor=o.cbHips}};e.default=o},function(t,e,n){"use strict";t.exports={parts:["backBlock","frontBlock","_sleeveBlock"],measurements:["bicepsCircumference","centerBackNeckToWaist","chestCircumference","naturalWaistToHip","neckCircumference","shoulderSlope","shoulderToShoulder","hipsCircumference","shoulderToWrist","wristCircumference"],options:[{id:"backNeckCutout",val:20,type:"constant"},{id:"bicepsEase",val:50,type:"constant"},{id:"collarEase",val:15,type:"constant"},{id:"frontArmholeExtra",val:5,type:"constant"},{id:"shoulderSlopeReduction",val:0,type:"constant"},{id:"sleevecapEase",val:5,type:"constant"},{id:"collarFactor",val:4.8,type:"constant"},{id:"bicepsEase",val:50,min:30,max:80},{id:"chestEase",val:30,min:-40,max:160},{id:"shoulderEase",val:0,min:-20,max:60},{id:"cuffEase",val:45,min:0,max:100},{id:"lengthBonus",val:0,min:-40,max:120},{id:"sleeveLengthBonus",val:0,min:-40,max:80},{id:"acrossBackFactor",val:96,type:"percentage",min:93,max:99},{id:"armholeDepthFactor",val:50,type:"percentage",min:50,max:65},{id:"sleevecapHeightFactor",val:55,type:"percentage",min:35,max:75}]}},,,,,function(t,e,n){"use strict";function r(t,e){for(var n=0;n',this.attributes.add("xmlns","http://www.w3.org/2000/svg"),this.attributes.add("xmlns:svg","http://www.w3.org/2000/svg"),this.attributes.add("xmlns:xlink","http://www.w3.org/1999/xlink"),this.hooks=["preRenderSvg","postRenderSvg"],s.default)this[n]=s.default[n];for(var r in this.hooks)this.hook(r,this[r]);return this}return function(t,e,n){e&&r(t.prototype,e),n&&r(t,n)}(t,[{key:"preRenderSvg",value:function(){}},{key:"postRenderSvg",value:function(){}},{key:"render",value:function(t){for(var e in this.preRenderSvg(),this.svg=this.prefix,this.svg+=this.renderComments(this.header),this.svg+=this.renderSvgTag(t),this.svg+=this.renderStyle(),this.svg+=this.renderScript(),this.svg+=this.renderDefs(),this.svg+=this.openGroup("draftContainer"),t.parts){var n=t.parts[e];n.render&&(this.svg+=this.openGroup(n.id,n.attributes),this.svg+=this.renderPart(n),this.svg+=this.closeGroup())}return this.svg+=this.closeGroup(),this.svg+=this.nl()+"",this.svg+=this.renderComments(this.footer),this.postRenderSvg(),this.svg}},{key:"renderSvgTag",value:function(t){var e=""+this.nl()}},{key:"renderStyle",value:function(){var t='"+this.nl()}},{key:"renderScript",value:function(){var t='