As we were joyously drawing, 3D-ifying, and printing various shapes, we noticed that during many of the prints, the printer head would partake in a good amount of jittering and seemingly random movements. The patterns it was creating to fill the objects didn’t make sense and we were curious as to why skeingforge, the program responsible for porting a 3D STL file to printer readable Gcode, would be telling the printer to make such patterns.
We looked at some of the layer patterns skeinforge was creating and we found layers like this abound:
As you can see, there are many little squares visible inside the object and then skeinforge tried filling in around them. After getting slightly annoyed at skeinforge, we thought that maybe it wasn’t the program’s fault and considered what was being inputted into skeinforge to make it act in such a way.
Our creation of a 3D object is essentially placing many many cubes in a pattern corresponding to the original shape. Therefore, when there are multiple cubes placed together many faces were created that weren’t really necessary. They were actually obstructive to the process because when the object was sent to skeinforge, it tried to account for all the faces on all the cubes. The poor thing!
So we had to find some way so that only the outside faces, those that were necessary, were created. After much brain racking, white board diagrams, and thinking about each sprinkle’s role within the shape, we came up with a theory on how to fix our internal faces problem.
We decided that each sprinkle would need a top and a bottom face, as these faces will never be dublicated by another sprinkle. Then we had to look at the four sides of each sprinkle and decide where it should be allowed to have faces. We gave each sprinkle surrounding the current sprinkle, s, a number. Like so:
Then, in our Python program we had a four character string for s. If we looked at the sprinkle in the 1 position and saw that it wasn’t to be used in the final object, then we put a 1 as the first character in the string, indicating that, eventually, a face will need to be made facing that position. If the sprinkle at that position is not to be used, then a 0 would be put into the first character, indicating that a face should not be created there.
This method is done for all four positions for all sprinkles that were to be used in the object. Then we sent all the strings with their corresponding sprinkle coordinates into Blender.
Once in Blender we just have to look at the string of neighboring sprinkles to see where to make faces for each sprinkle. We then tested an object. In Blender we can see which faces have been created and it seems, with a few exceptions, that our method has worked.
After exporting the STL and running it through skeinforge, there is a noticable difference in the filling patterns that are created. Here is an example of a layer produced by skeinforge now:
The printer seems much happier while producing the objects as well. This is especially important, as loyalty is a key factor in the quest for world domination.