mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 16:33:15 +01:00
Fix radial patern command math for span and angle method
This commit is contained in:
parent
614a411113
commit
73de12c99c
1 changed files with 5 additions and 5 deletions
|
|
@ -35,10 +35,10 @@ export const PatternRadialOperation: OperationDescriptor<patternRadialParams> =
|
||||||
params.inputBodies.forEach((shellToPatern, index) => {
|
params.inputBodies.forEach((shellToPatern, index) => {
|
||||||
for (let i = 2; i <= params.qty; i++) {
|
for (let i = 2; i <= params.qty; i++) {
|
||||||
let angleForInstance;
|
let angleForInstance;
|
||||||
if (params.patternMethod == 'step') {
|
if (params.patternMethod == 'step angle') {
|
||||||
angleForInstance = params.angle*(i-1);
|
angleForInstance = params.angle*(i-1);
|
||||||
} else if (params.patternMethod == 'span') {
|
} else if (params.patternMethod == 'span angle') {
|
||||||
angleForInstance = (params.angle / (params.qty-1))*(i-1);
|
angleForInstance = (params.angle / (params.qty))*(i-1);
|
||||||
} else {
|
} else {
|
||||||
throw 'unsupported pattern type: ' + params.patternMethod;
|
throw 'unsupported pattern type: ' + params.patternMethod;
|
||||||
}
|
}
|
||||||
|
|
@ -79,8 +79,8 @@ export const PatternRadialOperation: OperationDescriptor<patternRadialParams> =
|
||||||
label: 'Pattern Method',
|
label: 'Pattern Method',
|
||||||
name: "patternMethod",
|
name: "patternMethod",
|
||||||
style: "dropdown",
|
style: "dropdown",
|
||||||
defaultValue: "step",
|
defaultValue: "step angle",
|
||||||
values: [['step', 'Step Angle'], ['span', 'Span Angle']],
|
values: ['step angle','span angle',],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'number',
|
type: 'number',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue