1
0
Fork 0

added hungry option

This commit is contained in:
woutervdub 2022-06-08 13:36:23 -07:00
parent 1d6d43a7e2
commit 2442c61ae4
8 changed files with 314 additions and 299 deletions

View file

@ -9,7 +9,7 @@ export default {
type: 'pattern', type: 'pattern',
difficulty: 4, difficulty: 4,
optionGroups: { optionGroups: {
style: ['size','nosePointiness','aggressive'], style: ['size','hungry','nosePointiness','aggressive'],
}, },
measurements: ['neck'], measurements: ['neck'],
parts: ['body','tail','aboveMouth','belly','topFin','bottomFin','mouth','lowerTeeth','upperTeeth'], parts: ['body','tail','aboveMouth','belly','topFin','bottomFin','mouth','lowerTeeth','upperTeeth'],
@ -24,8 +24,9 @@ export default {
inject: {}, inject: {},
hide: [], hide: [],
options: { options: {
size: {pct: 100, min: 5, max: 500 },
hungry: {pct: 50, min: 0, max: 100 },
nosePointiness: {pct: 0, min: -5,max: +10}, nosePointiness: {pct: 0, min: -5,max: +10},
aggressive: {bool: false}, aggressive: {bool: false},
size: {pct: 33, min: 5, max: 500 },
}, },
} }

View file

