Commit 6bd20696 authored by György Kurucz's avatar György Kurucz
Browse files

Refactored the pcb_box models.

Added the bottle opener mode to this repo.
parent 122148f8
label = "STwzYmVlciEK";
rotate_text = 0; //0: right handed, 180: left handed
//================
module txt() {
translate([-15,0,10])
rotate([0,-4,0])
linear_extrude(3, convexity=3)
rotate([0, 0, rotate_text])
rotate([0, 0, 180])
text(label, valign="center", halign="center", size=6.5, font="Noto Sans Mono:style=Bold");
}
difference() {
rotate([90,0,0]) import("bottle_opener.stl", convexity=4);
txt();
}
//txt();
\ No newline at end of file
module poly_path848(h)
{
scale([25.4/90, -25.4/90, 1]) union()
{
polygon([[151.618930,56.241865],[146.082523,51.088639],[140.150157,46.125357],[133.808413,41.372420],[127.043872,36.850226],[119.843115,32.579173],[112.192724,28.579660],[104.079280,24.872086],[95.489364,21.476849],[86.409558,18.414349],[76.826442,15.704982],[66.726598,13.369149],[56.096607,11.427248],[44.923050,9.899677],[33.192510,8.806835],[20.891566,8.169121],[8.006800,8.006933],[8.170683,20.893416],[8.813235,33.199214],[9.913607,44.937297],[11.450954,56.120636],[13.404427,66.762202],[15.753179,76.874964],[18.476364,86.471895],[21.553133,95.565964],[24.962639,104.170143],[28.684036,112.297402],[32.696476,119.960712],[36.979112,127.173043],[41.511096,133.947366],[46.271581,140.296652],[51.239720,146.233872],[56.394665,151.771996],[61.931072,156.925223],[67.863438,161.888504],[74.205182,166.641441],[80.969723,171.163635],[88.170480,175.434688],[95.820871,179.434201],[103.934315,183.141775],[112.524231,186.537012],[121.604037,189.599513],[131.187153,192.308879],[141.286997,194.644712],[151.916988,196.586614],[163.090544,198.114185],[174.821085,199.207027],[187.122029,199.844741],[200.006795,200.006928],[199.842888,187.120445],[199.200316,174.814647],[198.099926,163.076564],[196.562566,151.893225],[194.609082,141.251660],[192.260322,131.138897],[189.537133,121.541967],[186.460362,112.447897],[183.050857,103.843718],[179.329465,95.716460],[175.317033,88.053150],[171.034408,80.840819],[166.502438,74.066495],[161.741970,67.717209],[156.773852,61.779989],[151.618930,56.241865]]);
}
}
module poly_path846()
{
scale([25.4/90, -25.4/90, 1]) union()
{
polygon([[-151.612130,56.234932],[-146.075746,51.081727],[-140.143401,46.118462],[-133.801674,41.365537],[-127.037147,36.843349],[-119.836401,32.572299],[-112.186018,28.572786],[-104.072579,24.865208],[-95.482664,21.469966],[-86.402856,18.407458],[-76.819736,15.698084],[-66.719884,13.362243],[-56.089882,11.420333],[-44.916311,9.892755],[-33.185753,8.799907],[-20.884789,8.162189],[-8.000000,8.000000],[-8.163907,20.886507],[-8.806479,33.192325],[-9.906869,44.930426],[-11.444231,56.113780],[-13.397717,66.755358],[-15.746480,76.868132],[-18.469673,86.465071],[-21.546449,95.559148],[-24.955962,104.163332],[-28.677363,112.290595],[-32.689805,119.953907],[-36.972443,127.166241],[-41.504428,133.940565],[-46.264914,140.289852],[-51.233053,146.227072],[-56.387999,151.765196],[-61.924382,156.918401],[-67.856727,161.881665],[-74.198454,166.634591],[-80.962979,171.156777],[-88.163723,175.427825],[-95.814103,179.427335],[-103.927538,183.134909],[-112.517447,186.530145],[-121.597248,189.592646],[-131.180360,192.302012],[-141.280201,194.637842],[-151.910190,196.579739],[-163.083745,198.107302],[-174.814285,199.200132],[-187.115229,199.837829],[-199.999995,199.999995],[-199.836112,187.113512],[-199.193560,174.807714],[-198.093187,163.069631],[-196.555841,151.886292],[-194.602368,141.244727],[-192.253616,131.131964],[-189.530431,121.535033],[-186.453662,112.440964],[-183.044155,103.836785],[-179.322759,95.709526],[-175.310319,88.046217],[-171.027683,80.833885],[-166.495699,74.059562],[-161.735214,67.710276],[-156.767075,61.773056],[-151.612130,56.234932]]);
}
}
module poly_path852()
{
scale([25.4/90, -25.4/90, 1]) union()
{
polygon([[151.618930,-56.227999],[146.082523,-51.074772],[140.150157,-46.111491],[133.808413,-41.358554],[127.043872,-36.836359],[119.843115,-32.565307],[112.192724,-28.565794],[104.079280,-24.858220],[95.489364,-21.462983],[86.409558,-18.400482],[76.826442,-15.691115],[66.726598,-13.355282],[56.096607,-11.413381],[44.923050,-9.885810],[33.192510,-8.792968],[20.891566,-8.155254],[8.006800,-7.993066],[8.170683,-20.879550],[8.813235,-33.185348],[9.913607,-44.923431],[11.450954,-56.106769],[13.404427,-66.748335],[15.753179,-76.861098],[18.476364,-86.458028],[21.553133,-95.552098],[24.962639,-104.156276],[28.684036,-112.283535],[32.696476,-119.946845],[36.979112,-127.159176],[41.511096,-133.933499],[46.271581,-140.282786],[51.239720,-146.220005],[56.394665,-151.758130],[61.931072,-156.911356],[67.863438,-161.874637],[74.205182,-166.627574],[80.969723,-171.149769],[88.170480,-175.420821],[95.820871,-179.420334],[103.934315,-183.127908],[112.524231,-186.523145],[121.604037,-189.585646],[131.187153,-192.295013],[141.286997,-194.630846],[151.916988,-196.572747],[163.090544,-198.100318],[174.821085,-199.193160],[187.122029,-199.830874],[200.006795,-199.993062],[199.842888,-187.106578],[199.200316,-174.800781],[198.099926,-163.062698],[196.562566,-151.879359],[194.609082,-141.237793],[192.260322,-131.125031],[189.537133,-121.528100],[186.460362,-112.434031],[183.050857,-103.829852],[179.329465,-95.702593],[175.317033,-88.039283],[171.034408,-80.826952],[166.502438,-74.052629],[161.741970,-67.703343],[156.773852,-61.766123],[151.618930,-56.227999]]);
}
}
module poly_path850()
{
scale([25.4/90, -25.4/90, 1]) union()
{
polygon([[-151.612130,-56.221199],[-146.075746,-51.067970],[-140.143401,-46.104685],[-133.801674,-41.351742],[-127.037147,-36.829541],[-119.836401,-32.558480],[-112.186018,-28.558959],[-104.072579,-24.851377],[-95.482664,-21.456133],[-86.402856,-18.393626],[-76.819736,-15.684257],[-66.719884,-13.348423],[-56.089882,-11.406525],[-44.916311,-9.878961],[-33.185753,-8.786130],[-20.884789,-8.148432],[-8.000000,-7.986266],[-8.163907,-20.872750],[-8.806479,-33.178548],[-9.906869,-44.916631],[-11.444231,-56.099969],[-13.397717,-66.741535],[-15.746480,-76.854298],[-18.469673,-86.451228],[-21.546449,-95.545298],[-24.955962,-104.149476],[-28.677363,-112.276735],[-32.689805,-119.940045],[-36.972443,-127.152376],[-41.504428,-133.926699],[-46.264914,-140.275986],[-51.233053,-146.213205],[-56.387999,-151.751330],[-61.924382,-156.904556],[-67.856727,-161.867837],[-74.198454,-166.620774],[-80.962979,-171.142969],[-88.163723,-175.414021],[-95.814103,-179.413534],[-103.927538,-183.121108],[-112.517447,-186.516345],[-121.597248,-189.578846],[-131.180360,-192.288213],[-141.280201,-194.624046],[-151.910190,-196.565947],[-163.083745,-198.093518],[-174.814285,-199.186360],[-187.115229,-199.824074],[-199.999995,-199.986262],[-199.836112,-187.099777],[-199.193560,-174.793975],[-198.093187,-163.055886],[-196.555841,-151.872540],[-194.602368,-141.230966],[-192.253616,-131.118195],[-189.530431,-121.521257],[-186.453662,-112.427181],[-183.044155,-103.822996],[-179.322759,-95.695734],[-175.310319,-88.032424],[-171.027683,-80.820096],[-166.495699,-74.045779],[-161.735214,-67.696504],[-156.767075,-61.759301],[-151.612130,-56.221199]]);
}
}
module stencil() {
difference() {
minkowski() {
square([80, 80], center=true);
circle(30, $fn=100);
}
poly_path848();
poly_path846();
poly_path852();
poly_path850();
}
}
linear_extrude(4) stencil();
\ No newline at end of file
pcb = [55, 63, 1.65];
margin = 0.5;
lip = 1;
height = 12;
corner_r = 2;
bottom_wall = 1;
top_height = 6.5;
top_part_thickness = 2;
module txt(t, s=4) {
text(t, font="DejaVu Sans Mono", size=s);
}
module cutouts() {
translate([15, 1.5]) square([20, 25.5-1.5]); //inputs
translate([38, 1.5]) square([16, 25.5-1.5]); //dimmers
translate([35, 31-5/2]) square([8, 20]); //isp
translate([33, 31+15/2-5/2]) square([5, 5]); //isp notch
translate([16+3-0.6, 56]) square([18, 6]); //rpi
translate([8+1, 43]) square([9, 7]); //switches
translate([4+1-0.5, 28+2.5]) square([7, 10]);
}
module markings() {
translate([pcb.x-3, pcb.y-36.5]) rotate(90) txt("Controller", 4.6);
//translate([13.5, 5.5]) rotate(90) txt("buses");
//translate([pcb.x+1.5, 4]) rotate(90) txt("dimmers", 3);
translate([21.5, pcb.y-14]) rotate(0) txt("rPi", 5);
//translate([31, 33]) rotate(90) txt("ISP");
translate([13, 30]) rotate(0) txt("+12V");
translate([13, 36]) rotate(0) txt("+5V");
translate([-1.5, 35]) rotate(0) txt("-", 7);
translate([-1.5, 29]) rotate(0) txt("-", 7);
}
\ No newline at end of file
pcb = [40, 40, 1.6];
module cutouts() {
translate([10.14, 8.02]) square([18, 6.5], center=true); //P2
translate([10.14, 8.02-2]) square([5, 6], center=true);
offset(1, $fn=30) translate([7.91, 35.99]) square([13.80, 3.65], center=true); //P1
}
module post_process() {
difference() {
children();
translate([0, 0, height/2+4]) rotate([0, 90, 0]) cylinder(d=8, h=100, $fn=50);
}
}
\ No newline at end of file
pcb = [45.02, 44.8, 1.75];
extend = [0, 8];
height = 15;
top_height = 20 - 5;
top_part_thickness = 2;
module cutouts() {
translate([14.02+18.4858/2, 12.95+16.4/2]) circle(r=7, $fn=30); //sw1
translate([31.895+10.75/2, 15.925+9.95/2]) circle(r=4, $fn=30);
}
module markings() {
}
module post_process() {
difference() {
children();
translate([0, 0, 50+bottom_wall]) cube([20, pcb.y+extend.y, 100], center=true);
cylinder(d=8, center=true, h=5, $fn=30);
}
}
\ No newline at end of file
/* config 1
pcb = [55, 63, 1.65];
margin = 0.5;
lip = 1;
height = 12;
corner_r = 2;
bottom_wall = 1;
top_height = 6.5;
top_part_thickness = 2;
*/
pcb = [45.02, 44.8, 1.75];
margin = 0.7;
extend = [0, 8];
extend = [0, 0];
lip = [1, 1];
height = 15;
height = 10;
corner_r = 2;
bottom_wall = 1;
top_height = 20 - 5;
top_part_thickness = 2;
top_height = 5;
top_part_margin = 0.4;
top_part_thickness = 1;
module txt(t, s=4) {
text(t, font="DejaVu Sans Mono", size=s);
module post_process() {
children();
}
module cutouts() { }
module markings() { }
//include <boxes/lighting_input.scad>;
include <boxes/lighting_dimmer.scad>;
module outline() {
minkowski() {
......@@ -41,34 +34,16 @@ module bottom_part() {
}
module connectors() {
translate([-pcb.x/2, -pcb.y/2]) {
/* config1
translate([15, 1.5]) square([20, 25.5-1.5]); //inputs
translate([38, 1.5]) square([16, 25.5-1.5]); //dimmers
translate([35, 31-5/2]) square([8, 20]); //isp
translate([33, 31+15/2-5/2]) square([5, 5]); //isp notch
translate([16+3-0.6, 56]) square([18, 6]); //rpi
translate([8+1, 43]) square([9, 7]); //switches
translate([4+1-0.5, 28+2.5]) square([7, 10]);
*/
translate([14.02+18.4858/2, 12.95+16.4/2]) circle(r=7, $fn=30); //sw1
translate([31.895+10.75/2, 15.925+9.95/2]) circle(r=4, $fn=30);
/*mirroring is used here because of the coordinate
system differences with KiCad*/
mirror([0, 1, 0]) translate([-pcb.x/2, -pcb.y/2]) {
cutouts();
}
}
module markings() {
module top_marks() {
translate([-pcb.x/2, -pcb.y/2]) {
/* config1
translate([pcb.x-3, pcb.y-36.5]) rotate(90) txt("Controller", 4.6);
//translate([13.5, 5.5]) rotate(90) txt("buses");
//translate([pcb.x+1.5, 4]) rotate(90) txt("dimmers", 3);
translate([21.5, pcb.y-14]) rotate(0) txt("rPi", 5);
//translate([31, 33]) rotate(90) txt("ISP");
translate([13, 30]) rotate(0) txt("+12V");
translate([13, 36]) rotate(0) txt("+5V");
translate([-1.5, 35]) rotate(0) txt("-", 7);
translate([-1.5, 29]) rotate(0) txt("-", 7);
*/
markings();
}
}
......@@ -84,15 +59,11 @@ module top_part() {
linear_extrude(height+top_height-top_part_thickness) square([pcb.x - lip.x*2, pcb.y - lip.y*2], center=true);
linear_extrude(50) connectors();
t = top_part_thickness;
translate([0, 0, height+top_height-t/2]) linear_extrude(t) markings();
translate([0, 0, height+top_height-t/2]) linear_extrude(t) top_marks();
}
}
//difference() {
// bottom_part();
// translate([0, 0, 50+bottom_wall]) cube([20, pcb.y+extend.y, 100], center=true);
// cylinder(d=8, center=true, h=5, $fn=30);
//}
//post_process() bottom_part();
rotate([180, 0, 0])
//translate([0, 0, 3])
top_part();
\ No newline at end of file
//translate([0, 0, .5])
post_process() top_part();
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment