Skip to main content

initDraftWithParams

Given any partial set of parameters, this function will initialize a new draft that maintains any parameters specified and fills all other values with defaults.

Parameters

An object that contains any of the following fields:

parameterdescriptiondefault
ida number to use as the id for this drafta unique 8 digit number
warpsnumber describing the total amount of warp ends in the draft1 or (if drawdown is specified) the number of warps in drawdown
weftsnumber describing the total amount of weft picks in the draft1 or (if drawdown is specified) the number of wefts in drawdown
gen_namea string representing a generated name"drafty"
ud_namea string representing a user defined name""
drawdowna Drawdown object or a two-d array of cells.[[createCell(false)]]
colShuttleMappingan array of numbers that correspond to material ids[0]
rowShuttleMappingan array of numbers that correspond to material ids[1]
colSystemMappingan array of numbers that correspond to system ids[0]
rowSystemMappingan array of numbers that correspond to system ids[0]

Returns

Draft

Implementation

initDraftWithParams({wefts: 10, warps: 10})

Will generate a drawdown with 10 ends and 10 picks with every cell value being "false" / "warp-lowered". It will also create default values for 10 ends and 10 picks in rowSystemMapping, colSystemMapping, rowShuttleMapping and colShuttleMapping. If a parameter isn't explicitly specified, the default value is used.

initDraftWithParams({wefts: 10, warps: 10, drawdown: d})

Will generate a drawdown with 10 ends and 10 picks filled with the drawdown "d". It will also create default values for 10 ends and 10 picks in rowSystemMapping, colSystemMapping, rowShuttleMapping and colShuttleMapping. If a parameter isn't explicitly specified, the default value is used.

initDraftWithParams({wefts: 10, warps: 10, drawdown: d, rowShuttleMapping: [0,1]})

Will generate a drawdown with 10 ends and 10 picks filled with the drawdown "d". It will also create default values for 10 ends and 10 picks in rowSystemMapping, colSystemMapping and colShuttleMapping. rowShuttleMapping will be filled with the repeating pattern [0,1]