The knitout language can be extended to support machine-specific features through the use of extension operations and headers.
Extension operations are operations that start with x-
; extension headers are headers that start with X-
;
the format and meaning of extension operation arguments and extension header data are left to extension developers.
Extensions are not necessarily supported or recognized by all knitout backends; though a specification-compliant backend will produce a warning for any extension it does not know it can safely ignore.
Many extensions are documented in the Knitout Specification. A partial list:
These extensions support machine-specific features that may exist on more than one machine.
x-stitch-number N
On machines with a table of stitch sizes, this command sets the table index for subsequent knit and tuck operations to N
.
Valid N
ranges and its meaning depends on the machine (Shima SWGN2: 1-120; Kniterate: 0-9A-F).
x-xfer-stitch-number N
Like x-stitch-number
but for subsequent transfer operations.
x-speed-number N
On machines with a table of speeds, sets the speed number for subsequent operations to N
;
changing speeds in the middle of a course will generally require starting a new pass and may produce kickbacks.
Valid N
and its meaning depends on the machine (Shima SWGN2: 0-15; Kniterate: 0-600).
x-end-pass
Ends the current pass, even if the backend thinks it is able to add more stitches. Useful for debugging and for forcing certain machine behaviors.
These extensions exist to help with pattern visualization in the live visualizer.
x-vis-color H CS
Sets the current color of carrier set CS
to CSS color specification H
(generally, a 6-digit hex color like '#ff00ff');
color changes take effect on the next operation.
x-loop-in D N CS
Tells the visualizer to create an existing starter loop so we can visualize a stitch with just one call to knit.
x-yarn-in D N CS
Tells the visualizer to bring a yarn in so we can use it.
x-yarn-out N
Tells the visualizer to take the "yarn" used for the started loop out, since we are no longer using it.
x-yarn-out D N CS
Tells the visualizer to take a yarn out, since we are no longer using it.
x-end
Instructs the visualizer to stop reading the file here.
These extensions pertain to specific functionality provided by the Shima SWGN2 knitting machine.
x-presser-mode M
Sets the fabric presser mode M
to off
(no fabric presser), auto
(fabric presser on passes with only front or only back stitches), or on
(break passes so that fabric presser can always be used).
The default mode is off
.
x-roller-advance D
Sets the distance, D
, the take-down roller will advance after each pass.
The default value is 100
.
x-add-roller-advance A
Adds an additional take-down roller advance amount, A
, to the current pass.
The effect is cumulative over multiple calls and resets every pass;
thus, calling x-roller-advance 200
x-add-roller-advance 25
x-add-roller-advance -75
will result in an advance of 150
after the current pass and (assuming no other calls) an advance of 200
on every pass thereafter.
x-carrier-spacing N
If a carrier would have stopped at the same location as another carrier, it will instead be moved by N
additional needles.
This value is set for all subsequent operations and will start a new pass if needed.
The default value is 2
.
x-carrier-stopping-distance N
Sets carriers to stop N
needles past the last needle they worked on a pass;
N
should end in 0.5
to reflect the fact that we think of carriers as stopping between needles.
This value is set for all subsequent operations and will start a new pass if needed.
The default value is 2.5
.
x-xfer-style S
Sets style, S
, in which subsequent transfers are allocated to passes;
four-pass
(the default) divides even and odd front-to-back and back-to-front transfers into their own passes, which is generally more reliable;
two-pass
just divides front and back transfers into their own passes, which is required by the hardware but may be unreliable.
Use x-xfer-style two-pass
along with x-end-pass
when you need to allocate transfers specifically to passes.
This value is set for all subsequent operations and will start a new pass if needed.