@ -15,7 +15,6 @@ export default function (part) {
macro, macro,
} = part.shorthand() } = part.shorthand()
let aboveMouth01_02d = 266.7238454769277 * options.size let aboveMouth01_02d = 266.7238454769277 * options.size
let aboveMouth01_02a = 353.4089695458119 let aboveMouth01_02a = 353.4089695458119
let aboveMouth02_03d = 28.348200101593726 * options.size let aboveMouth02_03d = 28.348200101593726 * options.size
@ -31,7 +30,6 @@ export default function (part) {
let aboveMouth04cp2d = 66.94005927693816 * options.size let aboveMouth04cp2d = 66.94005927693816 * options.size
let aboveMouth04cp2a = 308.8121959753343 let aboveMouth04cp2a = 308.8121959753343
let faceTopLength = store.get('faceTopLength') let faceTopLength = store.get('faceTopLength')
let diff = 0 let diff = 0
@ -46,6 +44,7 @@ export default function (part) {
points.aboveMouth02cp2 = points.aboveMouth02.shift(aboveMouth02cp2a, aboveMouth02cp2d) points.aboveMouth02cp2 = points.aboveMouth02.shift(aboveMouth02cp2a, aboveMouth02cp2d)
points.aboveMouth03cp1 = points.aboveMouth03.shift(aboveMouth03cp1a, aboveMouth03cp1d) points.aboveMouth03cp1 = points.aboveMouth03.shift(aboveMouth03cp1a, aboveMouth03cp1d)
points.aboveMouth04cp2 = points.aboveMouth04.shift(aboveMouth04cp2a, aboveMouth04cp2d) points.aboveMouth04cp2 = points.aboveMouth04.shift(aboveMouth04cp2a, aboveMouth04cp2d)
diff = diff =
faceTopLength - faceTopLength -
new Path() new Path()
@ -58,8 +57,6 @@ export default function (part) {
iteration++ iteration++
} while ((diff < -1 || diff > 1) && iteration < 100) } while ((diff < -1 || diff > 1) && iteration < 100)
console.log({ iteration: iteration })
paths.seam = new Path() paths.seam = new Path()
.move(points.aboveMouth01) .move(points.aboveMouth01)
.line(points.aboveMouth04) .line(points.aboveMouth04)
@ -68,14 +65,6 @@ export default function (part) {
.curve(points.aboveMouth02cp2, points.aboveMouth01cp1, points.aboveMouth01) .curve(points.aboveMouth02cp2, points.aboveMouth01cp1, points.aboveMouth01)
.close() .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( store.set(
'aboveMouthTopLength', 'aboveMouthTopLength',
new Path() new Path()
@ -91,20 +80,15 @@ export default function (part) {
.length() .length()
) )
store.set('aboveMouthFinLength', points.aboveMouth02.dist(points.aboveMouth03)) store.set('aboveMouthFinLength', points.aboveMouth02.dist(points.aboveMouth03))
console.log({ aboveMouthFinLength: store.get('aboveMouthFinLength') })
console.log({ mouthTopLength: store.get('mouthTopLength') })
// Complete?
if (complete) {
points.aboveMouthSnippet = new Path() points.aboveMouthSnippet = new Path()
.move(points.aboveMouth01) .move(points.aboveMouth01)
.curve(points.aboveMouth01cp1, points.aboveMouth02cp2, points.aboveMouth02) .curve(points.aboveMouth01cp1, points.aboveMouth02cp2, points.aboveMouth02)
.shiftAlong(store.get('mouthTopLength')) .shiftAlong(store.get('mouthTopLength'))
console.log({ aboveMouthSnippet: points.aboveMouthSnippet })
snippets.mouth = new Snippet('bnotch', points.aboveMouthSnippet) snippets.mouth = new Snippet('bnotch', points.aboveMouthSnippet)
// Complete?
if (complete) {
if (sa) { if (sa) {
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
} }

View file

@ -65,6 +65,12 @@ export default function (part) {
points.belly03 = points.belly02.shift(belly02_03a, belly02_03d) points.belly03 = points.belly02.shift(belly02_03a, belly02_03d)
points.belly04 = points.belly03.shift(belly03_04a, belly03_04d) points.belly04 = points.belly03.shift(belly03_04a, belly03_04d)
points.belly05 = points.belly10.shift(belly10_05a, belly10_05d) 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.belly01cp1 = points.belly01.shift(belly01cp1a, belly01cp1d)
points.belly02cp1 = points.belly02.shift(belly02cp1a, belly02cp1d) points.belly02cp1 = points.belly02.shift(belly02cp1a, belly02cp1d)
points.belly03cp1 = points.belly03.shift(belly03cp1a, belly03cp1d) points.belly03cp1 = points.belly03.shift(belly03cp1a, belly03cp1d)
@ -77,21 +83,11 @@ export default function (part) {
points.belly05cp2 = points.belly05.shift(belly05cp2a, belly05cp2d) points.belly05cp2 = points.belly05.shift(belly05cp2a, belly05cp2d)
points.belly10cp1 = points.belly10.shift(belly10cp2a, belly10cp2d) points.belly10cp1 = points.belly10.shift(belly10cp2a, belly10cp2d)
console.log({ belly10_05d: points.belly10.dist(points.belly05) })
let mouthPartLength = let mouthPartLength =
store.get('aboveMouthBottomLength') - store.get('aboveMouthBottomLength') -
store.get('mouthTopLength') + store.get('mouthTopLength') +
store.get('mouthBottomLength') 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 diff = 0
let iteration = 0 let iteration = 0
do { do {
@ -109,13 +105,6 @@ export default function (part) {
} while ((diff < -1 || diff > 1) && iteration < 100) } while ((diff < -1 || diff > 1) && iteration < 100)
let bellyTailLength = store.get('bellyTailLength') 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 diff = 0
iteration = 0 iteration = 0
@ -134,15 +123,8 @@ export default function (part) {
.curve(points.belly03cp1, points.belly04cp2, points.belly04) .curve(points.belly03cp1, points.belly04cp2, points.belly04)
.length() .length()
console.log({
actual: new Path()
.move(points.belly03)
.curve(points.belly03cp1, points.belly04cp2, points.belly04)
.length(),
})
} while ((diff < -1 || diff > 1) && iteration < 100) } while ((diff < -1 || diff > 1) && iteration < 100)
points.belly05cp1 = points.belly05cp2.flipY() points.belly05cp1 = points.belly05cp2.flipY()
points.belly06 = points.belly04.flipY() points.belly06 = points.belly04.flipY()
points.belly06cp1 = points.belly04cp2.flipY() points.belly06cp1 = points.belly04cp2.flipY()
@ -179,23 +161,20 @@ export default function (part) {
.curve(points.belly02cp1, points.belly03cp2, points.belly03) .curve(points.belly02cp1, points.belly03cp2, points.belly03)
.length() .length()
) )
console.log({ bellyFinLength: store.get('bellyFinLength') })
// Complete?
if (complete) {
points.bellyMouthSnippet1 = new Path() points.bellyMouthSnippet1 = new Path()
.move(points.belly01) .move(points.belly01)
.curve(points.belly01cp1, points.belly02cp2, points.belly02) .curve(points.belly01cp1, points.belly02cp2, points.belly02)
.shiftAlong(store.get('mouthBottomLength')) .shiftAlong(store.get('mouthBottomLength'))
points.bellyMouthSnippet2 = points.bellyMouthSnippet1.flipY() points.bellyMouthSnippet2 = points.bellyMouthSnippet1.flipY()
console.log({ aboveMouthSnippet: points.aboveMouthSnippet })
snippets.mouth1 = new Snippet('bnotch', points.bellyMouthSnippet1) snippets.mouth1 = new Snippet('bnotch', points.bellyMouthSnippet1)
snippets.mouth2 = new Snippet('bnotch', points.bellyMouthSnippet2) snippets.mouth2 = new Snippet('bnotch', points.bellyMouthSnippet2)
// Complete?
if (complete) {
if (sa) { if (sa) {
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') paths.sa = paths.seam.offset(sa).trim().attr('class', 'fabric sa')
} }
} }

View file

@ -13,25 +13,25 @@ export default function (part) {
complete, complete,
paperless, paperless,
macro, macro,
utils,
} = part.shorthand() } = part.shorthand()
let body01_02d = 117.67274991262845 * options.size let body01_02d = 117.67274991262845 * options.size
let body02_03d = 124.91298035032229 * options.size let body02_03d = 124.91298035032229 * options.size
// let body02_03d = body01_02d // let body02_03d = body01_02d
let body03_04d = 255.92397474640785 * options.size let body03_04d = 255.92397474640785 * options.size
let body04_05d = 201.01260719168837 * options.size let body04_05d = 201.01260719168837 * options.size
let body05_06d = 134.89080971660005 * 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 body07_08d = 225.86340480918992 * options.size
let body08_09d = 66.84760000179512 * options.size let body08_09d = 66.84760000179512 * options.size
let body09_10d = 40.72782003741420 * options.size let body09_10d = 40.7278200374142 * options.size
let body10_11d = 23.78799421977402 * options.size let body10_11d = 23.78799421977402 * options.size
let body11_12d = 57.68530918700182 * options.size let body11_12d = 57.68530918700182 * options.size
let body12_13d = 98.06623978209830 * options.size let body12_13d = 98.0662397820983 * options.size
let body13_14d = 91.32736600274856 * options.size let body13_14d = 91.32736600274856 * options.size
let body14_15d = 295.10977066828880 * options.size let body14_15d = 295.1097706682888 * options.size
let body15_16d = 209.42633350581770 * options.size let body15_16d = 209.4263335058177 * options.size
let body16_17d = 152.51537318250902 * options.size let body16_17d = 152.51537318250902 * options.size
let body17_18d = 255.15294373571314 * options.size let body17_18d = 255.15294373571314 * options.size
let body18_19d = 71.90453921693678 * options.size let body18_19d = 71.90453921693678 * options.size
@ -57,14 +57,14 @@ export default function (part) {
let body09cp1d = 4.87663090668135 * options.size let body09cp1d = 4.87663090668135 * options.size
let body09cp2d = 25.76988630165065 * options.size let body09cp2d = 25.76988630165065 * options.size
let body10cp1d = 4.13950105689086 * options.size let body10cp1d = 4.13950105689086 * options.size
let body10cp2d = 13.27508493381490 * options.size let body10cp2d = 13.2750849338149 * options.size
let body11cp1d = 17.66659910678904 * options.size let body11cp1d = 17.66659910678904 * options.size
let body11cp2d = 17.66533107530116 * options.size let body11cp2d = 17.66533107530116 * options.size
let body12cp1d = 14.46914569005365 * options.size let body12cp1d = 14.46914569005365 * options.size
let body12cp2d = 39.51915145850176 * options.size let body12cp2d = 39.51915145850176 * options.size
let body13cp1d = 35.66832366400192 * options.size let body13cp1d = 35.66832366400192 * options.size
let body13cp2d = 48.53828530139895 * options.size let body13cp2d = 48.53828530139895 * options.size
let body14cp1d = 77.26036056089820 * options.size let body14cp1d = 77.2603605608982 * options.size
let body14cp2d = 37.42741381661305 * options.size let body14cp2d = 37.42741381661305 * options.size
let body15cp1d = 74.89746640634775 * options.size let body15cp1d = 74.89746640634775 * options.size
let body15cp2d = 101.16048880857042 * options.size let body15cp2d = 101.16048880857042 * options.size
@ -288,10 +288,6 @@ let gillAngle = 103.9416747
points.body01.angle(points.body01cp2) + 90 * (-1 + options.nosePointiness), points.body01.angle(points.body01cp2) + 90 * (-1 + options.nosePointiness),
points.body01.angle(points.body02) - 5 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) points.body01cp1 = points.body01.shift(body01cp1a, body01cp1d)
@ -316,9 +312,6 @@ let gillAngle = 103.9416747
) )
// Tail adjustment: // 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 = let tailCpAngle =
(points.body13.angle(points.body13cp1) - (points.body13.angle(points.body13cp1) -
points.body13.angle(points.body14) + points.body13.angle(points.body14) +
@ -334,20 +327,24 @@ let gillAngle = 103.9416747
) )
points.eyeBig = points.body01.shift(eyeBigAngle, eyeBigDist) points.eyeBig = points.body01.shift(eyeBigAngle, eyeBigDist)
points.eyeSmall = points.eyeBig.shift( eyeSmallAngle, eyeSmallDist *(-2+(options.aggressive ? 0 : 1))) points.eyeSmall = points.eyeBig.shift(
eyeSmallAngle,
eyeSmallDist * (-2 + (options.aggressive ? 0 : 1))
)
// Feeding:
let c = 0.55191502449351 let c = 0.55191502449351
let eyeBigX = 18.7757 * options.size let eyeBigX = 18.7757 * options.size
let eyeBigY = 11.6262 * options.size let eyeBigY = 11.6262 * options.size
points.eyeBigT = points.eyeBig.shift(90, eyeBigY / 2) points.eyeBigT = points.eyeBig.shift(90, eyeBigY / 2)
points.eyeBigB = points.eyeBig.shift(270, eyeBigY / 2).shift( points.eyeBigB = points.eyeBig
0, .shift(270, eyeBigY / 2)
options.aggressive ? eyeBigX / 3 : 0 .shift(0, options.aggressive ? eyeBigX / 3 : 0)
) points.eyeBigR = points.eyeBig
points.eyeBigR = points.eyeBig.shift(0, eyeBigX / 2).shift( .shift(0, eyeBigX / 2)
270, .shift(270, options.aggressive ? eyeBigY / 3 : 0)
options.aggressive ? eyeBigY / 3 : 0
)
points.eyeBigL = points.eyeBig.shift(180, eyeBigX / 2) points.eyeBigL = points.eyeBig.shift(180, eyeBigX / 2)
points.eyeBigTcp1 = points.eyeBigT.shift(0, (eyeBigY / 2) * c) points.eyeBigTcp1 = points.eyeBigT.shift(0, (eyeBigY / 2) * c)
points.eyeBigTcp2 = points.eyeBigT.shift(180, (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.eyeBigBcp2, points.eyeBigRcp1, points.eyeBigR)
.curve(points.eyeBigRcp2, points.eyeBigTcp1, points.eyeBigT) .curve(points.eyeBigRcp2, points.eyeBigTcp1, points.eyeBigT)
let eyeSmallX = 1.87089 * 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)) let eyeSmallY = 1.5368 * options.size * (options.aggressive ? 1.5 : 1)
points.eyeSmallT = points.eyeSmall.shift(270, eyeSmallY / 2) points.eyeSmallT = points.eyeSmall.shift(270, eyeSmallY / 2)
points.eyeSmallB = points.eyeSmall.shift(90, eyeSmallY / 2) points.eyeSmallB = points.eyeSmall.shift(90, eyeSmallY / 2)
points.eyeSmallR = points.eyeSmall.shift(0, eyeSmallX / 2) points.eyeSmallR = points.eyeSmall.shift(0, eyeSmallX / 2)
@ -408,39 +405,62 @@ let gillAngle = 103.9416747
.curve(points.body17cp1, points.body18cp2, points.body18) .curve(points.body17cp1, points.body18cp2, points.body18)
.curve(points.body18cp1, points.body19cp2, points.body19) .curve(points.body18cp1, points.body19cp2, points.body19)
.curve(points.body19cp1, points.body01cp2, points.body01) .curve(points.body19cp1, points.body01cp2, points.body01)
.close()
let gillPath = new Path() let gillPath = new Path()
.move(points.body17) .move(points.body17)
.curve(points.body17cp1, points.body18cp2, points.body18) .curve(points.body17cp1, points.body18cp2, points.body18)
points.gill1s = gillPath.shiftFractionAlong(0.018) points.gill1start = gillPath.shiftFractionAlong(0.018)
points.gill2s = gillPath.shiftFractionAlong(0.08 * 1 + 0.018) points.gill2start = gillPath.shiftFractionAlong(0.08 * 1 + 0.018)
points.gill3s = gillPath.shiftFractionAlong(0.08 * 2 + 0.018) points.gill3start = gillPath.shiftFractionAlong(0.08 * 2 + 0.018)
points.gill4s = gillPath.shiftFractionAlong(0.08 * 3 + 0.018) points.gill4start = gillPath.shiftFractionAlong(0.08 * 3 + 0.018)
points.gill5s = gillPath.shiftFractionAlong(0.08 * 4 + 0.018) points.gill5start = gillPath.shiftFractionAlong(0.08 * 4 + 0.018)
points.gill1e = points.gill1s.shift(gillAngle, gillLength *(1 +(0 * 0.08))) points.gill1end = points.gill1start.shift(gillAngle, gillLength * (1 + 0 * 0.08))
points.gill2e = points.gill2s.shift(gillAngle, gillLength *(1 +(1 * 0.08))) points.gill2end = points.gill2start.shift(gillAngle, gillLength * (1 + 1 * 0.08))
points.gill3e = points.gill3s.shift(gillAngle, gillLength *(1 +(2 * 0.08))) points.gill3end = points.gill3start.shift(gillAngle, gillLength * (1 + 2 * 0.08))
points.gill4e = points.gill4s.shift(gillAngle, gillLength *(1 +(3 * 0.08))) points.gill4end = points.gill4start.shift(gillAngle, gillLength * (1 + 3 * 0.08))
points.gill5e = points.gill5s.shift(gillAngle, gillLength *(1 +(4 * 0.08))) points.gill5end = points.gill5start.shift(gillAngle, gillLength * (1 + 4 * 0.08))
paths.gill1 = new Path().move(points.gill1s).line(points.gill1e) paths.gill1 = new Path().move(points.gill1start).line(points.gill1end)
paths.gill2 = new Path().move(points.gill2s).line(points.gill2e) paths.gill2 = new Path().move(points.gill2start).line(points.gill2end)
paths.gill3 = new Path().move(points.gill3s).line(points.gill3e) paths.gill3 = new Path().move(points.gill3start).line(points.gill3end)
paths.gill4 = new Path().move(points.gill4s).line(points.gill4e) paths.gill4 = new Path().move(points.gill4start).line(points.gill4end)
paths.gill5 = new Path().move(points.gill5s).line(points.gill5e) paths.gill5 = new Path().move(points.gill5start).line(points.gill5end)
store.set('tailWidth', points.body13.dist(points.body14)) store.set('tailWidth', points.body13.dist(points.body14))
store.set( 'tailCpAngle', points.body13.angle(points.body13cp1) - points.body13.angle(points.body14) ) store.set(
'tailCpAngle',
points.body13.angle(points.body13cp1) - points.body13.angle(points.body14)
)
store.set('tailCpDist', body13cp1d) store.set('tailCpDist', body13cp1d)
store.set('topFinOpening', points.body16.dist(points.body17)) 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(
'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(
store.set( 'bellyTailLength', (new Path().move(points.body15).curve(points.body15cp1, points.body16cp2, points.body16)).length()) '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? // Complete?
if (complete) { if (complete) {
@ -450,6 +470,7 @@ let gillAngle = 103.9416747
.shiftFractionAlong(0.25) .shiftFractionAlong(0.25)
snippets.bodyTail = new Snippet('bnotch', points.bodyTailSnippet) 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') paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
} }
@ -458,6 +479,102 @@ let gillAngle = 103.9416747
to: points.body01, to: points.body01,
d: -5, 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 return part

View file

@ -15,7 +15,6 @@ export default function (part) {
macro, macro,
} = part.shorthand() } = part.shorthand()
let bottomFin01_02d = 250.63638754690027 * options.size let bottomFin01_02d = 250.63638754690027 * options.size
let bottomFin01_02a = 119.34849371430543 let bottomFin01_02a = 119.34849371430543
let bottomFin01_03d = 137.70322741678933 * options.size let bottomFin01_03d = 137.70322741678933 * options.size
@ -36,9 +35,6 @@ export default function (part) {
let finLength = store.get('aboveMouthFinLength') + store.get('bellyFinLength') let finLength = store.get('aboveMouthFinLength') + store.get('bellyFinLength')
let finCircumference = store.get('topFinCircumference') let finCircumference = store.get('topFinCircumference')
console.log({ bellyFinLength: store.get('bellyFinLength') })
console.log({ finCircumference: store.get('topFinCircumference') })
let diff = 0 let diff = 0
let iteration = 0 let iteration = 0
do { do {
@ -52,6 +48,7 @@ export default function (part) {
points.bottomFin02cp2 = points.bottomFin02.shift(bottomFin02cp2a, bottomFin02cp2d) points.bottomFin02cp2 = points.bottomFin02.shift(bottomFin02cp2a, bottomFin02cp2d)
points.bottomFin03cp1 = points.bottomFin03.shift(bottomFin03cp1a, bottomFin03cp1d) points.bottomFin03cp1 = points.bottomFin03.shift(bottomFin03cp1a, bottomFin03cp1d)
points.bottomFin03cp2 = points.bottomFin03.shift(bottomFin03cp2a, bottomFin03cp2d) points.bottomFin03cp2 = points.bottomFin03.shift(bottomFin03cp2a, bottomFin03cp2d)
diff = diff =
finLength - finLength -
new Path() new Path()
@ -77,6 +74,7 @@ export default function (part) {
points.bottomFin02cp2 = points.bottomFin02.shift(bottomFin02cp2a, bottomFin02cp2d) points.bottomFin02cp2 = points.bottomFin02.shift(bottomFin02cp2a, bottomFin02cp2d)
points.bottomFin03cp1 = points.bottomFin03.shift(bottomFin03cp1a, bottomFin03cp1d) points.bottomFin03cp1 = points.bottomFin03.shift(bottomFin03cp1a, bottomFin03cp1d)
points.bottomFin03cp2 = points.bottomFin03.shift(bottomFin03cp2a, bottomFin03cp2d) points.bottomFin03cp2 = points.bottomFin03.shift(bottomFin03cp2a, bottomFin03cp2d)
diff = diff =
finCircumference - finCircumference -
new Path() new Path()
@ -89,16 +87,6 @@ export default function (part) {
iteration++ iteration++
} while ((diff < -1 || diff > 1) && iteration < 100) } 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() paths.seam = new Path()
.move(points.bottomFin01) .move(points.bottomFin01)
.curve(points.bottomFin01cp1, points.bottomFin02cp2, points.bottomFin02) .curve(points.bottomFin01cp1, points.bottomFin02cp2, points.bottomFin02)
@ -106,22 +94,14 @@ export default function (part) {
.curve(points.bottomFin03cp1, points.bottomFin01cp2, points.bottomFin01) .curve(points.bottomFin03cp1, points.bottomFin01cp2, points.bottomFin01)
.close() .close()
console.log({ // Complete?
bottomFinCirc: new Path() if (complete) {
.move(points.bottomFin01)
.curve(points.bottomFin01cp1, points.bottomFin02cp2, points.bottomFin02)
.curve(points.bottomFin02cp1, points.bottomFin03cp2, points.bottomFin03)
.length(),
})
points.bottomFinSnippet = new Path() points.bottomFinSnippet = new Path()
.move(points.bottomFin01) .move(points.bottomFin01)
.curve(points.bottomFin01cp2, points.bottomFin03cp1, points.bottomFin03) .curve(points.bottomFin01cp2, points.bottomFin03cp1, points.bottomFin03)
.shiftAlong(store.get('aboveMouthFinLength')) .shiftAlong(store.get('aboveMouthFinLength'))
snippets.bottomFin = new Snippet('bnotch', points.bottomFinSnippet) snippets.bottomFin = new Snippet('bnotch', points.bottomFinSnippet)
// Complete?
if (complete) {
if (sa) { if (sa) {
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
} }

View file

@ -44,26 +44,13 @@ export default function (part) {
points.mouth04cp1 = points.mouth02cp2.flipX() points.mouth04cp1 = points.mouth02cp2.flipX()
points.mouth03cp1 = points.mouth03cp2.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() paths.seam = new Path()
.move(points.mouth01) .move(points.mouth01)
.curve(points.mouth01cp2, points.mouth04cp1, points.mouth04) .curve(points.mouth01cp2, points.mouth04cp1, points.mouth04)
.curve(points.mouth04cp2, points.mouth03cp1, points.mouth03) .curve(points.mouth04cp2, points.mouth03cp1, points.mouth03)
.curve(points.mouth03cp2, points.mouth02cp1, points.mouth02) .curve(points.mouth03cp2, points.mouth02cp1, points.mouth02)
.curve(points.mouth02cp2, points.mouth01cp1, points.mouth01) .curve(points.mouth02cp2, points.mouth01cp1, points.mouth01)
.close()
store.set( store.set(
'mouthTopLength', 'mouthTopLength',
@ -104,6 +91,7 @@ export default function (part) {
snippets.mouthlowerTeeth2 = new Snippet('bnotch', points.mouthlowerTeeth2) snippets.mouthlowerTeeth2 = new Snippet('bnotch', points.mouthlowerTeeth2)
snippets.mouthMidTop = new Snippet('bnotch', points.mouth01) snippets.mouthMidTop = new Snippet('bnotch', points.mouth01)
snippets.mouthMidBottom = new Snippet('bnotch', points.mouth03) snippets.mouthMidBottom = new Snippet('bnotch', points.mouth03)
if (sa) { if (sa) {
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
} }

View file

@ -15,7 +15,6 @@ export default function (part) {
macro, macro,
} = part.shorthand() } = part.shorthand()
let topFinOpening = store.get('topFinOpening') let topFinOpening = store.get('topFinOpening')
let topFinOpeningLength = store.get('topFinOpeningLength') let topFinOpeningLength = store.get('topFinOpeningLength')
@ -49,6 +48,7 @@ export default function (part) {
points.topFin02cp2 = points.topFin02.shift(topFin02cp2a, topFin02cp2d) points.topFin02cp2 = points.topFin02.shift(topFin02cp2a, topFin02cp2d)
points.topFin03cp1 = points.topFin03.shift(topFin03cp1a, topFin03cp1d) points.topFin03cp1 = points.topFin03.shift(topFin03cp1a, topFin03cp1d)
points.topFin03cp2 = points.topFin03.shift(topFin03cp2a, topFin03cp2d) points.topFin03cp2 = points.topFin03.shift(topFin03cp2a, topFin03cp2d)
diff = diff =
topFinOpeningLength - topFinOpeningLength -
new Path() new Path()
@ -60,8 +60,6 @@ export default function (part) {
iteration++ iteration++
} while ((diff < -1 || diff > 1) && iteration < 100) } while ((diff < -1 || diff > 1) && iteration < 100)
console.log({ iteration: iteration })
paths.seam = new Path() paths.seam = new Path()
.move(points.topFin01) .move(points.topFin01)
.curve(points.topFin01cp2, points.topFin03cp1, points.topFin03) .curve(points.topFin01cp2, points.topFin03cp1, points.topFin03)
@ -69,14 +67,6 @@ export default function (part) {
.curve(points.topFin02cp2, points.topFin01cp1, points.topFin01) .curve(points.topFin02cp2, points.topFin01cp1, points.topFin01)
.close() .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( store.set(
'topFinCircumference', 'topFinCircumference',
new Path() new Path()
@ -86,14 +76,6 @@ export default function (part) {
.length() .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? // Complete?
if (complete) { if (complete) {
if (sa) { if (sa) {

View file

@ -17,22 +17,6 @@ export default function (part) {
macro, macro,
} = part.shorthand() } = 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_02d = 131.305041182736 * options.size
let upperTeeth01_02a = 34.147056946748805 + 180 let upperTeeth01_02a = 34.147056946748805 + 180
let upperTeeth02cp1d = 84.30113337316406 * options.size let upperTeeth02cp1d = 84.30113337316406 * options.size