added hungry option
This commit is contained in:
parent
1d6d43a7e2
commit
2442c61ae4
8 changed files with 314 additions and 299 deletions
|
@ -9,7 +9,7 @@ export default {
|
|||
type: 'pattern',
|
||||
difficulty: 4,
|
||||
optionGroups: {
|
||||
style: ['size','nosePointiness','aggressive'],
|
||||
style: ['size','hungry','nosePointiness','aggressive'],
|
||||
},
|
||||
measurements: ['neck'],
|
||||
parts: ['body','tail','aboveMouth','belly','topFin','bottomFin','mouth','lowerTeeth','upperTeeth'],
|
||||
|
@ -24,8 +24,9 @@ export default {
|
|||
inject: {},
|
||||
hide: [],
|
||||
options: {
|
||||
size: {pct: 100, min: 5, max: 500 },
|
||||
hungry: {pct: 50, min: 0, max: 100 },
|
||||
nosePointiness: {pct: 0, min: -5,max: +10},
|
||||
aggressive: {bool: false},
|
||||
size: {pct: 33, min: 5, max: 500 },
|
||||
},
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ export default function (part) {
|
|||
macro,
|
||||
} = part.shorthand()
|
||||
|
||||
|
||||
let aboveMouth01_02d = 266.7238454769277 * options.size
|
||||
let aboveMouth01_02a = 353.4089695458119
|
||||
let aboveMouth02_03d = 28.348200101593726 * options.size
|
||||
|
@ -30,7 +29,6 @@ export default function (part) {
|
|||
let aboveMouth03cp1a = 197.87876803095696
|
||||
let aboveMouth04cp2d = 66.94005927693816 * options.size
|
||||
let aboveMouth04cp2a = 308.8121959753343
|
||||
|
||||
|
||||
let faceTopLength = store.get('faceTopLength')
|
||||
|
||||
|
@ -46,6 +44,7 @@ export default function (part) {
|
|||
points.aboveMouth02cp2 = points.aboveMouth02.shift(aboveMouth02cp2a, aboveMouth02cp2d)
|
||||
points.aboveMouth03cp1 = points.aboveMouth03.shift(aboveMouth03cp1a, aboveMouth03cp1d)
|
||||
points.aboveMouth04cp2 = points.aboveMouth04.shift(aboveMouth04cp2a, aboveMouth04cp2d)
|
||||
|
||||
diff =
|
||||
faceTopLength -
|
||||
new Path()
|
||||
|
@ -58,8 +57,6 @@ export default function (part) {
|
|||
iteration++
|
||||
} while ((diff < -1 || diff > 1) && iteration < 100)
|
||||
|
||||
console.log({ iteration: iteration })
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.aboveMouth01)
|
||||
.line(points.aboveMouth04)
|
||||
|
@ -68,14 +65,6 @@ export default function (part) {
|
|||
.curve(points.aboveMouth02cp2, points.aboveMouth01cp1, points.aboveMouth01)
|
||||
.close()
|
||||
|
||||
console.log({ faceTopLength1: store.get('faceTopLength') })
|
||||
console.log({
|
||||
faceTopLength2: new Path()
|
||||
.move(points.aboveMouth03)
|
||||
.curve(points.aboveMouth03cp1, points.aboveMouth04cp2, points.aboveMouth04)
|
||||
.length(),
|
||||
})
|
||||
|
||||
store.set(
|
||||
'aboveMouthTopLength',
|
||||
new Path()
|
||||
|
@ -91,20 +80,15 @@ export default function (part) {
|
|||
.length()
|
||||
)
|
||||
store.set('aboveMouthFinLength', points.aboveMouth02.dist(points.aboveMouth03))
|
||||
console.log({ aboveMouthFinLength: store.get('aboveMouthFinLength') })
|
||||
|
||||
console.log({ mouthTopLength: store.get('mouthTopLength') })
|
||||
|
||||
points.aboveMouthSnippet = new Path()
|
||||
.move(points.aboveMouth01)
|
||||
.curve(points.aboveMouth01cp1, points.aboveMouth02cp2, points.aboveMouth02)
|
||||
.shiftAlong(store.get('mouthTopLength'))
|
||||
console.log({ aboveMouthSnippet: points.aboveMouthSnippet })
|
||||
|
||||
snippets.mouth = new Snippet('bnotch', points.aboveMouthSnippet)
|
||||
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
points.aboveMouthSnippet = new Path()
|
||||
.move(points.aboveMouth01)
|
||||
.curve(points.aboveMouth01cp1, points.aboveMouth02cp2, points.aboveMouth02)
|
||||
.shiftAlong(store.get('mouthTopLength'))
|
||||
snippets.mouth = new Snippet('bnotch', points.aboveMouthSnippet)
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
||||
}
|
||||
|
|
|
@ -65,6 +65,12 @@ export default function (part) {
|
|||
points.belly03 = points.belly02.shift(belly02_03a, belly02_03d)
|
||||
points.belly04 = points.belly03.shift(belly03_04a, belly03_04d)
|
||||
points.belly05 = points.belly10.shift(belly10_05a, belly10_05d)
|
||||
|
||||
points.belly01.y = points.belly01.y *(1.1 -(options.hungry /5))
|
||||
points.belly02.y = points.belly02.y *(1.1 -(options.hungry /5))
|
||||
points.belly03.y = points.belly03.y *(1.1 -(options.hungry /5))
|
||||
points.belly04.y = points.belly04.y *(1.1 -(options.hungry /5))
|
||||
|
||||
points.belly01cp1 = points.belly01.shift(belly01cp1a, belly01cp1d)
|
||||
points.belly02cp1 = points.belly02.shift(belly02cp1a, belly02cp1d)
|
||||
points.belly03cp1 = points.belly03.shift(belly03cp1a, belly03cp1d)
|
||||
|
@ -77,21 +83,11 @@ export default function (part) {
|
|||
points.belly05cp2 = points.belly05.shift(belly05cp2a, belly05cp2d)
|
||||
points.belly10cp1 = points.belly10.shift(belly10cp2a, belly10cp2d)
|
||||
|
||||
console.log({ belly10_05d: points.belly10.dist(points.belly05) })
|
||||
|
||||
let mouthPartLength =
|
||||
store.get('aboveMouthBottomLength') -
|
||||
store.get('mouthTopLength') +
|
||||
store.get('mouthBottomLength')
|
||||
|
||||
console.log({ calc: mouthPartLength })
|
||||
console.log({
|
||||
actual: new Path()
|
||||
.move(points.belly01)
|
||||
.curve(points.belly01cp1, points.belly02cp2, points.belly02)
|
||||
.length(),
|
||||
})
|
||||
|
||||
let diff = 0
|
||||
let iteration = 0
|
||||
do {
|
||||
|
@ -109,13 +105,6 @@ export default function (part) {
|
|||
} while ((diff < -1 || diff > 1) && iteration < 100)
|
||||
|
||||
let bellyTailLength = store.get('bellyTailLength')
|
||||
console.log({ bellyTailLength: store.get('bellyTailLength') })
|
||||
console.log({
|
||||
first: new Path()
|
||||
.move(points.belly03)
|
||||
.curve(points.belly03cp1, points.belly04cp2, points.belly04)
|
||||
.length(),
|
||||
})
|
||||
|
||||
diff = 0
|
||||
iteration = 0
|
||||
|
@ -134,15 +123,8 @@ export default function (part) {
|
|||
.curve(points.belly03cp1, points.belly04cp2, points.belly04)
|
||||
.length()
|
||||
|
||||
console.log({
|
||||
actual: new Path()
|
||||
.move(points.belly03)
|
||||
.curve(points.belly03cp1, points.belly04cp2, points.belly04)
|
||||
.length(),
|
||||
})
|
||||
} while ((diff < -1 || diff > 1) && iteration < 100)
|
||||
|
||||
|
||||
points.belly05cp1 = points.belly05cp2.flipY()
|
||||
points.belly06 = points.belly04.flipY()
|
||||
points.belly06cp1 = points.belly04cp2.flipY()
|
||||
|
@ -179,23 +161,20 @@ export default function (part) {
|
|||
.curve(points.belly02cp1, points.belly03cp2, points.belly03)
|
||||
.length()
|
||||
)
|
||||
console.log({ bellyFinLength: store.get('bellyFinLength') })
|
||||
|
||||
points.bellyMouthSnippet1 = new Path()
|
||||
.move(points.belly01)
|
||||
.curve(points.belly01cp1, points.belly02cp2, points.belly02)
|
||||
.shiftAlong(store.get('mouthBottomLength'))
|
||||
points.bellyMouthSnippet2 = points.bellyMouthSnippet1.flipY()
|
||||
|
||||
console.log({ aboveMouthSnippet: points.aboveMouthSnippet })
|
||||
|
||||
snippets.mouth1 = new Snippet('bnotch', points.bellyMouthSnippet1)
|
||||
snippets.mouth2 = new Snippet('bnotch', points.bellyMouthSnippet2)
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
points.bellyMouthSnippet1 = new Path()
|
||||
.move(points.belly01)
|
||||
.curve(points.belly01cp1, points.belly02cp2, points.belly02)
|
||||
.shiftAlong(store.get('mouthBottomLength'))
|
||||
points.bellyMouthSnippet2 = points.bellyMouthSnippet1.flipY()
|
||||
|
||||
snippets.mouth1 = new Snippet('bnotch', points.bellyMouthSnippet1)
|
||||
snippets.mouth2 = new Snippet('bnotch', points.bellyMouthSnippet2)
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
||||
paths.sa = paths.seam.offset(sa).trim().attr('class', 'fabric sa')
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,76 +13,76 @@ export default function (part) {
|
|||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
utils,
|
||||
} = part.shorthand()
|
||||
|
||||
|
||||
let body01_02d = 117.67274991262845 * options.size
|
||||
let body02_03d = 124.91298035032229 * options.size
|
||||
// let body02_03d = body01_02d
|
||||
let body03_04d = 255.92397474640785 * options.size
|
||||
let body04_05d = 201.01260719168837 * options.size
|
||||
let body05_06d = 134.89080971660005 * options.size
|
||||
let body06_07d = 49.03860703568160 * options.size
|
||||
let body06_07d = 49.0386070356816 * options.size
|
||||
let body07_08d = 225.86340480918992 * options.size
|
||||
let body08_09d = 66.84760000179512 * options.size
|
||||
let body09_10d = 40.72782003741420 * options.size
|
||||
let body10_11d = 23.78799421977402 * options.size
|
||||
let body11_12d = 57.68530918700182 * options.size
|
||||
let body12_13d = 98.06623978209830 * options.size
|
||||
let body13_14d = 91.32736600274856 * options.size
|
||||
let body14_15d = 295.10977066828880 * options.size
|
||||
let body15_16d = 209.42633350581770 * options.size
|
||||
let body08_09d = 66.84760000179512 * options.size
|
||||
let body09_10d = 40.7278200374142 * options.size
|
||||
let body10_11d = 23.78799421977402 * options.size
|
||||
let body11_12d = 57.68530918700182 * options.size
|
||||
let body12_13d = 98.0662397820983 * options.size
|
||||
let body13_14d = 91.32736600274856 * options.size
|
||||
let body14_15d = 295.1097706682888 * options.size
|
||||
let body15_16d = 209.4263335058177 * options.size
|
||||
let body16_17d = 152.51537318250902 * options.size
|
||||
let body17_18d = 255.15294373571314 * options.size
|
||||
let body18_19d = 71.90453921693678 * options.size
|
||||
let body19_01d = 61.33021195137026 * options.size
|
||||
let body18_19d = 71.90453921693678 * options.size
|
||||
let body19_01d = 61.33021195137026 * options.size
|
||||
|
||||
let body01cp1d = 42.13103487929059 * options.size
|
||||
body01cp1d = 32.13103487929059 * options.size
|
||||
let body01cp2d = 23.72518967258217 * options.size
|
||||
let body02cp1d = 44.99353642469105 * options.size
|
||||
let body02cp2d = 42.33568754608812 * options.size
|
||||
let body03cp1d = 62.59332758369697 * options.size
|
||||
let body03cp2d = 40.89285869195256 * options.size
|
||||
let body01cp1d = 42.13103487929059 * options.size
|
||||
body01cp1d = 32.13103487929059 * options.size
|
||||
let body01cp2d = 23.72518967258217 * options.size
|
||||
let body02cp1d = 44.99353642469105 * options.size
|
||||
let body02cp2d = 42.33568754608812 * options.size
|
||||
let body03cp1d = 62.59332758369697 * options.size
|
||||
let body03cp2d = 40.89285869195256 * options.size
|
||||
let body04cp1d = 176.21501525125487 * options.size
|
||||
let body04cp2d = 130.11389715553065 * options.size
|
||||
let body05cp1d = 29.56689479806765 * options.size
|
||||
let body05cp1d = 29.56689479806765 * options.size
|
||||
let body05cp2d = 104.66860665930352 * options.size
|
||||
let body06cp1d = 8.03497915367552 * options.size
|
||||
let body06cp2d = 34.57808908832297 * options.size
|
||||
let body07cp1d = 89.11908088619404 * options.size
|
||||
let body07cp2d = 25.54827831772624 * options.size
|
||||
let body08cp1d = 41.24120086757895 * options.size
|
||||
let body06cp1d = 8.03497915367552 * options.size
|
||||
let body06cp2d = 34.57808908832297 * options.size
|
||||
let body07cp1d = 89.11908088619404 * options.size
|
||||
let body07cp2d = 25.54827831772624 * options.size
|
||||
let body08cp1d = 41.24120086757895 * options.size
|
||||
let body08cp2d = 158.23693200387828 * options.size
|
||||
let body09cp1d = 4.87663090668135 * options.size
|
||||
let body09cp2d = 25.76988630165065 * options.size
|
||||
let body10cp1d = 4.13950105689086 * options.size
|
||||
let body10cp2d = 13.27508493381490 * options.size
|
||||
let body11cp1d = 17.66659910678904 * options.size
|
||||
let body11cp2d = 17.66533107530116 * options.size
|
||||
let body12cp1d = 14.46914569005365 * options.size
|
||||
let body12cp2d = 39.51915145850176 * options.size
|
||||
let body13cp1d = 35.66832366400192 * options.size
|
||||
let body13cp2d = 48.53828530139895 * options.size
|
||||
let body14cp1d = 77.26036056089820 * options.size
|
||||
let body14cp2d = 37.42741381661305 * options.size
|
||||
let body15cp1d = 74.89746640634775 * options.size
|
||||
let body09cp1d = 4.87663090668135 * options.size
|
||||
let body09cp2d = 25.76988630165065 * options.size
|
||||
let body10cp1d = 4.13950105689086 * options.size
|
||||
let body10cp2d = 13.2750849338149 * options.size
|
||||
let body11cp1d = 17.66659910678904 * options.size
|
||||
let body11cp2d = 17.66533107530116 * options.size
|
||||
let body12cp1d = 14.46914569005365 * options.size
|
||||
let body12cp2d = 39.51915145850176 * options.size
|
||||
let body13cp1d = 35.66832366400192 * options.size
|
||||
let body13cp2d = 48.53828530139895 * options.size
|
||||
let body14cp1d = 77.2603605608982 * options.size
|
||||
let body14cp2d = 37.42741381661305 * options.size
|
||||
let body15cp1d = 74.89746640634775 * options.size
|
||||
let body15cp2d = 101.16048880857042 * options.size
|
||||
let body16cp1d = 36.21092864039804 * options.size
|
||||
let body16cp2d = 63.69410844026312 * options.size
|
||||
let body17cp1d = 97.90988675818191 * options.size
|
||||
let body17cp2d = 62.08991689477443 * options.size
|
||||
let body18cp1d = 22.74982929606286 * options.size
|
||||
let body18cp2d = 16.57960183478481 * options.size
|
||||
let body19cp1d = 23.95674278778315 * options.size
|
||||
let body19cp2d = 24.49741270011998 * options.size
|
||||
let body16cp1d = 36.21092864039804 * options.size
|
||||
let body16cp2d = 63.69410844026312 * options.size
|
||||
let body17cp1d = 97.90988675818191 * options.size
|
||||
let body17cp2d = 62.08991689477443 * options.size
|
||||
let body18cp1d = 22.74982929606286 * options.size
|
||||
let body18cp2d = 16.57960183478481 * options.size
|
||||
let body19cp1d = 23.95674278778315 * options.size
|
||||
let body19cp2d = 24.49741270011998 * options.size
|
||||
|
||||
let eyeBigDist = 180.18315182058507 *options.size
|
||||
let eyeSmallDist = 2.3629811679317316 *options.size
|
||||
let eyeBigDist = 180.18315182058507 * options.size
|
||||
let eyeSmallDist = 2.3629811679317316 * options.size
|
||||
|
||||
let gillLength = 41.01907104018812 *options.size
|
||||
let gillLength = 41.01907104018812 * options.size
|
||||
|
||||
/*
|
||||
/*
|
||||
let body01_02a = 350.1382392835908
|
||||
let body02_03a = 219.2280235992150
|
||||
let body03_04a = 339.6914424367389
|
||||
|
@ -149,71 +149,71 @@ export default function (part) {
|
|||
*/
|
||||
|
||||
let body01_02a = 170.1382393
|
||||
let body02_03a = 39.2280236
|
||||
let body03_04a = 159.6914424
|
||||
let body04_05a = 147.5949161
|
||||
let body05_06a = 128.0581973
|
||||
let body06_07a = 253.6604388
|
||||
let body07_08a = 225.7462208
|
||||
let body08_09a = 157.5894683
|
||||
let body09_10a = 125.1280145
|
||||
let body10_11a = 242.0485099
|
||||
let body11_12a = 211.5926663
|
||||
let body12_13a = 171.354716
|
||||
let body13_14a = 245.2915054
|
||||
let body14_15a = 326.7578209
|
||||
let body15_16a = 359.0692249
|
||||
let body16_17a = 353.6138832
|
||||
let body17_18a = 2.546389668
|
||||
let body18_19a = 348.3450181
|
||||
let body19_01a = 59.63482522
|
||||
let body02_03a = 39.2280236
|
||||
let body03_04a = 159.6914424
|
||||
let body04_05a = 147.5949161
|
||||
let body05_06a = 128.0581973
|
||||
let body06_07a = 253.6604388
|
||||
let body07_08a = 225.7462208
|
||||
let body08_09a = 157.5894683
|
||||
let body09_10a = 125.1280145
|
||||
let body10_11a = 242.0485099
|
||||
let body11_12a = 211.5926663
|
||||
let body12_13a = 171.354716
|
||||
let body13_14a = 245.2915054
|
||||
let body14_15a = 326.7578209
|
||||
let body15_16a = 359.0692249
|
||||
let body16_17a = 353.6138832
|
||||
let body17_18a = 2.546389668
|
||||
let body18_19a = 348.3450181
|
||||
let body19_01a = 59.63482522
|
||||
|
||||
let body01cp1a = 161.5263465
|
||||
let body01cp2a = 255.6503959
|
||||
let body02cp1a = 31.95354992
|
||||
// let body02cp2a = 359.48842
|
||||
// let body02cp2a = 2.48842
|
||||
let body02cp2a = 10
|
||||
let body01cp1a = 161.5263465
|
||||
let body01cp2a = 255.6503959
|
||||
let body02cp1a = 31.95354992
|
||||
// let body02cp2a = 359.48842
|
||||
// let body02cp2a = 2.48842
|
||||
let body02cp2a = 10
|
||||
|
||||
let body03cp1a = 142.8538439
|
||||
let body03cp2a = 225.3745028
|
||||
let body04cp1a = 169.1071046
|
||||
let body04cp2a = 350.7775897
|
||||
let body05cp1a = 105.1596015
|
||||
let body05cp2a = 288.5890112
|
||||
let body06cp1a = 221.1852544
|
||||
let body06cp2a = 344.141322
|
||||
let body07cp1a = 267.2041495
|
||||
let body07cp2a = 87.03164984
|
||||
let body08cp1a = 177.4386949
|
||||
let body08cp2a = 358.5040423
|
||||
let body09cp1a = 119.4140746
|
||||
let body09cp2a = 299.4139506
|
||||
let body10cp1a = 219.0878163
|
||||
let body10cp2a = 311.9955535
|
||||
let body11cp1a = 251.2799387
|
||||
let body11cp2a = 71.28196954
|
||||
let body12cp1a = 175.0877187
|
||||
let body12cp2a = 355.087783
|
||||
let body13cp1a = 260.2392636
|
||||
let body13cp2a = 351.4909474
|
||||
let body14cp1a = 320.929847
|
||||
let body14cp2a = 56.95148863
|
||||
let body15cp1a = 22.55298719
|
||||
let body15cp2a = 153.1212844
|
||||
let body16cp1a = 13.89041491
|
||||
let body16cp2a = 141.0219905
|
||||
let body17cp1a = 11.04287338
|
||||
let body17cp2a = 138.4852424
|
||||
let body18cp1a = 356.968813
|
||||
let body18cp2a = 178.1542839
|
||||
let body19cp1a = 51.33608313
|
||||
let body19cp2a = 158.5586388
|
||||
let body03cp1a = 142.8538439
|
||||
let body03cp2a = 225.3745028
|
||||
let body04cp1a = 169.1071046
|
||||
let body04cp2a = 350.7775897
|
||||
let body05cp1a = 105.1596015
|
||||
let body05cp2a = 288.5890112
|
||||
let body06cp1a = 221.1852544
|
||||
let body06cp2a = 344.141322
|
||||
let body07cp1a = 267.2041495
|
||||
let body07cp2a = 87.03164984
|
||||
let body08cp1a = 177.4386949
|
||||
let body08cp2a = 358.5040423
|
||||
let body09cp1a = 119.4140746
|
||||
let body09cp2a = 299.4139506
|
||||
let body10cp1a = 219.0878163
|
||||
let body10cp2a = 311.9955535
|
||||
let body11cp1a = 251.2799387
|
||||
let body11cp2a = 71.28196954
|
||||
let body12cp1a = 175.0877187
|
||||
let body12cp2a = 355.087783
|
||||
let body13cp1a = 260.2392636
|
||||
let body13cp2a = 351.4909474
|
||||
let body14cp1a = 320.929847
|
||||
let body14cp2a = 56.95148863
|
||||
let body15cp1a = 22.55298719
|
||||
let body15cp2a = 153.1212844
|
||||
let body16cp1a = 13.89041491
|
||||
let body16cp2a = 141.0219905
|
||||
let body17cp1a = 11.04287338
|
||||
let body17cp2a = 138.4852424
|
||||
let body18cp1a = 356.968813
|
||||
let body18cp2a = 178.1542839
|
||||
let body19cp1a = 51.33608313
|
||||
let body19cp2a = 158.5586388
|
||||
|
||||
let eyeBigAngle = 184.8499937
|
||||
let eyeSmallAngle = 151.2656912
|
||||
let eyeBigAngle = 184.8499937
|
||||
let eyeSmallAngle = 151.2656912
|
||||
|
||||
let gillAngle = 103.9416747
|
||||
let gillAngle = 103.9416747
|
||||
|
||||
points.body01 = new Point(0, 0)
|
||||
points.body02 = points.body01.shift(body01_02a, body01_02d)
|
||||
|
@ -288,10 +288,6 @@ let gillAngle = 103.9416747
|
|||
points.body01.angle(points.body01cp2) + 90 * (-1 + options.nosePointiness),
|
||||
points.body01.angle(points.body02) - 5
|
||||
)
|
||||
console.log({pointiness: options.nosePointiness})
|
||||
console.log({pointiness_a: points.body01.angle(points.body01cp2)})
|
||||
console.log({pointiness_a: points.body01.angle(points.body01cp2) +90 * (-1 + options.nosePointiness)})
|
||||
console.log({pointiness_m: points.body01.angle(points.body02) - 5})
|
||||
|
||||
points.body01cp1 = points.body01.shift(body01cp1a, body01cp1d)
|
||||
|
||||
|
@ -316,9 +312,6 @@ let gillAngle = 103.9416747
|
|||
)
|
||||
|
||||
// Tail adjustment:
|
||||
console.log(points.body13.angle(points.body13cp1) - points.body13.angle(points.body14))
|
||||
console.log(points.body14.angle(points.body13) - points.body14.angle(points.body14cp2))
|
||||
|
||||
let tailCpAngle =
|
||||
(points.body13.angle(points.body13cp1) -
|
||||
points.body13.angle(points.body14) +
|
||||
|
@ -333,21 +326,25 @@ let gillAngle = 103.9416747
|
|||
body13cp1d
|
||||
)
|
||||
|
||||
points.eyeBig = points.body01.shift( eyeBigAngle, eyeBigDist )
|
||||
points.eyeSmall = points.eyeBig.shift( eyeSmallAngle, eyeSmallDist *(-2+(options.aggressive ? 0 : 1)))
|
||||
points.eyeBig = points.body01.shift(eyeBigAngle, eyeBigDist)
|
||||
points.eyeSmall = points.eyeBig.shift(
|
||||
eyeSmallAngle,
|
||||
eyeSmallDist * (-2 + (options.aggressive ? 0 : 1))
|
||||
)
|
||||
|
||||
// Feeding:
|
||||
|
||||
|
||||
let c = 0.55191502449351
|
||||
let eyeBigX = 18.7757 * options.size
|
||||
let eyeBigY = 11.6262 * options.size
|
||||
points.eyeBigT = points.eyeBig.shift(90, eyeBigY / 2)
|
||||
points.eyeBigB = points.eyeBig.shift(270, eyeBigY / 2).shift(
|
||||
0,
|
||||
options.aggressive ? eyeBigX / 3 : 0
|
||||
)
|
||||
points.eyeBigR = points.eyeBig.shift(0, eyeBigX / 2).shift(
|
||||
270,
|
||||
options.aggressive ? eyeBigY / 3 : 0
|
||||
)
|
||||
points.eyeBigB = points.eyeBig
|
||||
.shift(270, eyeBigY / 2)
|
||||
.shift(0, options.aggressive ? eyeBigX / 3 : 0)
|
||||
points.eyeBigR = points.eyeBig
|
||||
.shift(0, eyeBigX / 2)
|
||||
.shift(270, options.aggressive ? eyeBigY / 3 : 0)
|
||||
points.eyeBigL = points.eyeBig.shift(180, eyeBigX / 2)
|
||||
points.eyeBigTcp1 = points.eyeBigT.shift(0, (eyeBigY / 2) * c)
|
||||
points.eyeBigTcp2 = points.eyeBigT.shift(180, (eyeBigY / 2) * c)
|
||||
|
@ -365,8 +362,8 @@ let gillAngle = 103.9416747
|
|||
.curve(points.eyeBigBcp2, points.eyeBigRcp1, points.eyeBigR)
|
||||
.curve(points.eyeBigRcp2, points.eyeBigTcp1, points.eyeBigT)
|
||||
|
||||
let eyeSmallX = 1.87089 * options.size *((options.aggressive ? 1.5 : 1))
|
||||
let eyeSmallY = 1.5368 * options.size *((options.aggressive ? 1.5 : 1))
|
||||
let eyeSmallX = 1.87089 * options.size * (options.aggressive ? 1.5 : 1)
|
||||
let eyeSmallY = 1.5368 * options.size * (options.aggressive ? 1.5 : 1)
|
||||
points.eyeSmallT = points.eyeSmall.shift(270, eyeSmallY / 2)
|
||||
points.eyeSmallB = points.eyeSmall.shift(90, eyeSmallY / 2)
|
||||
points.eyeSmallR = points.eyeSmall.shift(0, eyeSmallX / 2)
|
||||
|
@ -408,48 +405,72 @@ let gillAngle = 103.9416747
|
|||
.curve(points.body17cp1, points.body18cp2, points.body18)
|
||||
.curve(points.body18cp1, points.body19cp2, points.body19)
|
||||
.curve(points.body19cp1, points.body01cp2, points.body01)
|
||||
.close()
|
||||
|
||||
|
||||
let gillPath = new Path()
|
||||
.move(points.body17)
|
||||
.curve(points.body17cp1, points.body18cp2, points.body18)
|
||||
points.gill1s = gillPath.shiftFractionAlong(0.018)
|
||||
points.gill2s = gillPath.shiftFractionAlong(0.08 * 1 + 0.018)
|
||||
points.gill3s = gillPath.shiftFractionAlong(0.08 * 2 + 0.018)
|
||||
points.gill4s = gillPath.shiftFractionAlong(0.08 * 3 + 0.018)
|
||||
points.gill5s = gillPath.shiftFractionAlong(0.08 * 4 + 0.018)
|
||||
points.gill1e = points.gill1s.shift(gillAngle, gillLength *(1 +(0 * 0.08)))
|
||||
points.gill2e = points.gill2s.shift(gillAngle, gillLength *(1 +(1 * 0.08)))
|
||||
points.gill3e = points.gill3s.shift(gillAngle, gillLength *(1 +(2 * 0.08)))
|
||||
points.gill4e = points.gill4s.shift(gillAngle, gillLength *(1 +(3 * 0.08)))
|
||||
points.gill5e = points.gill5s.shift(gillAngle, gillLength *(1 +(4 * 0.08)))
|
||||
points.gill1start = gillPath.shiftFractionAlong(0.018)
|
||||
points.gill2start = gillPath.shiftFractionAlong(0.08 * 1 + 0.018)
|
||||
points.gill3start = gillPath.shiftFractionAlong(0.08 * 2 + 0.018)
|
||||
points.gill4start = gillPath.shiftFractionAlong(0.08 * 3 + 0.018)
|
||||
points.gill5start = gillPath.shiftFractionAlong(0.08 * 4 + 0.018)
|
||||
points.gill1end = points.gill1start.shift(gillAngle, gillLength * (1 + 0 * 0.08))
|
||||
points.gill2end = points.gill2start.shift(gillAngle, gillLength * (1 + 1 * 0.08))
|
||||
points.gill3end = points.gill3start.shift(gillAngle, gillLength * (1 + 2 * 0.08))
|
||||
points.gill4end = points.gill4start.shift(gillAngle, gillLength * (1 + 3 * 0.08))
|
||||
points.gill5end = points.gill5start.shift(gillAngle, gillLength * (1 + 4 * 0.08))
|
||||
|
||||
paths.gill1 = new Path().move(points.gill1s).line(points.gill1e)
|
||||
paths.gill2 = new Path().move(points.gill2s).line(points.gill2e)
|
||||
paths.gill3 = new Path().move(points.gill3s).line(points.gill3e)
|
||||
paths.gill4 = new Path().move(points.gill4s).line(points.gill4e)
|
||||
paths.gill5 = new Path().move(points.gill5s).line(points.gill5e)
|
||||
paths.gill1 = new Path().move(points.gill1start).line(points.gill1end)
|
||||
paths.gill2 = new Path().move(points.gill2start).line(points.gill2end)
|
||||
paths.gill3 = new Path().move(points.gill3start).line(points.gill3end)
|
||||
paths.gill4 = new Path().move(points.gill4start).line(points.gill4end)
|
||||
paths.gill5 = new Path().move(points.gill5start).line(points.gill5end)
|
||||
|
||||
store.set( 'tailWidth', points.body13.dist( points.body14 ) )
|
||||
store.set( 'tailCpAngle', points.body13.angle(points.body13cp1) - points.body13.angle(points.body14) )
|
||||
store.set( 'tailCpDist', body13cp1d )
|
||||
store.set('tailWidth', points.body13.dist(points.body14))
|
||||
store.set(
|
||||
'tailCpAngle',
|
||||
points.body13.angle(points.body13cp1) - points.body13.angle(points.body14)
|
||||
)
|
||||
store.set('tailCpDist', body13cp1d)
|
||||
|
||||
store.set( 'topFinOpening', points.body16.dist( points.body17 ))
|
||||
store.set( 'topFinOpeningLength', (new Path().move(points.body16).curve(points.body16cp1, points.body17cp2, points.body17)).length())
|
||||
store.set('topFinOpening', points.body16.dist(points.body17))
|
||||
store.set(
|
||||
'topFinOpeningLength',
|
||||
new Path().move(points.body16).curve(points.body16cp1, points.body17cp2, points.body17).length()
|
||||
)
|
||||
|
||||
store.set( 'faceTopLength', (new Path().move(points.body17).curve(points.body17cp1, points.body18cp2, points.body18).curve(points.body18cp1, points.body19cp2, points.body19)).length())
|
||||
store.set(
|
||||
'faceTopLength',
|
||||
new Path()
|
||||
.move(points.body17)
|
||||
.curve(points.body17cp1, points.body18cp2, points.body18)
|
||||
.curve(points.body18cp1, points.body19cp2, points.body19)
|
||||
.length()
|
||||
)
|
||||
|
||||
store.set( 'bellyLength', (new Path().move(points.body17).curve(points.body17cp1, points.body18cp2, points.body18).curve(points.body18cp1, points.body19cp2, points.body19)).length())
|
||||
store.set( 'bellyTailLength', (new Path().move(points.body15).curve(points.body15cp1, points.body16cp2, points.body16)).length())
|
||||
store.set(
|
||||
'bellyLength',
|
||||
new Path()
|
||||
.move(points.body17)
|
||||
.curve(points.body17cp1, points.body18cp2, points.body18)
|
||||
.curve(points.body18cp1, points.body19cp2, points.body19)
|
||||
.length()
|
||||
)
|
||||
store.set(
|
||||
'bellyTailLength',
|
||||
new Path().move(points.body15).curve(points.body15cp1, points.body16cp2, points.body16).length()
|
||||
)
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
points.bodyTailSnippet = new Path()
|
||||
.move(points.body13)
|
||||
.curve(points.body13cp1, points.body14cp2, points.body14)
|
||||
.shiftFractionAlong(0.25)
|
||||
.move(points.body13)
|
||||
.curve(points.body13cp1, points.body14cp2, points.body14)
|
||||
.shiftFractionAlong(0.25)
|
||||
snippets.bodyTail = new Snippet('bnotch', points.bodyTailSnippet)
|
||||
if( sa ) {
|
||||
if (sa) {
|
||||
// paths.sa = paths.seam.offset(sa).trim().attr('class', 'fabric sa')
|
||||
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
||||
}
|
||||
|
||||
|
@ -458,6 +479,102 @@ let gillAngle = 103.9416747
|
|||
to: points.body01,
|
||||
d: -5,
|
||||
})
|
||||
|
||||
points.titleAnchor = points.body04.shiftFractionTowards( points.body17, 0.4 )
|
||||
points.logoAnchor = points.body06.shiftFractionTowards( points.body16, 0.6 )
|
||||
|
||||
if( options.size < 0.35 ) {
|
||||
points.scaleboxAnchor = new Point( points.body06.x -60 -sa, points.body11.y -35 -sa )
|
||||
} else {
|
||||
points.scaleboxAnchor = points.titleAnchor.shiftFractionTowards( points.body14, 0.5 )
|
||||
}
|
||||
snippets.logo = new Snippet('logo', points.logoAnchor).attr( 'data-scale', options.size > 1 ? 1 : options.size )
|
||||
|
||||
macro('title', {
|
||||
at: points.titleAnchor,
|
||||
nr: 1,
|
||||
title: 'body',
|
||||
scale: options.size,
|
||||
})
|
||||
|
||||
if (paperless) {
|
||||
macro('hd', {
|
||||
from: points.body14,
|
||||
to: points.body15,
|
||||
y: points.body19.y +sa +10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.body15,
|
||||
to: points.body16,
|
||||
y: points.body19.y +sa +10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.body16,
|
||||
to: points.body17,
|
||||
y: points.body19.y +sa +10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.body17,
|
||||
to: points.body19,
|
||||
y: points.body19.y +sa +10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.body19,
|
||||
to: points.body01,
|
||||
y: points.body19.y +sa +10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.gill1start,
|
||||
to: points.gill5start,
|
||||
y: points.body19.y +sa +20,
|
||||
})
|
||||
|
||||
macro('hd', {
|
||||
from: points.body14,
|
||||
to: points.body13,
|
||||
y: points.body06.y -sa -5,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.body13,
|
||||
to: points.body10,
|
||||
y: points.body06.y -sa -5,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.body10,
|
||||
to: points.body06,
|
||||
y: points.body06.y -sa -5,
|
||||
})
|
||||
points.finCurve = utils.beamsIntersect( points.body05, points.body05cp2, points.body04, points.body04cp1 )
|
||||
macro('hd', {
|
||||
from: points.body06,
|
||||
to: points.finCurve,
|
||||
y: points.body06.y -sa -5,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.finCurve,
|
||||
to: points.body03,
|
||||
y: points.body06.y -sa -5,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.body03,
|
||||
to: points.body01,
|
||||
y: points.body06.y -sa -5,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.body02,
|
||||
to: points.body03,
|
||||
y: points.body06.y -sa +10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.body02,
|
||||
to: points.body01,
|
||||
y: points.body06.y -sa +20,
|
||||
})
|
||||
|
||||
|
||||
} else {
|
||||
macro('scalebox', { at: points.scaleboxAnchor })
|
||||
}
|
||||
}
|
||||
|
||||
return part
|
||||
|
|
|
@ -15,7 +15,6 @@ export default function (part) {
|
|||
macro,
|
||||
} = part.shorthand()
|
||||
|
||||
|
||||
let bottomFin01_02d = 250.63638754690027 * options.size
|
||||
let bottomFin01_02a = 119.34849371430543
|
||||
let bottomFin01_03d = 137.70322741678933 * options.size
|
||||
|
@ -36,9 +35,6 @@ export default function (part) {
|
|||
let finLength = store.get('aboveMouthFinLength') + store.get('bellyFinLength')
|
||||
let finCircumference = store.get('topFinCircumference')
|
||||
|
||||
console.log({ bellyFinLength: store.get('bellyFinLength') })
|
||||
console.log({ finCircumference: store.get('topFinCircumference') })
|
||||
|
||||
let diff = 0
|
||||
let iteration = 0
|
||||
do {
|
||||
|
@ -52,6 +48,7 @@ export default function (part) {
|
|||
points.bottomFin02cp2 = points.bottomFin02.shift(bottomFin02cp2a, bottomFin02cp2d)
|
||||
points.bottomFin03cp1 = points.bottomFin03.shift(bottomFin03cp1a, bottomFin03cp1d)
|
||||
points.bottomFin03cp2 = points.bottomFin03.shift(bottomFin03cp2a, bottomFin03cp2d)
|
||||
|
||||
diff =
|
||||
finLength -
|
||||
new Path()
|
||||
|
@ -77,6 +74,7 @@ export default function (part) {
|
|||
points.bottomFin02cp2 = points.bottomFin02.shift(bottomFin02cp2a, bottomFin02cp2d)
|
||||
points.bottomFin03cp1 = points.bottomFin03.shift(bottomFin03cp1a, bottomFin03cp1d)
|
||||
points.bottomFin03cp2 = points.bottomFin03.shift(bottomFin03cp2a, bottomFin03cp2d)
|
||||
|
||||
diff =
|
||||
finCircumference -
|
||||
new Path()
|
||||
|
@ -89,16 +87,6 @@ export default function (part) {
|
|||
iteration++
|
||||
} while ((diff < -1 || diff > 1) && iteration < 100)
|
||||
|
||||
console.log({ iteration2: iteration })
|
||||
|
||||
console.log({ finLength: finLength })
|
||||
console.log({
|
||||
actual: new Path()
|
||||
.move(points.bottomFin03)
|
||||
.curve(points.bottomFin03cp1, points.bottomFin01cp2, points.bottomFin01)
|
||||
.length(),
|
||||
})
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.bottomFin01)
|
||||
.curve(points.bottomFin01cp1, points.bottomFin02cp2, points.bottomFin02)
|
||||
|
@ -106,22 +94,14 @@ export default function (part) {
|
|||
.curve(points.bottomFin03cp1, points.bottomFin01cp2, points.bottomFin01)
|
||||
.close()
|
||||
|
||||
console.log({
|
||||
bottomFinCirc: new Path()
|
||||
.move(points.bottomFin01)
|
||||
.curve(points.bottomFin01cp1, points.bottomFin02cp2, points.bottomFin02)
|
||||
.curve(points.bottomFin02cp1, points.bottomFin03cp2, points.bottomFin03)
|
||||
.length(),
|
||||
})
|
||||
|
||||
points.bottomFinSnippet = new Path()
|
||||
.move(points.bottomFin01)
|
||||
.curve(points.bottomFin01cp2, points.bottomFin03cp1, points.bottomFin03)
|
||||
.shiftAlong(store.get('aboveMouthFinLength'))
|
||||
snippets.bottomFin = new Snippet('bnotch', points.bottomFinSnippet)
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
points.bottomFinSnippet = new Path()
|
||||
.move(points.bottomFin01)
|
||||
.curve(points.bottomFin01cp2, points.bottomFin03cp1, points.bottomFin03)
|
||||
.shiftAlong(store.get('aboveMouthFinLength'))
|
||||
snippets.bottomFin = new Snippet('bnotch', points.bottomFinSnippet)
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
||||
}
|
||||
|
|
|
@ -44,26 +44,13 @@ export default function (part) {
|
|||
points.mouth04cp1 = points.mouth02cp2.flipX()
|
||||
points.mouth03cp1 = points.mouth03cp2.flipX()
|
||||
|
||||
console.log({ mouth01_02d: points.mouth01.dist(points.mouth02) })
|
||||
console.log({ mouth01_02a: points.mouth01.angle(points.mouth02) })
|
||||
console.log({ mouth01_03d: points.mouth01.dist(points.mouth03) })
|
||||
console.log({ mouth01_03a: points.mouth01.angle(points.mouth03) })
|
||||
|
||||
console.log({ mouth01cp1d: points.mouth01.dist(points.mouth01cp1) })
|
||||
console.log({ mouth01cp1a: points.mouth01.angle(points.mouth01cp1) })
|
||||
console.log({ mouth02cp1d: points.mouth02.dist(points.mouth02cp1) })
|
||||
console.log({ mouth02cp2d: points.mouth02.dist(points.mouth02cp2) })
|
||||
console.log({ mouth02cp1a: points.mouth02.angle(points.mouth02cp1) })
|
||||
console.log({ mouth02cp2a: points.mouth02.angle(points.mouth02cp2) })
|
||||
console.log({ mouth03cp2d: points.mouth03.dist(points.mouth03cp2) })
|
||||
console.log({ mouth03cp2a: points.mouth03.angle(points.mouth03cp2) })
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.mouth01)
|
||||
.curve(points.mouth01cp2, points.mouth04cp1, points.mouth04)
|
||||
.curve(points.mouth04cp2, points.mouth03cp1, points.mouth03)
|
||||
.curve(points.mouth03cp2, points.mouth02cp1, points.mouth02)
|
||||
.curve(points.mouth02cp2, points.mouth01cp1, points.mouth01)
|
||||
.close()
|
||||
|
||||
store.set(
|
||||
'mouthTopLength',
|
||||
|
@ -104,6 +91,7 @@ export default function (part) {
|
|||
snippets.mouthlowerTeeth2 = new Snippet('bnotch', points.mouthlowerTeeth2)
|
||||
snippets.mouthMidTop = new Snippet('bnotch', points.mouth01)
|
||||
snippets.mouthMidBottom = new Snippet('bnotch', points.mouth03)
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ export default function (part) {
|
|||
macro,
|
||||
} = part.shorthand()
|
||||
|
||||
|
||||
let topFinOpening = store.get('topFinOpening')
|
||||
let topFinOpeningLength = store.get('topFinOpeningLength')
|
||||
|
||||
|
@ -49,6 +48,7 @@ export default function (part) {
|
|||
points.topFin02cp2 = points.topFin02.shift(topFin02cp2a, topFin02cp2d)
|
||||
points.topFin03cp1 = points.topFin03.shift(topFin03cp1a, topFin03cp1d)
|
||||
points.topFin03cp2 = points.topFin03.shift(topFin03cp2a, topFin03cp2d)
|
||||
|
||||
diff =
|
||||
topFinOpeningLength -
|
||||
new Path()
|
||||
|
@ -60,23 +60,13 @@ export default function (part) {
|
|||
iteration++
|
||||
} while ((diff < -1 || diff > 1) && iteration < 100)
|
||||
|
||||
console.log({ iteration: iteration })
|
||||
|
||||
paths.seam = new Path()
|
||||
paths.seam = new Path()
|
||||
.move(points.topFin01)
|
||||
.curve(points.topFin01cp2, points.topFin03cp1, points.topFin03)
|
||||
.curve(points.topFin03cp2, points.topFin02cp1, points.topFin02)
|
||||
.curve(points.topFin02cp2, points.topFin01cp1, points.topFin01)
|
||||
.close()
|
||||
|
||||
console.log({ topFinLength1: store.get('topFinOpeningLength') })
|
||||
console.log({
|
||||
topFinLength2: new Path()
|
||||
.move(points.topFin03)
|
||||
.curve(points.topFin03cp1, points.topFin01cp2, points.topFin01)
|
||||
.length(),
|
||||
})
|
||||
|
||||
store.set(
|
||||
'topFinCircumference',
|
||||
new Path()
|
||||
|
@ -86,14 +76,6 @@ export default function (part) {
|
|||
.length()
|
||||
)
|
||||
|
||||
console.log({
|
||||
topFinCirc: new Path()
|
||||
.move(points.topFin01)
|
||||
.curve(points.topFin01cp1, points.topFin02cp2, points.topFin02)
|
||||
.curve(points.topFin02cp1, points.topFin03cp2, points.topFin03)
|
||||
.length(),
|
||||
})
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
if (sa) {
|
||||
|
|
|
@ -17,22 +17,6 @@ export default function (part) {
|
|||
macro,
|
||||
} = part.shorthand()
|
||||
|
||||
points.upperTeeth01 = new Point(149.3, 278.667)
|
||||
points.upperTeeth01cp1 = new Point(197.492, 209.499)
|
||||
points.upperTeeth02cp2 = new Point(239.637, 204.963)
|
||||
points.upperTeeth02 = new Point(257.968, 204.963)
|
||||
points.upperTeeth02cp1 = new Point(275.166, 204.773)
|
||||
points.upperTeeth03cp2 = new Point(323.357, 210.254)
|
||||
points.upperTeeth03 = new Point(366.26, 279.236)
|
||||
|
||||
console.log({ upperTeeth01_02d: points.upperTeeth01.dist(points.upperTeeth02) })
|
||||
console.log({ upperTeeth01_02a: points.upperTeeth01.angle(points.upperTeeth02) })
|
||||
|
||||
console.log({ upperTeeth01cp1d: points.upperTeeth01.dist(points.upperTeeth01cp1) })
|
||||
console.log({ upperTeeth01cp1a: points.upperTeeth01.angle(points.upperTeeth01cp1) })
|
||||
console.log({ upperTeeth02cp2d: points.upperTeeth02.dist(points.upperTeeth02cp2) })
|
||||
console.log({ upperTeeth02cp2a: points.upperTeeth02.angle(points.upperTeeth02cp2) })
|
||||
|
||||
let upperTeeth01_02d = 131.305041182736 * options.size
|
||||
let upperTeeth01_02a = 34.147056946748805 + 180
|
||||
let upperTeeth02cp1d = 84.30113337316406 * options.size
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue