Skip to main content

Support for interpreting knitout files used for controlling automatic V-Bed Knitting machines.

Project description

knitout_interpreter

PyPI - Version PyPI - Python Version


Description

Support for interpreting knitout files used for controlling automatic V-Bed Knitting machines. This complies with the Knitout specification created by McCann et al.

Table of Contents

Installation

pip install knitout-interpreter

Usage

Run Knitout

To execute a knitout file (e.g., "example.k") on a virtual knitting machine, you can use the run_knitout function from the run_knitout Module. This will return a list of knitout-line objects in the order of execution, the virtual knitting machine created and after the knitout operations have completed, and the knitgraph that is rendered by these knitout operations.

from knitout_interpreter.run_knitout import run_knitout

knitout_lines, knitting_machine_state, knitted_knit_graph = run_knitout("example.k")

In addition to processing the knitout instructions into a list of instructions that executed on a virtual machine, this package supports interoperation with existing knitout compilers to Shima Seiki DAT files and Kniterate files.

To interpret and convert the knitout code to a DAT file, execute the following:

from knitout_interpreter.run_knitout import interpret_knitout
success= interpret_knitout("sample.k", "sample.dat")

The resulting DAT files can be viewed using the Dat Viewer Interface from the CMU Textiles Lab.

To generate Kniterate KCODE using the CMU Textiles Lab Kniterate compiler, modify the code as follows.

from knitout_interpreter.run_knitout import interpret_knitout
from knitout_interpreter.knitout_compilers.compile_knitout import Knitout_to_Machine_Compiler
success= interpret_knitout("sample.k", "sample.dat", Knitout_to_Machine_Compiler.Kniterate_Compiler)

Knitout Executer

The Knitout Execute Class provides additional support for analyzing an executed knitout program.

It provides the following functionality:

  • Determining the execution time of a knitout program measured in carriage passes (not lines of knitout).
  • Finding the left and right most needle indices that are used during execution. This can be used to determine the width needed on a knitting machine.
  • Testing the knitout instructions against common knitting errors
  • Reorganizing a knitout program into carriage passes (such as sorting xfers to be in carriage pass order) and writing these out to a new file.

License

knitout-interpreter is distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

knitout_interpreter-0.0.13.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

knitout_interpreter-0.0.13-py3-none-any.whl (69.0 kB view details)

Uploaded Python 3

File details

Details for the file knitout_interpreter-0.0.13.tar.gz.

File metadata

  • Download URL: knitout_interpreter-0.0.13.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.1

File hashes

Hashes for knitout_interpreter-0.0.13.tar.gz
Algorithm Hash digest
SHA256 2b9a0f8cba80ae0e05d88b82c8a586f17b2b5153c26e4fd5ac70e78cb4b1a37b
MD5 4c1cecf0c22d82d1cd82aa2c51d3686f
BLAKE2b-256 b27df7f7e88adfd77d566bd12fc10c201c2a3533847699d03d6cbb7dbdcaa768

See more details on using hashes here.

File details

Details for the file knitout_interpreter-0.0.13-py3-none-any.whl.

File metadata

File hashes

Hashes for knitout_interpreter-0.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 31a2f4ce67eb7f444c7f8d604ad5a8ca350c72cd88dafb5ec6b46839527275fa
MD5 2c94b36882e2a3d03bd69e7a18ddbd76
BLAKE2b-256 46f0270592bb2664ce635f6a6a56190a0a7aa4dc04317a7e070b34ae1cef61a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page