Define fold as a variable, not a dependent
This commit is contained in:
parent
35f813e9ac
commit
7e867bc89b
|
@ -75,6 +75,10 @@ input{
|
|||
<label for="frontIH">Front Inner Height</label>
|
||||
<input name="frontIH" type="number" value="40" /> mm
|
||||
</div>
|
||||
<div>
|
||||
<label for="fold">Fold Section</label>
|
||||
<input name="fold" type="number" value="10" /> mm
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
|
@ -138,6 +142,7 @@ input{
|
|||
const frontIH = Math.round($('frontIH').value * MM);
|
||||
|
||||
const maxLength = Math.round($('maxLength').value * MM);
|
||||
const fold = Math.round($('fold').value * MM);
|
||||
|
||||
const align = Math.round($('align').value);
|
||||
let parts = Math.round($('parts').value);
|
||||
|
@ -161,6 +166,7 @@ input{
|
|||
frontIW : frontIW,
|
||||
frontOH : frontOH,
|
||||
frontIH : frontIH,
|
||||
fold : fold,
|
||||
|
||||
maxLength : maxLength,
|
||||
parts : parts,
|
||||
|
|
|
@ -124,6 +124,8 @@ function bellows (options = {}) {
|
|||
let backIH = options.backIH || Math.round(MM * 40)
|
||||
let backOH = options.backOH || Math.round(MM * 50)
|
||||
|
||||
let fold = options.fold || (frontOW - frontIW) / 2
|
||||
|
||||
let align = options.align || 0 //adjust the alignment (find formula)
|
||||
|
||||
let maxLength = options.maxLength || MM * 280
|
||||
|
@ -135,7 +137,6 @@ function bellows (options = {}) {
|
|||
let key = (typeof options.key !== 'undefined' && options.key === false) ? false : true
|
||||
let over = (typeof options.overlap !== 'undefined' && options.overlap === false) ? false : true
|
||||
|
||||
let fold = (frontOW - frontIW) / 2
|
||||
let folds = Math.floor(maxLength / fold)
|
||||
let length = folds * fold
|
||||
|
||||
|
|
Loading…
Reference in New Issue