Step 3
First Autoknit Experimentation misc-cactus.obj : the knitted «Hello world»
As my first trials were fine at this stage of the project and I was at ease with knitout language and their tools, I start to learn Autoknit : the famous program. If you go on the autoknit git documentation here, you will find a step by step to program the misc-cactus.obj through autoknit.
AUTOKNIT TUTORIAL
You can’t use the Autoknit program online; you need to build it locally on your computer. On my computer, I’m using the Windows operating system, and based on that, I started following the build instructions. For some reasons that I can’t explain, it didn’t work on my computer. Let me share with you how I managed to do it in the end.
1 - Installation
First you need to download the Pre-Built release : You don’t need to have Git on your computer, only if you want to submit potential improvements. For just usage, the 'pre-built releases’ is sufficient.
https://github.com/textiles-lab/autoknit/releases
I downloaded the zip file «autoknit-windows-v0.2.zip». With those files it’s not possible yet to use the autoknit program.
In addition to the pre-built releases, you need to have the «nest libs pre built library package» where you can find it here : download the «nest-libs-windows-v0.13.zip».
Put the nest.lib folder inside the pre-built (autoknit) folder.
Before following the «usage» instruction in the git documentation. You need to move the SDL2.dll file from here «nest-libs\windows\SDL2\dist\ SDL2.dll» to the pre-built autoknit folder.
Placing the nest-lib folder next to the files running the Autoknit program is not enough to reach the SDL2.dll file, which is why it needs to be moved.
2 - Usage / misc-cactus exemple
You can find here the step by step to use autoknit.. Below, I’d like to share some additional information that may be helpful for better understanding, especially for people who are not comfortable using the command line on a computer. So, I’m going to break down every step from Git. So, as previously stated, AutoKnit runs only through the command line in a terminal. I’ve used PowerShell the Windows terminal for this.
☺ Step-1 Run autoknit and add constraints ☺
Depending on where you place the .obj file, the command prompt «./interface obj:misc-cactus.obj constraints:misc-cactus.cons » might not work. The simplest solution to avoid encountering problems during the execution of the program is to place the .obj file next to the .exe files. It is, of course, possible to place it elsewhere, but this would require adjusting the command, where you would need to specify the location of the .obj file each time.
In your terminal, you need to navigate to the correct repository to execute the first command, 'interface.exe’. Using the command «cd» («change directory») to move to the correct repository where the interface.exe is as well as the obj file.
A short, quiet tutorial that shows how to proceed and open the AutoKnit program ↓
VIDEO PROCESS - Autoknit / misc-cactus demo 1
«You will see a 3D view of the loaded model». What you need to do now is add the 'constraints’. Normally, in the AutoKnit folder, you will find a file called 'misc-cactus.cons’. It’s a file that stores the constraints you will create on the 3D in the AutoKnit interface.
Don’t forget to follow the AutoKnit Git; all the keys are indicated to correctly place your constraints.
The constraints are necessary to indicate where the knitting starts and where it ends. Depending on the model you want to knit, you can add more constraints if necessary. As you can see here, the misc-cactus is 'open’ at three levels. The misc-cactus splits into two parts, meaning that at some point the machine will knit the two sections separately. So, you need to set priorities; otherwise, if the machine knits both parts at the same time, it will create yarn floats in between.
Before you can proceed to the next step, you will need to create constraints for (at least) all of the boundaries (open region)of the cactus: c = add constraints x = remove constraints r = if your model is close, you can create open region (new boundaries)W
(+) / (-) = A color code ranging from blue (-) to red (+), with blue defining the start of the knitting and red defining the end. The shades between the start and end determine the order of knitting actions.
VIDEO PROCESS - Autoknit / misc-cactus demo 2
↓ A short, quiet tutorial that shows how to add constraints in the AutoKnit program. ↓
☺ Step-2 Peeling/Linking with the automatic method ☺
You can use the manual method for the first time to see the procedure, but it’s not necessary. This step involves a polygonal cutting of the 3D model to draw a circular path that defines the carriage’s path, forming circular knitting rows.
I faced some difficulties understanding the additional parameters. I will explain more about it in the step 4
After proceeding with this step, AutoKnit will have generated a .st file alongside the other files.
☺ Step-3 Scheduling ☺
By following the step 3, autoknit has generated a .js file from the .st file. I you open the javascript you will notice that the structure look like the knitout language.
VIDEO PROCESS - Autoknit / misc-cactus demo 3
↓ A short, quiet tutorial that shows the step 2 and 3. ↓
☺ Step-4 Knitout ☺
To complete Step 4, you need to pay attention to two things: First, strangely, Autoknit generates a JavaScript file that contains syntax errors. If you execute the « node misc-cactus.js out:misc-cactus.k » you will see this error message:
To fix this first error :
VIDEO PROCESS - Autoknit / misc-cactus demo 4
↓ a short, quiet tutorial that shows you what to do, using the «find and replace» command on Visual Studio software ↓
Secondly, if you execute again the command, you will have a new error message :
To convert .js file into Knitout, if you look inside the javascript you will see that it calls the «autoknit-yarns» module. These node_modules named autoknit.js and autoknit-yarns.js, which you can find here , are helper javascript libraries specifically customized for Shima Seiki machines. But what we see in the error message is MODULE_NOT_FOUND, which means you need to download the modules and place them next to the executable files. Otherwise, the command won’t be able to locate the module.
Before doing that, as I mentioned, the modules are customized for Shima Seiki (an industrial knitting machine). This means that when you export the file to Knitout (Step 4), you won’t be able to convert it into KCode for Kniterate, because the Knitout file needs to be customized via JavaScript using additional libraries specifically designed for Kniterate (KCode). To do so, you need to download the «autoknit-kniterate.js» module which you can find here. Then move autoknit-kniterate.js into theexecutive autoknit folder, and once you’ve gotten to the step where you’ve produced a javascript file, open that js file in a text-editor and change this line of code [line #1]: const autoknit = require(autoknit); to this: const autoknit = require(autoknit-kniterate);
VIDEO PROCESS - Autoknit / misc-cactus demo 5
↓ A short, quiet tutorial that shows you how to change the javascript module ↓
☺ Step-5 Knit and cross your finger ☺
Now, what you need to do is convert your Knitout file into a KCode file using the Knitout-to-KCode backend1 program, so it can be knitted on the Kniterate machine. I recommend that you first open your Knitout file in the Knitout Live Visualizer to better understand what’s happening inside the file before converting it.
It’s time to knit !
It wasn't a surprise because I had seen in the Git documentation here that the complex structure generated by Autoknit cannot work well with the Kniterate due to its limited performance. Although the use of the Kniterate was not the final goal of my project, the operation of this machine remains relatively similar to domestic knitting machines, making it a good starting point for understanding the specific 3D knitting processes involved.