fliegendewurst.eu/static/assets/RPi-Zero.scad
2023-11-11 19:23:56 +01:00

227 lines
7.2 KiB
OpenSCAD

final = !$preview;
module pizero() {
difference() {
color("green") import("pizero-scase_new.stl");
if (final) {
translate([34.4, -25, 1.05]) cube([1,50,.5]);
translate([34.5, -25, 1.15]) cube([1,50,.5]);
translate([34.6, -25, 1.25]) cube([1,50,.5]);
translate([34.7, -25, 1.35]) cube([1,50,.5]);
translate([34.8, -25, 1.45]) cube([1,50,.5]);
// keep 4.75 - 5.45 = 0.7
h = 10.5;
translate([34.8, -25, 5.45]) cube([1,50,h]);
translate([34.7, -25, 5.55]) cube([1,50,h]);
translate([34.6, -25, 5.65]) cube([1,50,h]);
translate([34.5, -25, 5.75]) cube([1,50,h]);
translate([34.4, -25, 5.85]) cube([1,50,h]);
}
}
}
module oled_hole() {
intersection () {
translate([0,0,0]) import("OLED_Under_Cabinet.stl");
cube([48, 10, 40], center=true);
}
}
module led_hole() {
translate([-1.25, 19, 30]) {
rotate([90, 0, 0]) cylinder(10, .5, .5, center = true, $fn=32);
}
translate([1.25, 19, 30]) {
rotate([90, 0, 0]) cylinder(10, .5, .5, center = true, $fn=32);
}
}
module extender() {
difference() {
s = 90 - 8.5;
//s = 12.5;
h = s;
union() {
/*
translate([0, 19, 60]) {
color("red") rotate([90, 0, 0]) cylinder(10, 1, center = true);
}
*/
translate([0,0,8.5 + s/2]) linear_extrude(s, center=true) projection(cut = true) translate([0,0,-8]) pizero();
translate([33, -15, 8.5]) cube([1,30,s]);
for ( i = [ 1 : 6 ] ) {
w = 19.95;
color("red")
translate([33 + i/10, -w/2 + 0.65, 8.5 - i/10]) cube([0.7 - i/10,w,s]);
}
difference() {
union() {
translate([0,0,8]) cube([34*2,33,2], center=true);
translate([0,0,9]) cube([34*2,33,1], center=true);
}
union () {
scale([0.99, 0.99, 1]) pizero();
translate([-33,17.5,8.5]) cube([3.4,3.4,10], center=true);
translate([-34.9,16,8.5]) cube([3.4,3.4,10], center=true);
translate([33,17.5,8.5]) cube([3.4,3.4,10], center=true);
translate([34.9,16,8.5]) cube([3.4,3.4,10], center=true);
mirror([0,1,0]) {
translate([-33,17.5,8.5]) cube([3.4,3.4,10], center=true);
translate([-34.9,16,8.5]) cube([3.4,3.4,10], center=true);
translate([33,17.5,8.5]) cube([3.4,3.4,10], center=true);
translate([34.9,16,8.5]) cube([3.4,3.4,10], center=true);
}
translate([0,0,8.5]) cube([32*2,14.5*2,10],center=true);
translate([34,0,8.5]) cube([5,14.5*2,10],center=true);
}
}
}
translate([34.4, -25, 8.5]) cube([1,50,h]);
translate([0, 19, 60]) difference() {
cube([48,10,40], center=true);
oled_hole();
}
led_hole();
translate([-10,0,0]) {
led_hole();
}
translate([-20,0,0]) {
led_hole();
}
translate([10,0,0]) {
led_hole();
}
translate([20,0,0]) {
led_hole();
}
// cable hole
translate([35,0,70]) {
minkowski()
{
color("red") cube([5,5,2], center=true);
rotate([0,90,0]) cylinder(r1=2,r2=2,h=1, center=true, $fn=32);
}
}
// icons
translate([0, 17.9 - .5, 41]) {
scale = 0.19;
translate([-14, 0, 0]) scale([scale, 1, scale]) rotate([90,0,0]) linear_extrude(1) import("./rpi_logo.svg", center=true);
translate([-5, 0, 0]) scale([scale, 1, scale]) rotate([90,0,0]) linear_extrude(1) import("./Calendar_font_awesome.svg", center=true);
translate([5, 0, 0]) scale([scale, 1, scale]) rotate([90,0,0]) linear_extrude(1) import("./to cry.svg", center=true);
translate([14, 0, 0]) scale([scale, 1, scale]) mirror([1,0,0]) rotate([90,0,0]) linear_extrude(1) import("./temp.svg", center=true);
}
}
}
module button_hole() {
difference() {
cube([12.4 + 0.05, 12.4 + 0.05,5], center=true);
translate([6.05 + 0.05 / 2, -3.81, 0]) cube([0.3,2.6,5], center=true);
translate([6.05 + 0.05 / 2, 3.81, 0]) cube([0.3,2.6,5], center=true);
translate([-6.05 - 0.05 / 2, -3.81, 0]) cube([0.3,2.6,5], center=true);
translate([-6.05 - 0.05 / 2, 3.81, 0]) cube([0.3,2.6,5], center=true);
}
}
module hat() {
difference() {
translate([0,0,98.5]) mirror([0,0,1]) difference() {
union() {
pizero();
color("red") translate([33, -13.5, 2.65]) cube([1.4,27,5.85]);
color("red") translate([-33-1.4, -13.5, 2.65]) cube([1.4,27,5.85]);
color("red") translate([-30, -18.3+1.4, 2.4]) cube([60,1.4,5.85]);
translate([-30, -15, 0]) cube([60,30,1.4]);
translate([0,0,8.5]) difference() {
cube([66,32,4],center=true);
cube([63,28,4],center=true);
}
}
translate([34.4, -25, 1.05]) cube([1,50,5]);
translate([0, 0, 0]) button_hole();
translate([-20, 0, 0]) button_hole();
translate([20, 0, 0]) button_hole();
}
scale([0.99, 0.99, 1]) extender();
}
}
module sticks1(s=1) {
for ( i = [0 : 8] ){
if (i != 6) {
translate([33.7,0,20+i*8]) cube([s*.75,8,s*.75], center=true);
}
translate([-33.7,0,20+i*8]) cube([s*.75,8,s*.75], center=true);
}
}
module sticks2(s=1) {
translate([0,0,4]) sticks1(s);
}
module print1() {
difference() {
intersection() {
extender();
translate([0,50,0]) cube([1000,100,1000], center=true);
}
sticks2(1.05);
}
sticks1();
}
module print2() {
difference() {
intersection() {
extender();
mirror([0,1,0]) translate([0,50,0]) cube([1000,100,1000], center=true);
}
sticks1(1.05);
}
sticks2();
}
module print3() {
hat();
}
module pyramid() {
difference() {
union() {
for ( i = [0 : 8]) {
s = (8 - i) / 2;
translate([- s, - s, i * 0.5])
cube([4+s,4+s,.5]);
x = 2.5;
}
}
x = 2.6;
translate([4-x,4-x,1])
cube([x,x,4]);
}
}
module fixer() {
translate([0, 30, 1]) linear_extrude(2, center=true) circle(5, $fn=32);
translate([-15, 25, 1]) rotate([0,0,20])scale([1,0.1,1]) linear_extrude(2, center=true) circle(20, $fn=32);
mirror([1,0,0]) translate([-15, 25, 1]) rotate([0,0,20])scale([1,0.1,1]) linear_extrude(2, center=true) circle(20, $fn=32);
translate([0, 50, 1]) linear_extrude(2, center=true) circle(5, $fn=32);
translate([0, 40, 1]) rotate([0,0,90])scale([.7,0.1,1]) linear_extrude(2, center=true) circle(20, $fn=32);
}
module print4() {
difference() {
union() {
pizero();
translate([-34.4 , -16.9, 0]) pyramid();
translate([-34.4 , 16.9, 0]) rotate([0, 0, 270]) pyramid();
translate([34.4 , -16.9, 0]) rotate([0,0,90]) pyramid();
translate([34.4 , 16.9, 0]) rotate([0, 0, 180]) pyramid();
fixer();
mirror([0, 1, 0]) {
fixer();
}
}
translate([21.5, -17, 4.5]) cube([14, 4, 9], center=true);
translate([21.5, -25, 4.5]) cube([14,20, 7], center=true);
}
}
//rotate([-90,0,0]) print1();
//rotate([90,0,0]) print2();
//mirror([0,0,1]) print3();
//print4();
module all() {
print1();
print2();
print3();
print4();
}
all();