Skip to main content

Code for producing knitout files to do 3D knitting on the kniterate knitting machine (and also optionally adding stitch patterns along the 3D surface).

Project description

knitout-kniterate-3D

Code for producing knitout files to do 3D knitting on the kniterate knitting machine (and also optionally adding stitch patterns along the 3D surface).

See the release notes on GitHub for details about the updates/changes in this release.

Graphic Specifications

Overview

The program uses 2D raster (or bitmap) graphics (with full opacity!) to generate knitout files for 3D shapes that can then be converted to knitting machine instructions in k-code using the knitout-to-kniterate-backend. It also allows for incorpating stitch patterns to overlay onto the shape graphic (kind of like a cookie cutter).

You can use adobe photoshop or photopea (a fantastic & free in-browser photoshop alternative) to create these graphics.

For all of these graphics, an individual pixel is mapped to an individual stitch (so the height and width of the graphic respectively determine the row and needle count of the resulting knitted object). If the stitch pattern graphic is a different size from the shape graphic, it will be resized to match the latter.

3D Shapes

The graphic that represents the shape should have a white background and a flat black fill as the shape. This graphic will be used for both the front and the back of the shape (currently, the program does not support variation in these).

Stitch Patterns

Optionally, the shape can be composed of a variety stitch patterns at different points along its 3D surface. This is acheived by processing user-provided 2D raster graphics that include blobs of unique colors to designate an area where a particular stitch pattern should be used when knitting the given shape. The specifications of each stitch pattern are based on the info you pass as arguments to the shapeImgToKnitout function. (NOTE: no two blobs separated by any white space can be the same color, even if they represent the exact stitch patterns). Different stitch pattern graphics can be provided for the front and back of the shape.

Function Parameters

shapeImgToKnitout

TODO

Workflow

Installation

From the command line, install the package with pip:

pip install knitout-kniterate-3D

Example Usage

Generate the graphics that you will be using for the knitted object. It is recommended that you place these graphics in the graphics sub-directory. After installing the package, create a python file (e.g. my-file.py) and add the following code to your file:

from knitout_kniterate_3D import knit3D, knitout

Then add the following code to initiate the knitout writer:

k = knitout.Writer('1 2 3 4 5 6')

Then, call the shapeImgToKnitout function from the knit3D library and pass any relevant information (see the function docstring in knit3D.py [located in the src sub-directory] for more information).

TODO

Finally, use the knitout writer to output the file:

k.write(f'{fileName}.k')

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_kniterate_3D-1.0.5.tar.gz (86.8 kB view details)

Uploaded Source

Built Distribution

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

knitout_kniterate_3D-1.0.5-py3-none-any.whl (68.8 kB view details)

Uploaded Python 3

File details

Details for the file knitout_kniterate_3D-1.0.5.tar.gz.

File metadata

  • Download URL: knitout_kniterate_3D-1.0.5.tar.gz
  • Upload date:
  • Size: 86.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.8

File hashes

Hashes for knitout_kniterate_3D-1.0.5.tar.gz
Algorithm Hash digest
SHA256 d2bf530bcf9dfc1a34cf75096bcefdf9e8c5b38778fa2805a185dd6925fd1f8d
MD5 d296334965efd6357e8d20e4c1222cca
BLAKE2b-256 c33c6b927a07192275b79693d5bc2a3b52529621738816577863c291675414c0

See more details on using hashes here.

File details

Details for the file knitout_kniterate_3D-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: knitout_kniterate_3D-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 68.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.8

File hashes

Hashes for knitout_kniterate_3D-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9e21bec980c8fe2b318d09487f93ba66be80fc35a8929a3f94052f73c1b2ee9a
MD5 1e574fec9b8b1d2fa63a6ab7f1b3aa2a
BLAKE2b-256 bbdfd7d9cfc864f7e8badcedf93f4d73515da41876c2008a75a7373dca9bd74a

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