Skip to content

Instantly share code, notes, and snippets.

@zabacad
Created May 1, 2019 16:47
Show Gist options
  • Save zabacad/2c1586a75aefc7b2d706f1eafb1a6720 to your computer and use it in GitHub Desktop.
Save zabacad/2c1586a75aefc7b2d706f1eafb1a6720 to your computer and use it in GitHub Desktop.
/*
* LEGO 3001
*/
$fn=32;
color("red") {
union() {
/* Main shape */
difference() {
translate([.1, .1, 0]) {
cube([32 - 2 * .1, 16 - 2 * .1, 9.6]);
}
translate([1.6, 1.6, -2]) {
cube([32 - 2 * 1.6, 16 - 2 * 1.6, 8 + 2]);
}
}
/* Studs */
for (x = [0 : 1 : 3]) {
for (y = [0 : 1 : 1]) {
translate([8 * x + 4, 8 * y + 4, 9.6]) {
cylinder(1.6, r=4 - 1.6);
}
}
}
/* Underside tubes */
for (x = [0 : 1 : 2]) {
for (y = [0 : 1 : 0]) {
translate([(x + 1) * 8, (y + 1) * 8, 0]) {
difference() {
cylinder(9.6 - 1.4, r=sqrt(128) / 2 - 2.4);
translate([0, 0, -2]) {
cylinder(9.6 - 1.4 + 2, r=4 - 1.6);
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment