Last active
August 9, 2025 18:03
-
-
Save Timmiej93/4b53ce9bedd12e1705290a0900ebe04a to your computer and use it in GitHub Desktop.
OpenSCAD file to create a 3D-printable label with text on both sides and attachment holes for zip ties.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Created by Tim Derks | |
| 2025-08-09 | |
| Source: https://gist.github.com/Timmiej93/4b53ce9bedd12e1705290a0900ebe04a | |
| OpenSCAD file to create a 3D-printable label with text on both sides and attachment holes for zip ties. | |
| Customizations: | |
| - Text: The text on the label; | |
| - FlipAroundX: Which way the text on the back should face. | |
| - True: Flip around X axis (start of word stays on the same side); | |
| - False: Flip around Y axis (top of word stays on the same side); | |
| - TextScale: Textsize relative to the label size; | |
| - DisableProtection: Enable to get larger letters. Text size is limited to prevent uppercase letters and letters that | |
| stick down (p, g, etc.) from extending beyond the label. This can result in lowercase text that is too small. | |
| Disabling the protection can fix this. | |
| - Height: Label height (short side) [mm]; | |
| - Length: Label length (long side) [mm]; | |
| - Thickness: Label thickness [mm]; | |
| - Diameter: Attachment holes diameter [mm]; | |
| - BothSides: Add a hole on both sides of the label [mm]; | |
| */ | |
| /* [Text settings] */ | |
| Text = "Text"; | |
| // If true, flip around X axis (start of word stays on same side). If false, flip around Y axis (top of word stays on the same side). | |
| FlipAroundX = true; | |
| // Relation between label height and text height. | |
| TextScale = 0.8; // [0.05:0.05:1] | |
| // Allows for larger text, may cause issues with capital letters and letters that extend below like p, g, etc. | |
| DisableProtection = false; | |
| /* [Dimension settings] */ | |
| // mm | |
| Height = 20; // [10:1:100] | |
| // mm | |
| Length = 100; // [10:1:250] | |
| // mm | |
| Thickness = 0.6; // [0.3:0.1:10] | |
| /* [Hole(s) settings] */ | |
| // mm | |
| Diameter = 5; // [1:0.5:20] | |
| BothSides = false; | |
| /* [Hidden] */ | |
| letterInlay = 0.1; | |
| i_TextScale = DisableProtection ? TextScale : TextScale*0.70; | |
| i_length = Length-Height; | |
| module label() { | |
| union() { | |
| cylinder(Thickness, Height/2, Height/2, $fn=100); | |
| translate([0,-Height/2,0]) { | |
| cube([i_length, Height, Thickness], 0); | |
| } | |
| translate([i_length,0,0]) { | |
| cylinder(Thickness, Height/2, Height/2, $fn=100); | |
| } | |
| } | |
| } | |
| module attachmentHoles() { | |
| cylinder(h=Thickness*2, d1=Diameter, d2=Diameter, $fn=50); | |
| if (BothSides) { | |
| translate([i_length,0,0]) | |
| cylinder(h=Thickness*2, d1=Diameter, d2=Diameter, $fn=50); | |
| } | |
| } | |
| module textBothSides() { | |
| module textSingle() { | |
| color("black") | |
| linear_extrude(letterInlay) | |
| text( | |
| text=Text, | |
| size=Height*i_TextScale, | |
| halign="center", | |
| valign="center", | |
| font="Arial:style=Bold" | |
| ); | |
| } | |
| //FlipAroundX | |
| FlipCoordinates = FlipAroundX ? [180,0,0] : [0,180,0]; | |
| // Move text over slightly to center it nicer when only one side has a hole | |
| xTranslate = BothSides ? i_length/2 : (i_length/2)+(Diameter/2); | |
| translate([xTranslate,0,0]) { | |
| translate([0,0,Thickness-letterInlay+0.01]) { | |
| textSingle(); | |
| } | |
| translate([0,0,letterInlay-0.01]) { | |
| rotate(FlipCoordinates) { | |
| textSingle(); | |
| } | |
| } | |
| } | |
| } | |
| translate([-i_length/2,0,0]) { | |
| difference() { | |
| label(); | |
| attachmentHoles(); | |
| textBothSides(); | |
| } | |
| textBothSides(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment