Introduction: 3D Printed Kilner Jar Labels Using SCAD
This Instructable details how to create 3D printed labels for Kilner Jars.
The SCAD file is available through Thinigverse for personal printing, but is not available for commercial use. If you don't have a printer, but wish to have these, they are available for purchase through my Etsy shop.
Although this Instructable details how I created the Kilner lid labels, the customisable labels are available through Thingiverse. Thingiverse has a customizer tool which can be used to create the STL files required. However the Thingiverse Customiser doesn't quite work with booleans, so I recommend downloading the OpenSCAD file and using OpenSCAD.
If you are not interested in learning about OpenSCAD and you only wish to create and 3D print these labels, please skip to Step 4
- 3D Printer (I have a Prusa Mk3s)
- PLA filament (preferably 2 contrasting colours)
- (Optional) OpenSCAD software (free)
Step 1: OpenSCAD
OpenSCAD is a very powerful tool for creating solid 3D objects through a programming language with a similar syntax to C or Java.
By combining basic 3D shapes such as cubes, spheres etc., complex shapes can be created. These complex shapes can be then exported as STLs for 3D printing.
- Download the latest version of OpenSCAD.
- Install OpenSCAD to your machine
- Get the STL file from Thingiverse and save it to your local machine
- Open the file in SCAD by going to File-->Open and selecting the file.
Step 2: The Code
OpenSCAD is a programming style language where you add and subtract objects to give you the desired result. Since it is a programming language, ir is very easy to change some variables to give different results. In this Kilner Jar Label OpenSCAD example, I have 4 main variables that can be over-ridden. These are:
- textSize - Specify the size of the text to be used
- drawText - A boolean flag (true or false) to draw either the main lid or the text on the lid. This is required to create the items for a multi-part print
- singleColour - A boolean flag (true or false) to detail whether a single colour label is required, or a whether it should be a two colour print
- textLabel - The text to be written on the top of the Kilner Jar Label
Within OpenSCAD, these variables are easily customisable in the Customizer (View-->Hide Customizer)
Step 3: Overview
The code is in 4 sections:
- Customisable parameters - These are the 'global' variables at the top of the file. The first two are used to get a more accurate result. If these are not set, the object is 'blockier' with not as round disks. The other 4 variables are the variables that are picked up by the Customizer window within OpenSCAD. The 'main' CreateLid() function is then called to run the other modules.
- CreateLid() - This is a the 'main' function for this script. It sets a few variables that are used to create the labels. When using SCAD I tend to put most things in variables as it gives the ability to modify the result afterwards to get exactly what is wanted. These variables are then passed to the two functions drawLid() and drawLidText(). These functions are only called depending on the value of the drawText boolean.
- drawLid() - This is the main module for drawing the lid
- A polygon in the shape of the cross section that is required is created
- The polygon is then rotated around the central axis
- From this 3D object, we remove the required text, so it is cut away
- Two large rectangles are then taken away to leave only the sides that grip onto the lid
- Finally, we check if this is a singleColour lid. If it ISN'T, remove a ring around the edge of the lid. This is to have a coloured ring around the edge. This coloured ring looks nice, but more importantly makes both parts of the multi-colour lid the same size. This allows both STL files to be centralised within the slicing software.
- Create the text exactly the same way as the cut out was made in 3.3
- Create the ring around the edge in exactly the same way as in 3.5
Step 4: Generate the STL File(s) Using OpenSCAD
To generate the STL file(s), we need to execute the OpenSCAD script. There are a couple of ways of doing this:
If you are using the OpenSCAD software, select the appropriate settings in the Customiser section (to open Customiser if it is closed, toggle View-->Hide Customizer.
Select the appropriate values for:
- textSize - Size of the text to display
- drawText - Should it draw the text or the lid?
- singleColour - Is this a single colour lid or multi-colour?
- textLabel - The text that is desired
Render the object
Once the values have been selected, the object needs to be rendered. Rendering creates the model correctly. The preview shows enough so the object can be visualised, but to export the object it must be rendered first. To render the object, either use the menu item or press F6. Rendering will take a small amount of time, and once completed you should receive an audio signal.
Export as STL
Once the object has been rendered, it should be exported as a STL file. This can be done by either clicking on the STL button, or going to File-->Export-->Export as STL.
The object should be saved to disk.
If generating a multi-coloured lid, the customiser should be run for both drawText set as true, and drawText set as false. Make sure the filenames are named accordingly.
Step 5: Slicing the Objects and Creating the GCODE
If a single colour lid is being created, simply slice the object as you would do normally and print. A singleColour lid doesn't require any supports.
If a multi-colour lid is being created, this is where it gets more complicated. For both objects, I use the following settings:
- No support
- Infill 15% to 25%
- 0.2 mm layer height
- No brim, skirt or raft
- PETG - 230C Nozzle, 70C Bed (although PLA can be used)
Import the text object and slice with the above parameters. Then save the GCODE to disk
Remove the text object from above and load the lid object. Slice with the same parameters and save the GCODE to disk under a different name.
It should be possible to simply print the two objects back to back without removing the first object from the build plate. However for this, you will need to remove any extrusion from the build plate (such as the purge line the Prusa creates) and any bed levelling before printing the second part.
Change Filament GCODE command
GCODE is the instruction language that is used by 3D printers to instruct them what to do. Although there are some slightly different flavours, I am using Marlin which is what the Prusa Mk3s printer uses.
- M600 - Change filament.
However this next step requires some basic understanding of GCODE to perform the task.
Step 6: Editing the GCODE
Using a text editor (I am using Atom on a Mac, but Notepad or Notepad++ on a Windows machine works just as well), open up both of the generated GCODE files.
In the 'Text' GCODE, scroll to the very bottom of the file. In Prusa Slicer, there are a number of comments at the bottom about the print, the filament used, the cost etc. Scroll up until the start of that block.
A few lines above is a comment saying:
; Filament-specific end gcode
The line above that M107 is sending a command to the 3D printer about the fan, so delete the M107 line to the end of the document.
After the deletion, add in the M600 command to change the filament of the printer:
In the 'Lid' GCODE, near the top there are a couple of lines similar to:
Copy the GCODE from this location down, all the way to the end of the GCODE file, and paste it into the 'Text' GCODE that was edited above. Save the file as a new name.
Please note that when printing the object, the time the printer tells you it will take may be wrong. However it should still print just fine.
Step 7: Print the Lid
Print the lid as you would normally do. I use OctoPrint to help as this allows greater control over the print than simply copying to a SD card.
After about 8 minutes, the 'text' should be printed, and the printer should request a filament change. Follow the steps on the printer to change the filament, and the second colour (the main lid) should then be printed.
I tend to run the print (at least for the first colour, and the first layer of the second colour) at about 60% speed. This allows the dots on the top of i's to be printed properly, and the second colour can have the problem of moving the first colour text which ruins the print. Dropping the speed to 60% seems to fix that.
Participated in the