diff --git a/designs/octoplushy/src/arm.mjs b/designs/octoplushy/src/arm.mjs index 75918db68fe..867330c05e3 100644 --- a/designs/octoplushy/src/arm.mjs +++ b/designs/octoplushy/src/arm.mjs @@ -28,9 +28,9 @@ function octoplushyArmSection( const sections = options.type == 'squid' ? 10 : 8 const sectionWidth = (w * 2) / sections - const armWidth = w * options.armWidth * (1 - options.bottomTopArmRatio) * 3.1415 + const armWidth = w * options.armWidth * (1 - options.bottomTopArmRatio) * Math.PI const armAdjustedWidth = armWidth * (1 - options.bottomTopArmRatio) - let armLength = ((w * 2) / 3.1415) * options.armLength + let armLength = ((w * 2) / Math.PI) * options.armLength switch (options.type) { case 'octopus': armLength *= 2 diff --git a/designs/octoplushy/src/head.mjs b/designs/octoplushy/src/head.mjs index 230bf9531f4..f6c40f7321c 100644 --- a/designs/octoplushy/src/head.mjs +++ b/designs/octoplushy/src/head.mjs @@ -28,9 +28,9 @@ function octoplushyHeadSection( const sectionWidth = (w * 2) / sections const neckWidth = sectionWidth * options.neckWidth - const armWidth = w * options.armWidth * options.bottomTopArmRatio * 3.1415 + const armWidth = w * options.armWidth * options.bottomTopArmRatio * Math.PI const armAdjustedWidth = armWidth * options.bottomTopArmRatio - let armLength = ((w * 2) / 3.1415) * options.armLength + let armLength = ((w * 2) / Math.PI) * options.armLength if (options.type == 'octopus') { armLength *= 2 } @@ -613,15 +613,9 @@ const options = { min: 5, max: 500, menu: 'style', - toAbs: (val, { options }, mergedOptions) => - ((mergedOptions.sizeConstant * val * 2) / 3.1415) * - (options.type === undefined - ? 1 - : options.type == 'octopus' - ? 1.7 - : options.type == 'squid' - ? 2 - : 1), + toAbs: (val, _, mergedOptions) => + ((mergedOptions.sizeConstant * val * 2) / Math.PI) * + (mergedOptions.type === 'octopus' ? 1.7 : mergedOptions.type === 'squid' ? 2 : 1), }, type: { dflt: 'octoplushy', list: ['octoplushy', 'octopus', 'squid'], menu: 'style' }, armWidth: { pct: 15, min: 10, max: 30, menu: 'style' }, @@ -630,19 +624,10 @@ const options = { min: 100, max: 500, menu: 'style', - toAbs: (val, { options }, mergedOptions) => - ((mergedOptions.sizeConstant * - (options.size === undefined ? mergedOptions.size : options.size) * - 2) / - 3.1415) * + toAbs: (val, _, mergedOptions) => + ((mergedOptions.sizeConstant * mergedOptions.size * 2) / Math.PI) * val * - (options.type === undefined - ? 1 - : options.type == 'octopus' - ? 2 - : options.type == 'squid' - ? 1.8 - : 1), + (mergedOptions.type === 'octopus' ? 2 : mergedOptions.type === 'squid' ? 1.8 : 1), }, neckWidth: { pct: 25, min: 25, max: 45, menu: 'style' }, armTaper: { pct: 25, min: 0, max: 50, menu: 'style' }, @@ -652,14 +637,14 @@ const options = { min: 75, max: 125, // eslint-disable-next-line no-unused-vars - menu: (settings, mergedOptions) => (mergedOptions?.type === 'octoplushy' ? 'style' : false), + menu: (settings, mergedOptions) => (mergedOptions?.type !== 'octoplushy' ? 'style' : false), }, bottomArmReductionPlushy: { pct: 80, min: 75, max: 125, // eslint-disable-next-line no-unused-vars - menu: (settings, mergedOptions) => (mergedOptions?.type !== 'octoplushy' ? 'style' : false), + menu: (settings, mergedOptions) => (mergedOptions?.type === 'octoplushy' ? 'style' : false), }, }