Created
January 18, 2016 05:51
-
-
Save ryankurte/c5cac98b2863eebc80e2 to your computer and use it in GitHub Desktop.
3d printed barcode
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
barcode_width = 113; | |
barcode_height = 30; | |
barcode_depth = 2; | |
module_width = 1; | |
buffer = 4; | |
barcode = [ | |
0, 0, 0, 0, 0, 0, 0, 0, 0, //quiet | |
1, 0, 1, //porch | |
0, 0, 1, 0, 0, 1, 1, //2 left_odd | |
0, 0, 1, 0, 0, 1, 1, //2 left_odd | |
0, 1, 1, 1, 0, 0, 1, //5 left_even | |
0, 0, 1, 1, 1, 0, 1, //4 left_even | |
0, 1, 1, 1, 1, 0, 1, //3 left_odd | |
0, 0, 0, 1, 0, 0, 1, //8 left_even | |
0, 1, 0, 1, 0, //center | |
1, 0, 1, 1, 1, 0, 0, //4 right | |
1, 1, 0, 0, 1, 1, 0, //1 right | |
1, 0, 0, 1, 1, 1, 0, //5 right | |
1, 0, 1, 1, 1, 0, 0, //4 right | |
1, 1, 0, 0, 1, 1, 0, //1 right | |
1, 1, 1, 0, 1, 0, 0, //9 right | |
1, 0, 1, //trailer | |
0, 0, 0, 0, 0, 0, 0, 0, 0 //quiet | |
]; | |
offset = buffer; | |
difference() { | |
cube([barcode_height + buffer * 2, barcode_width * module_width + buffer * 2, barcode_depth]); | |
union() { | |
for (v = [0:barcode_width]) { | |
if(barcode[v] == 0) { | |
translate([buffer, buffer + module_width * v, 0]) { | |
cube([barcode_height, module_width, barcode_depth]); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment