MCPcopy Create free account
hub / github.com/alefore/knit / constructor

Method constructor

src/cable_pattern_factory.ts:21–36  ·  view source on GitHub ↗
(
      cables: number, rowsBetweenCables: number, cableEdgeRows: number,
      smoothingRows: number, innerCables: boolean,
      marginType: 'None' | 'ICord' | 'Knit', marginDistance: number)

Source from the content-addressed store, hash-verified

19 marginDistance: number;
20
21 constructor(
22 cables: number, rowsBetweenCables: number, cableEdgeRows: number,
23 smoothingRows: number, innerCables: boolean,
24 marginType: 'None' | 'ICord' | 'Knit', marginDistance: number) {
25 this.cables = cables;
26 this.innerCables = innerCables;
27 this.rowsBetweenCables = rowsBetweenCables;
28 this.cableEdgeRows = cableEdgeRows;
29 this.smoothingRows = smoothingRows;
30 this.rowsCount = cables * (this.cableEdgeRows + this.rowsBetweenCables);
31 this.rowsWidth = this.#rowsWidth();
32 this.positions = this.#cablePositions();
33 this.positionsInnerCables = this.#innerCablePositions();
34 this.marginType = marginType;
35 this.marginDistance = marginDistance;
36 }
37
38 #rowsWidth(): number {
39 const moveRows = 1 + this.rowsCount / 2 - this.cableEdgeRows;

Callers

nothing calls this directly

Calls 3

#rowsWidthMethod · 0.95
#cablePositionsMethod · 0.95
#innerCablePositionsMethod · 0.95

Tested by

no test coverage detected